From bdabd2e7a483cf73006d440cb62ec42baf2e28c7 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 27 Jun 2019 12:09:37 -0400 Subject: [PATCH] toppartitions: fix typo toppartitons -> toppartitions Signed-off-by: Glauber Costa Message-Id: <20190627160937.7842-1-glauber@scylladb.com> (cherry picked from commit d916601ea421e173f61bddba90ba889a7a2d194e) Ref #5104 (prerequisite for patch) --- db/data_listeners.cc | 6 +++--- db/data_listeners.hh | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/db/data_listeners.cc b/db/data_listeners.cc index f19ddd8f33..cc0c1622b4 100755 --- a/db/data_listeners.cc +++ b/db/data_listeners.cc @@ -57,7 +57,7 @@ void data_listeners::on_write(const schema_ptr& s, const frozen_mutation& m) { } } -toppartitons_item_key::operator sstring() const { +toppartitions_item_key::operator sstring() const { std::ostringstream oss; oss << key.key().with_schema(*schema); return oss.str(); @@ -87,7 +87,7 @@ flat_mutation_reader toppartitions_data_listener::on_read(const schema_ptr& s, c return make_filtering_reader(std::move(rd), [zis = this->weak_from_this(), &range, &slice, s = std::move(s)] (const dht::decorated_key& dk) { // The data query may be executing after the toppartitions_data_listener object has been removed, so check if (zis) { - zis->_top_k_read.append(toppartitons_item_key{s, dk}); + zis->_top_k_read.append(toppartitions_item_key{s, dk}); } return true; }); @@ -98,7 +98,7 @@ void toppartitions_data_listener::on_write(const schema_ptr& s, const frozen_mut return; } dblog.trace("toppartitions_data_listener::on_write: {}.{}", _ks, _cf); - _top_k_write.append(toppartitons_item_key{s, m.decorated_key(*s)}); + _top_k_write.append(toppartitions_item_key{s, m.decorated_key(*s)}); } toppartitions_query::toppartitions_query(distributed& xdb, sstring ks, sstring cf, diff --git a/db/data_listeners.hh b/db/data_listeners.hh index fb6cd55b9a..4095987d03 100755 --- a/db/data_listeners.hh +++ b/db/data_listeners.hh @@ -76,21 +76,21 @@ public: }; -struct toppartitons_item_key { +struct toppartitions_item_key { schema_ptr schema; dht::decorated_key key; - toppartitons_item_key(const schema_ptr& schema, const dht::decorated_key& key) : schema(schema), key(key) {} - toppartitons_item_key(const toppartitons_item_key& key) noexcept : schema(key.schema), key(key.key) {} + toppartitions_item_key(const schema_ptr& schema, const dht::decorated_key& key) : schema(schema), key(key) {} + toppartitions_item_key(const toppartitions_item_key& key) noexcept : schema(key.schema), key(key.key) {} struct hash { - size_t operator()(const toppartitons_item_key& k) const { + size_t operator()(const toppartitions_item_key& k) const { return std::hash()(k.key.token()); } }; struct comp { - bool operator()(const toppartitons_item_key& k1, const toppartitons_item_key& k2) const { + bool operator()(const toppartitions_item_key& k1, const toppartitions_item_key& k2) const { return k1.schema == k2.schema && k1.key.equal(*k2.schema, k2.key); } }; @@ -106,7 +106,7 @@ class toppartitions_data_listener : public data_listener, public weakly_referenc sstring _cf; public: - using top_k = utils::space_saving_top_k; + using top_k = utils::space_saving_top_k; private: top_k _top_k_read; top_k _top_k_write;