token: Handle minimum token correctly in long_token
Fixes: Exiting on unhandled exception of type 'runtime_exception': runtime error: Invalid token. Should have size 8, has size 0
This commit is contained in:
@@ -75,6 +75,9 @@ token murmur3_partitioner::get_random_token() {
|
||||
}
|
||||
|
||||
inline int64_t long_token(const token& t) {
|
||||
if (t.is_minimum()) {
|
||||
return std::numeric_limits<long>::min();
|
||||
}
|
||||
|
||||
if (t._data.size() != sizeof(int64_t)) {
|
||||
throw runtime_exception(sprint("Invalid token. Should have size %ld, has size %ld\n", sizeof(int64_t), t._data.size()));
|
||||
|
||||
Reference in New Issue
Block a user