From 16c975edcc81b843019c45a68d9ec0fd5aea9513 Mon Sep 17 00:00:00 2001 From: Duarte Nunes Date: Tue, 9 Jan 2018 16:28:14 +0000 Subject: [PATCH] partition_version: Return static_row fragment from static_row() Signed-off-by: Duarte Nunes Message-Id: <20180109162815.5811-1-duarte@scylladb.com> --- cache_flat_mutation_reader.hh | 4 ++-- partition_version.cc | 6 +++--- partition_version.hh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cache_flat_mutation_reader.hh b/cache_flat_mutation_reader.hh index 7aba431043..eb971bd959 100644 --- a/cache_flat_mutation_reader.hh +++ b/cache_flat_mutation_reader.hh @@ -160,11 +160,11 @@ inline future<> cache_flat_mutation_reader::process_static_row() { if (_snp->static_row_continuous()) { _read_context->cache().on_row_hit(); - row sr = _lsa_manager.run_in_read_section([this] { + static_row sr = _lsa_manager.run_in_read_section([this] { return _snp->static_row(); }); if (!sr.empty()) { - push_mutation_fragment(mutation_fragment(static_row(std::move(sr)))); + push_mutation_fragment(mutation_fragment(std::move(sr))); } return make_ready_future<>(); } else { diff --git a/partition_version.cc b/partition_version.cc index 675a2f8ff7..e7bea8ef28 100644 --- a/partition_version.cc +++ b/partition_version.cc @@ -112,10 +112,10 @@ inline Result squashed(const partition_version_ref& v, Map&& map, Reduce&& reduc } -row partition_snapshot::static_row() const { - return ::squashed(version(), +::static_row partition_snapshot::static_row() const { + return ::static_row(::squashed(version(), [] (const mutation_partition& mp) -> const row& { return mp.static_row(); }, - [this] (row& a, const row& b) { a.apply(*_schema, column_kind::static_column, b); }); + [this] (row& a, const row& b) { a.apply(*_schema, column_kind::static_column, b); })); } bool partition_snapshot::static_row_continuous() const { diff --git a/partition_version.hh b/partition_version.hh index ee25c92550..c6d5a7d8c2 100644 --- a/partition_version.hh +++ b/partition_version.hh @@ -272,7 +272,7 @@ public: logalloc::region& region() const { return _region; } tombstone partition_tombstone() const; - row static_row() const; + ::static_row static_row() const; bool static_row_continuous() const; mutation_partition squashed() const; // Returns range tombstones overlapping with [start, end)