everywhere: reduce dependencies on i_partitioner.hh

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2023-11-02 17:00:31 +02:00
parent 6de1cc2993
commit a1acf6854b
62 changed files with 64 additions and 50 deletions

View File

@@ -17,7 +17,6 @@
#include "sstables/types_fwd.hh"
#include "sstables/sstable_set.hh"
#include "utils/UUID.hh"
#include "dht/i_partitioner.hh"
#include "compaction_fwd.hh"
namespace sstables {

View File

@@ -9,7 +9,9 @@
#pragma once
#include "dht/i_partitioner.hh"
#include <seastar/core/shared_ptr.hh>
#include "dht/i_partitioner_fwd.hh"
namespace compaction {
@@ -17,10 +19,6 @@ class table_state;
class strategy_control;
struct compaction_state;
using owned_ranges_ptr = lw_shared_ptr<const dht::token_range_vector>;
inline owned_ranges_ptr make_owned_ranges_ptr(dht::token_range_vector&& ranges) {
return make_lw_shared<const dht::token_range_vector>(std::move(ranges));
}
using owned_ranges_ptr = seastar::lw_shared_ptr<const dht::token_range_vector>;
} // namespace compaction

View File

@@ -63,6 +63,11 @@ class offstrategy_compaction_task_executor;
class rewrite_sstables_compaction_task_executor;
class cleanup_sstables_compaction_task_executor;
class validate_sstables_compaction_task_executor;
inline owned_ranges_ptr make_owned_ranges_ptr(dht::token_range_vector&& ranges) {
return make_lw_shared<const dht::token_range_vector>(std::move(ranges));
}
}
// Compaction manager provides facilities to submit and track compaction jobs on
// behalf of existing tables.

View File

