diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-20 04:42:36 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-20 04:42:36 +0000 |
commit | 136c6f5f0d52b2a2506b0e3be425be4bdb5b0437 (patch) | |
tree | 7ee32c13bdba28058fe6e54f1e4b0f69713d5f2b /storage | |
parent | c5a350c07cfae7e83c0fa32b3f1f7f96d2b2b53c (diff) |
typo index -> indexing + some minor c++11ification.
Diffstat (limited to 'storage')
3 files changed, 15 insertions, 16 deletions
diff --git a/storage/src/tests/distributor/statecheckerstest.cpp b/storage/src/tests/distributor/statecheckerstest.cpp index 6fe327b60c0..0fc148eb549 100644 --- a/storage/src/tests/distributor/statecheckerstest.cpp +++ b/storage/src/tests/distributor/statecheckerstest.cpp @@ -88,11 +88,11 @@ struct StateCheckersTest : Test, DistributorStripeTestUtil { c.siblingEntry = getBucketDatabase(c.getBucketSpace()).get(c.siblingBucket); c.entries = entries; - for (uint32_t j = 0; j < entries.size(); ++j) { + for (const auto & entry : entries) { // Run checking only on this bucketid, but include all buckets // owned by it or owners of it, so we can detect inconsistent split. - if (entries[j].getBucketId() == c.getBucketId()) { - c.entry = entries[j]; + if (entry.getBucketId() == c.getBucketId()) { + c.entry = entry; StateChecker::Result result(checker.check(c)); IdealStateOperation::UP op(result.createOperation()); @@ -1098,12 +1098,12 @@ void StateCheckersTest::do_test_bucket_activation() { } TEST_F(StateCheckersTest, bucket_activation_behaves_as_expected_with_implicit_indexing_on_active) { - set_node_supports_no_implicit_index_on_activation(2, false); + set_node_supports_no_implicit_indexing_on_activation(2, false); do_test_bucket_activation(); } TEST_F(StateCheckersTest, bucket_activation_behaves_as_expected_without_implicit_indexing_on_active) { - set_node_supports_no_implicit_index_on_activation(2, true); + set_node_supports_no_implicit_indexing_on_activation(2, true); do_test_bucket_activation(); } @@ -1115,7 +1115,7 @@ TEST_F(StateCheckersTest, bucket_activation_behaves_as_expected_without_implicit */ TEST_F(StateCheckersTest, do_not_activate_non_ready_copies_when_ideal_node_in_maintenance_if_active_implicitly_indexes) { setup_stripe(2, 100, "distributor:1 storage:4 .1.s:m"); - set_node_supports_no_implicit_index_on_activation(2, false); + set_node_supports_no_implicit_indexing_on_activation(2, false); // Ideal node 1 is in maintenance and no ready copy available. EXPECT_EQ("NO OPERATIONS GENERATED", testBucketState("2=8/9/10/t/i/u,3=5/6/7")); @@ -1126,7 +1126,7 @@ TEST_F(StateCheckersTest, do_not_activate_non_ready_copies_when_ideal_node_in_ma TEST_F(StateCheckersTest, activate_non_ready_copies_when_ideal_node_in_maintenance_if_active_does_not_implicitly_index) { setup_stripe(2, 100, "distributor:1 storage:4 .1.s:m"); - set_node_supports_no_implicit_index_on_activation(2, true); + set_node_supports_no_implicit_indexing_on_activation(2, true); // Ideal node 1 is in maintenance and no ready copy available. EXPECT_EQ("[Setting node 2 as active: copy has 9 docs]", // TODO ideal state pri instead testBucketState("2=8/9/10/t/i/u,3=5/6/7")); diff --git a/storage/src/vespa/storage/distributor/distributor_stripe.cpp b/storage/src/vespa/storage/distributor/distributor_stripe.cpp index 1173a19d729..a811e043678 100644 --- a/storage/src/vespa/storage/distributor/distributor_stripe.cpp +++ b/storage/src/vespa/storage/distributor/distributor_stripe.cpp @@ -14,7 +14,6 @@ #include "throttlingoperationstarter.h" #include <vespa/document/bucket/fixed_bucket_spaces.h> #include <vespa/storage/common/global_bucket_space_distribution_converter.h> -#include <vespa/storage/common/hostreporter/hostinfo.h> #include <vespa/storage/common/node_identity.h> #include <vespa/storage/common/nodestateupdater.h> #include <vespa/storage/distributor/maintenance/simplebucketprioritydatabase.h> @@ -84,7 +83,7 @@ DistributorStripe::DistributorStripe(DistributorComponentRegister& compReg, { propagateDefaultDistribution(_component.getDistribution()); propagateClusterStates(); -}; +} DistributorStripe::~DistributorStripe() = default; @@ -109,7 +108,7 @@ void DistributorStripe::sendCommand(const std::shared_ptr<api::StorageCommand>& cmd) { if (cmd->getType() == api::MessageType::MERGEBUCKET) { - api::MergeBucketCommand& merge(static_cast<api::MergeBucketCommand&>(*cmd)); + auto & merge(static_cast<api::MergeBucketCommand&>(*cmd)); _idealStateManager.getMetrics().nodesPerMerge.addValue(merge.getNodes().size()); } send_up_with_tracking(cmd); @@ -182,7 +181,7 @@ DistributorStripe::handleCompletedMerge( } bool -DistributorStripe::isMaintenanceReply(const api::StorageReply& reply) const +DistributorStripe::isMaintenanceReply(const api::StorageReply& reply) { switch (reply.getType().getId()) { case api::MessageType::CREATEBUCKET_REPLY_ID: @@ -290,8 +289,8 @@ DistributorStripe::enableClusterStateBundle(const lib::ClusterStateBundle& state std::vector<uint64_t> msgIds = _pendingMessageTracker.clearMessagesForNode(i); LOG(debug, "Node %u is down, clearing %zu pending maintenance operations", i, msgIds.size()); - for (uint32_t j = 0; j < msgIds.size(); ++j) { - _maintenanceOperationOwner.erase(msgIds[j]); + for (const auto & msgId : msgIds) { + _maintenanceOperationOwner.erase(msgId); } } } @@ -407,7 +406,7 @@ public: bool found; uint8_t maxPri; - SplitChecker(uint8_t maxP) : found(false), maxPri(maxP) {}; + explicit SplitChecker(uint8_t maxP) : found(false), maxPri(maxP) {}; bool check(uint32_t msgType, uint16_t node, uint8_t pri) override { (void) node; @@ -603,7 +602,7 @@ namespace { BucketSpaceStats toBucketSpaceStats(const NodeMaintenanceStats &stats) { - return BucketSpaceStats(stats.total, stats.syncing + stats.copyingIn); + return {stats.total, stats.syncing + stats.copyingIn}; } using PerNodeBucketSpacesStats = BucketSpacesStatsProvider::PerNodeBucketSpacesStats; diff --git a/storage/src/vespa/storage/distributor/distributor_stripe.h b/storage/src/vespa/storage/distributor/distributor_stripe.h index d1366bc0285..ccd7ab9c21d 100644 --- a/storage/src/vespa/storage/distributor/distributor_stripe.h +++ b/storage/src/vespa/storage/distributor/distributor_stripe.h @@ -208,7 +208,7 @@ private: friend class TopLevelDistributorTestUtil; bool handleMessage(const std::shared_ptr<api::StorageMessage>& msg); - bool isMaintenanceReply(const api::StorageReply& reply) const; + static bool isMaintenanceReply(const api::StorageReply& reply); void send_shutdown_abort_reply(const std::shared_ptr<api::StorageMessage>&); void handle_or_propagate_message(const std::shared_ptr<api::StorageMessage>& msg); |