readers: remove v1 empty_reader

The only user is row level repair: it is replaced with
downgrade_to_v1(make_empty_flat_reader_v2()). The row level reader has
lots of downgrade_to_v1() calls, we will deal with these later all at
once.
Another use is the empty mutation source, this is trivially converted to
use the v2 variant.
This commit is contained in:
Botond Dénes
2022-04-27 16:03:11 +03:00
parent ea37e9c04e
commit f527956cdb
5 changed files with 3 additions and 36 deletions

View File

@@ -1,16 +0,0 @@
/*
* Copyright (C) 2022-present ScyllaDB
*/
/*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#pragma once
#include "schema_fwd.hh"
class flat_mutation_reader;
class reader_permit;
flat_mutation_reader make_empty_flat_reader(schema_ptr s, reader_permit permit);

View File

@@ -16,7 +16,6 @@
#include "range_tombstone_splitter.hh"
#include "readers/combined.hh"
#include "readers/delegating_v2.hh"
#include "readers/empty.hh"
#include "readers/empty_v2.hh"
#include "readers/flat_mutation_reader.hh"
#include "readers/flat_mutation_reader_v2.hh"
@@ -88,20 +87,6 @@ public:
};
} //anon namespace
class empty_flat_reader final : public flat_mutation_reader::impl {
public:
empty_flat_reader(schema_ptr s, reader_permit permit) : impl(std::move(s), std::move(permit)) { _end_of_stream = true; }
virtual future<> fill_buffer() override { return make_ready_future<>(); }
virtual future<> next_partition() override { return make_ready_future<>(); }
virtual future<> fast_forward_to(const dht::partition_range& pr) override { return make_ready_future<>(); };
virtual future<> fast_forward_to(position_range cr) override { return make_ready_future<>(); };
virtual future<> close() noexcept override { return make_ready_future<>(); }
};
flat_mutation_reader make_empty_flat_reader(schema_ptr s, reader_permit permit) {
return make_flat_mutation_reader<empty_flat_reader>(std::move(s), std::move(permit));
}
class empty_flat_reader_v2 final : public flat_mutation_reader_v2::impl {
public:
empty_flat_reader_v2(schema_ptr s, reader_permit permit) : impl(std::move(s), std::move(permit)) { _end_of_stream = true; }
@@ -1450,7 +1435,7 @@ mutation_source make_empty_mutation_source() {
tracing::trace_state_ptr tr,
streamed_mutation::forwarding fwd,
mutation_reader::forwarding) {
return make_empty_flat_reader(s, std::move(permit));
return make_empty_flat_reader_v2(s, std::move(permit));
}, [] {
return [] (const dht::decorated_key& key) {
return partition_presence_checker_result::definitely_doesnt_exist;

View File

@@ -44,7 +44,7 @@
#include "service/storage_proxy.hh"
#include "db/batchlog_manager.hh"
#include "idl/partition_checksum.dist.hh"
#include "readers/empty.hh"
#include "readers/empty_v2.hh"
#include "readers/evictable.hh"
#include "readers/queue.hh"
#include "repair/hash.hh"
@@ -357,7 +357,7 @@ public:
future<> on_end_of_stream() noexcept {
return _reader.close().then([this] {
_reader = make_empty_flat_reader(_schema, _permit);
_reader = downgrade_to_v1(make_empty_flat_reader_v2(_schema, _permit));
_reader_handle.reset();
});
}

View File

@@ -20,7 +20,6 @@
#include "dirty_memory_manager.hh"
#include "cache_flat_mutation_reader.hh"
#include "real_dirty_memory_accounter.hh"
#include "readers/empty.hh"
#include "readers/forwardable_v2.hh"
#include "readers/nonforwardable.hh"

View File

@@ -52,7 +52,6 @@
#include "readers/forwardable.hh"
#include "readers/from_fragments_v2.hh"
#include "readers/generating_v2.hh"
#include "readers/empty.hh"
#include "readers/empty_v2.hh"
#include "readers/next_partition_adaptor.hh"
#include "readers/combined.hh"