@@ -32,6 +32,7 @@
#include "types/list.hh"
#include "types/map.hh"
#include "types/set.hh"
#include "dht/i_partitioner.hh"
namespace {
struct maybe_column_definition {

View File

@@ -9,7 +9,6 @@
#include "replica/database.hh"
#include "db/system_keyspace.hh"
#include "db/timeout_clock.hh"
#include "dht/i_partitioner.hh"
#include "readers/flat_mutation_reader_v2.hh"
#include "mutation/mutation_fragment.hh"
#include "query-request.hh"

View File

@@ -27,7 +27,7 @@
#include "db/timeout_clock.hh"
#include "schema/schema_fwd.hh"
#include "dht/i_partitioner.hh"
#include "dht/i_partitioner_fwd.hh"
#include "query-request.hh"
#include "utils/estimated_histogram.hh"
#include "utils/latency.hh"

View File

@@ -8,7 +8,6 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "gc_clock.hh"
#include "query-request.hh"
#include "schema/schema_fwd.hh"

View File

@@ -8,7 +8,6 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "query-request.hh"
#include "service/migration_listener.hh"
#include "utils/serialized_action.hh"

View File

@@ -8,7 +8,6 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "schema/schema_fwd.hh"
#include "mutation/mutation_fragment.hh"
#include "sstables/shared_sstable.hh"

View File

@@ -13,6 +13,7 @@
#include "readers/reversing_v2.hh"
#include "readers/forwardable_v2.hh"
#include "readers/slicing_filtering.hh"
#include "dht/i_partitioner.hh"
namespace db {

View File

@@ -23,6 +23,7 @@ namespace dht {
class decorated_key;
class ring_position;
class token;
class sharder;
using partition_range = nonwrapping_range<ring_position>;
using token_range = nonwrapping_range<token>;

View File

@@ -11,6 +11,7 @@
#include "gms/endpoint_state.hh"
#include <optional>
#include <ostream>
#include <boost/lexical_cast.hpp>
namespace gms {

View File

@@ -8,6 +8,8 @@
#pragma once
#include <fmt/ostream.h>
#include <seastar/net/ipv4_address.hh>
#include <seastar/net/inet_address.hh>
#include <seastar/net/socket_defs.hh>

View File

@@ -15,7 +15,8 @@
#include "locator/host_id.hh"
#include "version_generator.hh"
#include "gms/inet_address.hh"
#include "dht/i_partitioner.hh"
#include "dht/token.hh"
#include "schema/schema_fwd.hh"
#include "utils/to_string.hh"
#include "version.hh"
#include "cdc/generation_id.hh"

View File

@@ -6,7 +6,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include "dht/i_partitioner.hh"
#include "dht/i_partitioner_fwd.hh"
#include "idl/read_command.idl.hh"
#include "idl/consistency_level.idl.hh"

View File

@@ -6,7 +6,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include "dht/i_partitioner.hh"
#include "dht/i_partitioner_fwd.hh"
#include "service/pager/paging_state.hh"
#include "idl/range.idl.hh"

View File

@@ -6,14 +6,15 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include "dht/i_partitioner.hh"
#include "dht/decorated_key.hh"
#include "gms/inet_address_serializer.hh"
#include "node_ops/id.hh"
#include "idl/keys.idl.hh"
#include "idl/position_in_partition.idl.hh"
#include "idl/uuid.idl.hh"
#include "idl/frozen_mutation.idl.hh"
#include "idl/token.idl.hh"
#include "node_ops/id.hh"
class repair_hash {
uint64_t hash;

View File

@@ -17,7 +17,7 @@
#include "gms/feature_service.hh"
#include "locator/snitch_base.hh"
#include "locator/token_range_splitter.hh"
#include "dht/i_partitioner.hh"
#include "dht/token-sharding.hh"
#include "token_metadata.hh"
#include "snitch_base.hh"
#include <seastar/util/bool_class.hh>

View File

@@ -11,7 +11,6 @@
#include "locator/tablet_metadata_guard.hh"
#include "locator/tablet_sharder.hh"
#include "locator/token_range_splitter.hh"
#include "dht/i_partitioner.hh"
#include "types/types.hh"
#include "types/tuple.hh"
#include "types/set.hh"

View File

@@ -14,7 +14,7 @@
#include <unordered_set>
#include <unordered_map>
#include "gms/inet_address.hh"
#include "dht/i_partitioner.hh"
#include "dht/ring_position.hh"
#include "inet_address_vectors.hh"
#include <optional>
#include <memory>

View File

@@ -8,7 +8,7 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "dht/ring_position.hh"
#include "dht/token.hh"
#include "locator/token_metadata_fwd.hh"

View File

@@ -12,7 +12,7 @@
#include "schema/schema_fwd.hh"
#include "cache_temperature.hh"
#include "db/timeout_clock.hh"
#include "dht/i_partitioner.hh"
#include "dht/i_partitioner_fwd.hh"
#include <seastar/core/distributed.hh>

View File

@@ -6,8 +6,8 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include "dht/i_partitioner.hh"
#include "schema/schema_fwd.hh"
#include "dht/token.hh"
#include "schema/schema.hh"
#include "utils/rjson.hh"
/*

View File

@@ -11,6 +11,7 @@
#include "mutation_rebuilder.hh"
#include "mutation/json.hh"
#include "types/tuple.hh"
#include "dht/i_partitioner.hh"
mutation::data::data(dht::decorated_key&& key, schema_ptr&& schema)
: _schema(std::move(schema))

View File

@@ -13,7 +13,6 @@
#include "mutation_partition.hh"
#include "keys.hh"
#include "schema/schema_fwd.hh"
#include "dht/i_partitioner.hh"
#include "utils/hashing.hh"
#include "mutation_fragment_v2.hh"
#include "mutation_consumer.hh"

View File

@@ -10,7 +10,7 @@
#include "schema/schema_fwd.hh"
#include "readers/flat_mutation_reader_v2.hh"
#include "dht/i_partitioner.hh"
#include "dht/i_partitioner_fwd.hh"
#include "utils/phased_barrier.hh"
namespace mutation_writer {

View File

@@ -12,6 +12,7 @@
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/min_element.hpp>
#include <seastar/core/shared_mutex.hh>
#include "dht/i_partitioner.hh"
namespace mutation_writer {

View File

@@ -9,7 +9,7 @@
#include <seastar/core/coroutine.hh>
#include "querier.hh"
#include "dht/i_partitioner.hh"
#include "reader_concurrency_semaphore.hh"
#include "schema/schema.hh"
#include "log.hh"

View File

@@ -16,7 +16,7 @@
#include "db/functions/function.hh"
#include "db/functions/aggregate_function.hh"
#include "keys.hh"
#include "dht/i_partitioner.hh"
#include "dht/ring_position.hh"
#include "enum_set.hh"
#include "range.hh"
#include "tracing/tracing.hh"

View File

@@ -7,6 +7,7 @@
*/
#include "query_ranges_to_vnodes.hh"
#include "dht/i_partitioner.hh"
static inline
const dht::token& start_token(const dht::partition_range& r) {

View File

@@ -8,7 +8,7 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "dht/i_partitioner_fwd.hh"
#include "locator/token_metadata.hh"
#include "locator/token_range_splitter.hh"
#include "schema/schema.hh"

View File

@@ -8,7 +8,8 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "schema/schema_fwd.hh"
#include "dht/ring_position.hh"
#include "readers/flat_mutation_reader_fwd.hh"
class reader_permit;

View File

@@ -8,7 +8,7 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "dht/i_partitioner_fwd.hh"
#include "readers/flat_mutation_reader_fwd.hh"
#include "schema/schema_fwd.hh"
#include "seastarx.hh"
@@ -20,6 +20,10 @@ namespace tracing {
class trace_state_ptr;
}
namespace query {
class partition_slice;
}
/// Make an auto-paused evictable reader.
///
/// The reader is paused after each use, that is after each call to any of its

View File

@@ -12,11 +12,11 @@
#include <seastar/core/future.hh>
#include <seastar/core/circular_buffer.hh>
#include "dht/i_partitioner.hh"
#include "mutation/mutation_fragment_v2.hh"
#include "mutation/mutation.hh"
#include "mutation/mutation_consumer_concepts.hh"
#include "reader_permit.hh"
#include "utils/maybe_yield.hh"
using seastar::future;

View File

@@ -8,7 +8,6 @@
#include "clustering_key_filter.hh"
#include "clustering_ranges_walker.hh"
#include "dht/i_partitioner.hh"
#include "mutation/mutation.hh"
#include "mutation/mutation_partition.hh"
#include "mutation/mutation_compactor.hh"

View File

@@ -8,7 +8,6 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "query-request.hh"
#include "tracing/trace_state.hh"
#include "readers/flat_mutation_reader_fwd.hh"

View File

@@ -27,7 +27,6 @@
#include "view_info.hh"
#include "partition_slice_builder.hh"
#include "replica/database.hh"
#include "dht/i_partitioner.hh"
#include "dht/token-sharding.hh"
#include "cdc/cdc_extension.hh"
#include "tombstone_gc_extension.hh"

View File

@@ -11,7 +11,6 @@
#include "schema.hh"
#include "replica/database_fwd.hh"
#include "cdc/log.hh"
#include "dht/i_partitioner.hh"
#include "tombstone_gc_options.hh"
namespace db {

View File

@@ -15,7 +15,6 @@
#include "bytes.hh"
#include "keys.hh"
#include "query-request.hh"
#include "dht/i_partitioner.hh"
#include "db/read_repair_decision.hh"
#include "mutation/position_in_partition.hh"
#include "locator/host_id.hh"

View File

@@ -8,6 +8,7 @@
*/
#include "topology_state_machine.hh"
#include "log.hh"
#include <boost/range/adaptors.hpp>

View File

@@ -21,7 +21,6 @@
#include "dht/token.hh"
#include "raft/raft.hh"
#include "utils/UUID.hh"
#include "dht/i_partitioner.hh"
#include "mutation/canonical_mutation.hh"
namespace service {

View File

@@ -20,6 +20,7 @@
#include "utils/managed_ref.hh"
#include "utils/managed_bytes.hh"
#include "utils/managed_vector.hh"
#include "dht/i_partitioner.hh"
#include <seastar/core/fstream.hh>

View File

@@ -13,7 +13,7 @@
#include "replica/database_fwd.hh"
#include "keys.hh"
#include "compound_compat.hh"
#include "dht/i_partitioner.hh"
#include "dht/token.hh"
namespace sstables {

View File

@@ -12,14 +12,12 @@
#include "keys.hh"
#include <seastar/core/do_with.hh>
#include "unimplemented.hh"
#include "dht/i_partitioner.hh"
#include <seastar/core/byteorder.hh>
#include "index_reader.hh"
#include "counters.hh"
#include "utils/data_input.hh"
#include "clustering_ranges_walker.hh"
#include "binary_search.hh"
#include "../dht/i_partitioner.hh"
#include "sstables/mx/partition_reversing_data_source.hh"
namespace sstables {

View File

@@ -13,7 +13,7 @@
#include "sstables/progress_monitor.hh"
#include "sstables/types_fwd.hh"
#include "shared_sstable.hh"
#include "dht/i_partitioner.hh"
#include "dht/ring_position.hh"
#include <seastar/core/shared_ptr.hh>
#include <type_traits>
#include <vector>

View File

@@ -18,6 +18,7 @@
#include "version.hh"
#include "counters.hh"
#include "utils/bit_cast.hh"
#include "dht/i_partitioner_fwd.hh"
namespace db {

View File

@@ -14,7 +14,6 @@
#include "schema/schema_fwd.hh"
#include <vector>
#include "range.hh"
#include "dht/i_partitioner.hh"
namespace streaming {

View File

@@ -44,6 +44,10 @@ namespace gms {
class gossiper;
}
namespace replica {
class database;
}
namespace streaming {
struct stream_bytes {

View File

@@ -14,7 +14,6 @@
#include <seastar/core/sstring.hh>
#include "gms/inet_address.hh"
#include "query-request.hh"
#include "dht/i_partitioner.hh"
#include "streaming/stream_fwd.hh"
#include "streaming/stream_coordinator.hh"
#include "streaming/stream_detail.hh"

View File

@@ -12,7 +12,6 @@
#include <seastar/core/sstring.hh>
#include "range.hh"
#include "dht/i_partitioner.hh"
#include "partition_range_compat.hh"
#include <vector>

View File

@@ -23,7 +23,6 @@
#include "streaming/stream_reason.hh"
#include "streaming/session_info.hh"
#include "query-request.hh"
#include "dht/i_partitioner.hh"
#include <map>
#include <vector>
#include <memory>

View File

@@ -10,6 +10,7 @@
#include "test/lib/random_schema.hh"
#include "test/lib/random_utils.hh"
#include "test/lib/test_utils.hh"
#include "dht/i_partitioner.hh"
namespace tests {

View File

@@ -8,7 +8,10 @@
#pragma once
#include "dht/i_partitioner.hh"
#include <seastar/core/smp.hh>
#include "dht/decorated_key.hh"
#include "seastarx.hh"
struct local_shard_only_tag { };
using local_shard_only = bool_class<local_shard_only_tag>;

View File

@@ -15,6 +15,7 @@
#include "log.hh"
#include "clustering_interval_set.hh"
#include "mutation/mutation_partition_v2.hh"
#include "dht/i_partitioner.hh"
extern logging::logger testlog;

View File

@@ -9,7 +9,6 @@
#pragma once
#include "schema/schema.hh"
#include "dht/i_partitioner.hh"
#include "test/lib/data_model.hh"
///

View File

@@ -17,7 +17,6 @@
#include "sstables/writer.hh"
#include "compaction/compaction_manager.hh"
#include "replica/memtable-sstable.hh"
#include "dht/i_partitioner.hh"
#include "test/lib/test_services.hh"
#include "test/lib/sstable_test_env.hh"
#include "test/lib/reader_concurrency_semaphore.hh"

View File

@@ -12,6 +12,7 @@
#include "db/view/row_locking.hh"
#include "schema/schema_builder.hh"
#include "dht/i_partitioner.hh"
static row_locker::stats row_locker_stats;

View File

@@ -21,6 +21,7 @@
#include "readers/combined.hh"
#include "readers/mutation_fragment_v1_stream.hh"
#include "replica/memtable.hh"
#include "dht/i_partitioner.hh"
#include "test/perf/perf.hh"
#include "test/lib/reader_concurrency_semaphore.hh"

View File

@@ -19,6 +19,7 @@
#include "schema/schema_builder.hh"
#include "replica/memtable.hh"
#include "test/lib/reader_concurrency_semaphore.hh"
#include "dht/i_partitioner.hh"
static
partition_key new_key(schema_ptr s) {

View File

@@ -22,6 +22,7 @@
#include "tools/lua_sstable_consumer.hh"
#include "types/collection.hh"
#include "types/tuple.hh"
#include "dht/i_partitioner.hh"
namespace {

View File

@@ -15,6 +15,7 @@
#include "log.hh"
#include "schema/schema_builder.hh"
#include "tools/utils.hh"
#include "dht/i_partitioner.hh"
using namespace seastar;
using namespace tools::utils;

View File

@@ -8,7 +8,6 @@
#pragma once
#include "dht/i_partitioner.hh"
#include "query-request.hh"
#include "schema/schema_fwd.hh"
#include "db/view/view.hh"