dht: change partitioner name to sstring
It is a better fit for things that are names, not blobs. We have a user that expects a bytes parameter, but that is for no other reason than the fact that the field used to be of bytes type. Let's fix that, and future users will be able to use sstrings Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
@@ -193,7 +193,7 @@ public:
|
||||
/**
|
||||
* @return name of partitioner.
|
||||
*/
|
||||
virtual const bytes name() = 0;
|
||||
virtual const sstring name() = 0;
|
||||
protected:
|
||||
/**
|
||||
* @return true if t1's _data array is equal t2's. _kind comparison should be done separately.
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace dht {
|
||||
|
||||
class murmur3_partitioner final : public i_partitioner {
|
||||
public:
|
||||
virtual const bytes name() { return "org.apache.cassandra.dht.Murmur3Partitioner"; }
|
||||
virtual const sstring name() { return "org.apache.cassandra.dht.Murmur3Partitioner"; }
|
||||
virtual token get_token(const schema& s, partition_key_view key) override;
|
||||
virtual token get_token(const sstables::key_view& key) override;
|
||||
virtual token get_random_token() override;
|
||||
|
||||
@@ -1118,7 +1118,7 @@ static void maybe_add_summary_entry(summary& s, bytes_view key, uint64_t offset)
|
||||
// In the beginning of the statistics file, there is a disk_hash used to
|
||||
// map each metadata type to its correspondent position in the file.
|
||||
static void seal_statistics(statistics& s, metadata_collector& collector,
|
||||
const bytes partitioner, double bloom_filter_fp_chance) {
|
||||
const sstring partitioner, double bloom_filter_fp_chance) {
|
||||
static constexpr int METADATA_TYPE_COUNT = 3;
|
||||
|
||||
size_t old_offset, offset = 0;
|
||||
@@ -1132,7 +1132,7 @@ static void seal_statistics(statistics& s, metadata_collector& collector,
|
||||
stats_metadata stats;
|
||||
|
||||
old_offset = offset;
|
||||
validation.partitioner.value = partitioner;
|
||||
validation.partitioner.value = to_bytes(partitioner);
|
||||
validation.filter_chance = bloom_filter_fp_chance;
|
||||
offset += validation.serialized_size();
|
||||
s.contents[metadata_type::Validation] = std::make_unique<validation_metadata>(std::move(validation));
|
||||
|
||||
Reference in New Issue
Block a user