diff options
5 files changed, 0 insertions, 170 deletions
diff --git a/storage/src/vespa/storage/distributor/CMakeLists.txt b/storage/src/vespa/storage/distributor/CMakeLists.txt index c5c67d3203b..82f5d462dd1 100644 --- a/storage/src/vespa/storage/distributor/CMakeLists.txt +++ b/storage/src/vespa/storage/distributor/CMakeLists.txt @@ -27,7 +27,6 @@ vespa_add_library(storage_distributor ideal_service_layer_nodes_bundle.cpp idealstatemanager.cpp idealstatemetricsset.cpp - legacy_single_stripe_accessor.cpp messagetracker.cpp multi_threaded_stripe_access_guard.cpp nodeinfo.cpp diff --git a/storage/src/vespa/storage/distributor/distributor_stripe.h b/storage/src/vespa/storage/distributor/distributor_stripe.h index 7b0cfc66a1b..e14369ba7eb 100644 --- a/storage/src/vespa/storage/distributor/distributor_stripe.h +++ b/storage/src/vespa/storage/distributor/distributor_stripe.h @@ -194,7 +194,6 @@ private: friend class DistributorTestUtil; friend class MetricUpdateHook; friend class Distributor; - friend class LegacySingleStripeAccessGuard; friend class MultiThreadedStripeAccessGuard; bool handleMessage(const std::shared_ptr<api::StorageMessage>& msg); diff --git a/storage/src/vespa/storage/distributor/legacy_single_stripe_accessor.cpp b/storage/src/vespa/storage/distributor/legacy_single_stripe_accessor.cpp deleted file mode 100644 index 29b71436fe8..00000000000 --- a/storage/src/vespa/storage/distributor/legacy_single_stripe_accessor.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "legacy_single_stripe_accessor.h" -#include "distributor_stripe.h" - -namespace storage::distributor { - -LegacySingleStripeAccessGuard::LegacySingleStripeAccessGuard(LegacySingleStripeAccessor& accessor, - DistributorStripe& stripe) - : _accessor(accessor), - _stripe(stripe) -{} - -LegacySingleStripeAccessGuard::~LegacySingleStripeAccessGuard() { - _accessor.mark_guard_released(); -} - -void LegacySingleStripeAccessGuard::flush_and_close() { - _stripe.flush_and_close(); -} - -void LegacySingleStripeAccessGuard::update_total_distributor_config(std::shared_ptr<const DistributorConfiguration> config) { - _stripe.update_total_distributor_config(std::move(config)); -} - -void LegacySingleStripeAccessGuard::update_distribution_config(const BucketSpaceDistributionConfigs& new_configs) { - _stripe.update_distribution_config(new_configs); -} - -void LegacySingleStripeAccessGuard::set_pending_cluster_state_bundle(const lib::ClusterStateBundle& pending_state) { - _stripe.getBucketSpaceRepo().set_pending_cluster_state_bundle(pending_state); - // TODO STRIPE also read only repo? -} - -void LegacySingleStripeAccessGuard::clear_pending_cluster_state_bundle() { - _stripe.getBucketSpaceRepo().clear_pending_cluster_state_bundle(); - // TODO STRIPE also read only repo? -} - -void LegacySingleStripeAccessGuard::enable_cluster_state_bundle(const lib::ClusterStateBundle& new_state) { - _stripe.enableClusterStateBundle(new_state); -} - -void LegacySingleStripeAccessGuard::notify_distribution_change_enabled() { - _stripe.notifyDistributionChangeEnabled(); -} - -PotentialDataLossReport -LegacySingleStripeAccessGuard::remove_superfluous_buckets(document::BucketSpace bucket_space, - const lib::ClusterState& new_state, - bool is_distribution_change) -{ - return _stripe.bucket_db_updater().remove_superfluous_buckets(bucket_space, new_state, is_distribution_change); -} - -void -LegacySingleStripeAccessGuard::merge_entries_into_db(document::BucketSpace bucket_space, - api::Timestamp gathered_at_timestamp, - const lib::Distribution& distribution, - const lib::ClusterState& new_state, - const char* storage_up_states, - const std::unordered_set<uint16_t>& outdated_nodes, - const std::vector<dbtransition::Entry>& entries) -{ - _stripe.bucket_db_updater().merge_entries_into_db(bucket_space, gathered_at_timestamp, distribution, - new_state, storage_up_states, outdated_nodes, entries); -} - -void LegacySingleStripeAccessGuard::update_read_snapshot_before_db_pruning() { - _stripe.bucket_db_updater().update_read_snapshot_before_db_pruning(); -} - -void LegacySingleStripeAccessGuard::update_read_snapshot_after_db_pruning(const lib::ClusterStateBundle& new_state) { - _stripe.bucket_db_updater().update_read_snapshot_after_db_pruning(new_state); -} - -void LegacySingleStripeAccessGuard::update_read_snapshot_after_activation(const lib::ClusterStateBundle& activated_state) { - _stripe.bucket_db_updater().update_read_snapshot_after_activation(activated_state); -} - -void LegacySingleStripeAccessGuard::clear_read_only_bucket_repo_databases() { - _stripe.bucket_db_updater().clearReadOnlyBucketRepoDatabases(); -} - -std::unique_ptr<StripeAccessGuard> LegacySingleStripeAccessor::rendezvous_and_hold_all() { - // For sanity checking during development. - assert(!_guard_held); - _guard_held = true; - return std::make_unique<LegacySingleStripeAccessGuard>(*this, _stripe); -} - -void LegacySingleStripeAccessor::mark_guard_released() { - assert(_guard_held); - _guard_held = false; -} - -} diff --git a/storage/src/vespa/storage/distributor/legacy_single_stripe_accessor.h b/storage/src/vespa/storage/distributor/legacy_single_stripe_accessor.h deleted file mode 100644 index f119462038e..00000000000 --- a/storage/src/vespa/storage/distributor/legacy_single_stripe_accessor.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -#include "stripe_access_guard.h" - -namespace storage::distributor { - -class DistributorStripe; -class LegacySingleStripeAccessor; - -/** - * Very simple stripe access guard which expects the caller and its single stripe to run in the - * same thread. This means there's no actual striping of operations or any thread synchronization - * performed. Only intended as a stop-gap while we have legacy stripe behavior. - */ -class LegacySingleStripeAccessGuard : public StripeAccessGuard { - LegacySingleStripeAccessor& _accessor; - DistributorStripe& _stripe; -public: - LegacySingleStripeAccessGuard(LegacySingleStripeAccessor& accessor, - DistributorStripe& stripe); - ~LegacySingleStripeAccessGuard() override; - - void flush_and_close() override; - - void update_total_distributor_config(std::shared_ptr<const DistributorConfiguration> config) override; - - void update_distribution_config(const BucketSpaceDistributionConfigs& new_configs) override; - void set_pending_cluster_state_bundle(const lib::ClusterStateBundle& pending_state) override; - void clear_pending_cluster_state_bundle() override; - void enable_cluster_state_bundle(const lib::ClusterStateBundle& new_state) override; - void notify_distribution_change_enabled() override; - - PotentialDataLossReport remove_superfluous_buckets(document::BucketSpace bucket_space, - const lib::ClusterState& new_state, - bool is_distribution_change) override; - void merge_entries_into_db(document::BucketSpace bucket_space, - api::Timestamp gathered_at_timestamp, - const lib::Distribution& distribution, - const lib::ClusterState& new_state, - const char* storage_up_states, - const std::unordered_set<uint16_t>& outdated_nodes, - const std::vector<dbtransition::Entry>& entries) override; - - void update_read_snapshot_before_db_pruning() override; - void update_read_snapshot_after_db_pruning(const lib::ClusterStateBundle& new_state) override; - void update_read_snapshot_after_activation(const lib::ClusterStateBundle& activated_state) override; - void clear_read_only_bucket_repo_databases() override; -}; - -/** - * Impl of StripeAccessor which creates LegacySingleStripeAccessGuards bound to a single stripe. - */ -class LegacySingleStripeAccessor : public StripeAccessor { - DistributorStripe& _stripe; - bool _guard_held; - - friend class LegacySingleStripeAccessGuard; -public: - explicit LegacySingleStripeAccessor(DistributorStripe& stripe) - : _stripe(stripe), - _guard_held(false) - {} - ~LegacySingleStripeAccessor() override = default; - - std::unique_ptr<StripeAccessGuard> rendezvous_and_hold_all() override; -private: - void mark_guard_released(); -}; - -} diff --git a/storage/src/vespa/storage/distributor/stripe_bucket_db_updater.h b/storage/src/vespa/storage/distributor/stripe_bucket_db_updater.h index 42fe0d5c29a..dddb4d2bc9a 100644 --- a/storage/src/vespa/storage/distributor/stripe_bucket_db_updater.h +++ b/storage/src/vespa/storage/distributor/stripe_bucket_db_updater.h @@ -140,7 +140,6 @@ private: friend class DistributorTestUtil; // TODO refactor and rewire to avoid needing this direct meddling - friend class LegacySingleStripeAccessGuard; friend class MultiThreadedStripeAccessGuard; // Only to be used by tests that want to ensure both the BucketDBUpdater _and_ the Distributor |