From f6264a976a943cde377b0aa86e3c13f8990ed55e Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 29 Dec 2017 00:57:43 +0100 Subject: Do not include the world. --- metrics/src/vespa/metrics/metrictimer.h | 2 +- .../persistence/spi/metricpersistenceprovider.cpp | 2 + .../persistence/spi/metricpersistenceprovider.h | 10 ++--- .../proton/persistenceengine/persistenceengine.cpp | 5 ++- .../src/tests/distributor/bucketdbupdatertest.cpp | 7 ++-- .../distributor/externaloperationhandlertest.cpp | 10 ++--- storage/src/tests/distributor/getoperationtest.cpp | 11 ++--- storage/src/tests/distributor/messagesenderstub.h | 1 + .../src/tests/distributor/visitoroperationtest.cpp | 7 ++-- storage/src/vespa/storage/common/messagesender.h | 5 ++- .../vespa/storage/distributor/bucketdbupdater.cpp | 2 +- .../vespa/storage/distributor/bucketdbupdater.h | 3 +- .../storage/distributor/bucketgctimecalculator.h | 7 +--- .../vespa/storage/distributor/bucketownership.h | 11 ++--- .../src/vespa/storage/distributor/distributor.cpp | 49 +++++++--------------- .../storage/distributor/distributorinterface.h | 32 +++++--------- .../storage/distributor/distributormessagesender.h | 21 +++------- .../vespa/storage/distributor/idealstatemanager.h | 30 +++++-------- .../vespa/storage/distributor/messagetracker.cpp | 11 ++--- .../src/vespa/storage/distributor/messagetracker.h | 10 +++-- .../distributor/operations/external/putoperation.h | 12 +++--- .../operations/external/statbucketoperation.h | 18 ++++---- .../external/twophaseupdateoperation.cpp | 13 +++--- .../operations/external/visitoroperation.h | 9 ++-- .../operations/idealstate/idealstateoperation.cpp | 20 ++++----- .../operations/idealstate/mergeoperation.cpp | 2 +- .../idealstate/setbucketstateoperation.cpp | 1 + .../storage/distributor/operationtargetresolver.h | 6 +-- storageapi/src/vespa/storageapi/message/state.h | 6 +-- 29 files changed, 122 insertions(+), 201 deletions(-) diff --git a/metrics/src/vespa/metrics/metrictimer.h b/metrics/src/vespa/metrics/metrictimer.h index 096ba3e27af..0282c0f17ad 100644 --- a/metrics/src/vespa/metrics/metrictimer.h +++ b/metrics/src/vespa/metrics/metrictimer.h @@ -8,7 +8,7 @@ #pragma once -#include +#include "valuemetric.h" #include namespace metrics { diff --git a/persistence/src/vespa/persistence/spi/metricpersistenceprovider.cpp b/persistence/src/vespa/persistence/spi/metricpersistenceprovider.cpp index 76b0a3c4686..58e662a2b1d 100644 --- a/persistence/src/vespa/persistence/spi/metricpersistenceprovider.cpp +++ b/persistence/src/vespa/persistence/spi/metricpersistenceprovider.cpp @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "metricpersistenceprovider.h" +#include +#include #include #include diff --git a/persistence/src/vespa/persistence/spi/metricpersistenceprovider.h b/persistence/src/vespa/persistence/spi/metricpersistenceprovider.h index e169ad098c7..b804fd21550 100644 --- a/persistence/src/vespa/persistence/spi/metricpersistenceprovider.h +++ b/persistence/src/vespa/persistence/spi/metricpersistenceprovider.h @@ -6,10 +6,10 @@ #pragma once #include "persistenceprovider.h" -#include +#include +#include -namespace storage { -namespace spi { +namespace storage::spi { class MetricPersistenceProvider : public PersistenceProvider, public metrics::MetricSet @@ -61,5 +61,5 @@ private: void defineResultMetrics(int index, const char* name); }; -} // spi -} // storage +} + diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp b/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp index c7b01d209ee..390f8241b1d 100644 --- a/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp +++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.cpp @@ -4,7 +4,6 @@ #include "ipersistenceengineowner.h" #include "transport_latch.h" #include -#include #include LOG_SETUP(".proton.persistenceengine.persistenceengine"); @@ -23,6 +22,8 @@ using vespalib::IllegalStateException; using vespalib::Sequence; using vespalib::make_string; +using namespace std::chrono_literals; + namespace proton { namespace { @@ -623,7 +624,7 @@ PersistenceEngine::destroyIterators() Result res(destroyIterator(id, context)); if (res.hasError()) { LOG(debug, "%ld iterator left. Can not destroy iterator '%ld'. Reason='%s'", _iterators.size(), id.getValue(), res.toString().c_str()); - FastOS_Thread::Sleep(100); // Sleep 0.1 seconds + std::this_thread::sleep_for(100ms); } } } diff --git a/storage/src/tests/distributor/bucketdbupdatertest.cpp b/storage/src/tests/distributor/bucketdbupdatertest.cpp index b9e33ea8d26..ff442114c4c 100644 --- a/storage/src/tests/distributor/bucketdbupdatertest.cpp +++ b/storage/src/tests/distributor/bucketdbupdatertest.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -22,8 +23,7 @@ using namespace storage::lib; using document::test::makeDocumentBucket; using document::test::makeBucketSpace; -namespace storage { -namespace distributor { +namespace storage::distributor { class BucketDBUpdaterTest : public CppUnit::TestFixture, public DistributorTestUtil @@ -2499,5 +2499,4 @@ void BucketDBUpdaterTest::batch_update_from_distributor_change_does_not_mark_div "0:5/1/2/3|1:5/7/8/9", true)); } -} // distributor -} // storage +} diff --git a/storage/src/tests/distributor/externaloperationhandlertest.cpp b/storage/src/tests/distributor/externaloperationhandlertest.cpp index 683352e6b09..a0b8cd424ac 100644 --- a/storage/src/tests/distributor/externaloperationhandlertest.cpp +++ b/storage/src/tests/distributor/externaloperationhandlertest.cpp @@ -2,15 +2,14 @@ #include #include -#include -#include #include +#include +#include #include using document::test::makeDocumentBucket; -namespace storage { -namespace distributor { +namespace storage::distributor { class ExternalOperationHandlerTest : public CppUnit::TestFixture, public DistributorTestUtil @@ -471,5 +470,4 @@ void ExternalOperationHandlerTest::sequencing_can_be_explicitly_config_disabled( // pseudo-locks in the sequencer. I.e. if we get a RemoveLocation with id.user==123456, this // prevents any handles from being acquired to any GID under location BucketId(32, 123456). -} // distributor -} // storage +} diff --git a/storage/src/tests/distributor/getoperationtest.cpp b/storage/src/tests/distributor/getoperationtest.cpp index 8bb8e24c17a..80c093dea87 100644 --- a/storage/src/tests/distributor/getoperationtest.cpp +++ b/storage/src/tests/distributor/getoperationtest.cpp @@ -5,16 +5,13 @@ #include #include #include +#include #include #include -#include #include -#include #include #include #include -#include -#include #include using std::shared_ptr; @@ -23,8 +20,7 @@ using document::DocumenttypesConfig; using config::FileSpec; using document::test::makeDocumentBucket; -namespace storage { -namespace distributor { +namespace storage::distributor { class GetOperationTest : public CppUnit::TestFixture, public DistributorTestUtil { CPPUNIT_TEST_SUITE(GetOperationTest); @@ -568,5 +564,4 @@ GetOperationTest::canGetDocumentsWhenAllReplicaNodesRetired() _sender.getCommands(true)); } -} // distributor -} // storage +} diff --git a/storage/src/tests/distributor/messagesenderstub.h b/storage/src/tests/distributor/messagesenderstub.h index e5bae9c6702..b86863890a1 100644 --- a/storage/src/tests/distributor/messagesenderstub.h +++ b/storage/src/tests/distributor/messagesenderstub.h @@ -3,6 +3,7 @@ #include #include +#include namespace storage { diff --git a/storage/src/tests/distributor/visitoroperationtest.cpp b/storage/src/tests/distributor/visitoroperationtest.cpp index 972ccf41bfe..17d1bc288ca 100644 --- a/storage/src/tests/distributor/visitoroperationtest.cpp +++ b/storage/src/tests/distributor/visitoroperationtest.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -21,8 +22,7 @@ using namespace storage::lib; using namespace std::string_literals; using document::test::makeBucketSpace; -namespace storage { -namespace distributor { +namespace storage::distributor { class VisitorOperationTest : public CppUnit::TestFixture, public DistributorTestUtil { @@ -1674,5 +1674,4 @@ VisitorOperationTest::statistical_metrics_not_updated_on_wrong_distribution() CPPUNIT_ASSERT_EQUAL(0.0, defaultVisitorMetrics().latency.getCount()); } -} // distributor -} // storage +} diff --git a/storage/src/vespa/storage/common/messagesender.h b/storage/src/vespa/storage/common/messagesender.h index 8c45995c42f..659fccad412 100644 --- a/storage/src/vespa/storage/common/messagesender.h +++ b/storage/src/vespa/storage/common/messagesender.h @@ -18,13 +18,14 @@ #include -namespace storage { -namespace api { +namespace storage::api { class StorageCommand; class StorageReply; class StorageMessage; } +namespace storage { + struct MessageSender { virtual ~MessageSender() {} diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp index 46fa0f72d76..cc1181e0d58 100644 --- a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp +++ b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp @@ -2,9 +2,9 @@ #include "bucketdbupdater.h" #include "distributor.h" -#include "distributor_bucket_space_repo.h" #include "distributor_bucket_space.h" #include "simpleclusterinformation.h" +#include "distributormetricsset.h" #include #include #include diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.h b/storage/src/vespa/storage/distributor/bucketdbupdater.h index 29e8d3f6221..19e2e259778 100644 --- a/storage/src/vespa/storage/distributor/bucketdbupdater.h +++ b/storage/src/vespa/storage/distributor/bucketdbupdater.h @@ -13,9 +13,8 @@ #include #include #include +#include #include -#include -#include #include namespace storage::distributor { diff --git a/storage/src/vespa/storage/distributor/bucketgctimecalculator.h b/storage/src/vespa/storage/distributor/bucketgctimecalculator.h index e2b232a6cf5..4ff85e568c8 100644 --- a/storage/src/vespa/storage/distributor/bucketgctimecalculator.h +++ b/storage/src/vespa/storage/distributor/bucketgctimecalculator.h @@ -4,8 +4,7 @@ #include #include -namespace storage { -namespace distributor { +namespace storage::distributor { /** * Semantics are basically as follows: @@ -51,6 +50,4 @@ private: std::chrono::seconds _checkInterval; }; -} // distributor -} // storage - +} diff --git a/storage/src/vespa/storage/distributor/bucketownership.h b/storage/src/vespa/storage/distributor/bucketownership.h index c7a7773686f..bfe63c9799d 100644 --- a/storage/src/vespa/storage/distributor/bucketownership.h +++ b/storage/src/vespa/storage/distributor/bucketownership.h @@ -2,9 +2,9 @@ #pragma once #include +#include -namespace storage { -namespace distributor { +namespace storage::distributor { class BucketOwnership { @@ -14,8 +14,7 @@ class BucketOwnership BucketOwnership(const lib::ClusterState& checkedState) : _checkedState(&checkedState), _owned(false) - { - } + { } BucketOwnership() : _checkedState(nullptr), _owned(true) {} @@ -44,6 +43,4 @@ public: } }; -} // distributor -} // storage - +} diff --git a/storage/src/vespa/storage/distributor/distributor.cpp b/storage/src/vespa/storage/distributor/distributor.cpp index 1edcbe75dd6..988d39e571d 100644 --- a/storage/src/vespa/storage/distributor/distributor.cpp +++ b/storage/src/vespa/storage/distributor/distributor.cpp @@ -5,21 +5,17 @@ #include "throttlingoperationstarter.h" #include "idealstatemetricsset.h" #include "ownership_transfer_safe_time_point_calculator.h" -#include "distributor_bucket_space_repo.h" #include "distributor_bucket_space.h" -#include -#include +#include "distributormetricsset.h" #include #include #include #include - #include LOG_SETUP(".distributor-main"); -namespace storage { -namespace distributor { +namespace storage::distributor { class Distributor::Status { const DelegatedStatusRequest& _request; @@ -68,34 +64,25 @@ Distributor::Distributor(DistributorComponentRegister& compReg, _compReg(compReg), _component(compReg, "distributor"), _bucketSpaceRepo(std::make_unique()), - _metrics(new DistributorMetricSet( - _component.getLoadTypes()->getMetricLoadTypes())), + _metrics(new DistributorMetricSet(_component.getLoadTypes()->getMetricLoadTypes())), _operationOwner(*this, _component.getClock()), _maintenanceOperationOwner(*this, _component.getClock()), _pendingMessageTracker(compReg), _bucketDBUpdater(*this, *_bucketSpaceRepo, *this, compReg), _distributorStatusDelegate(compReg, *this, *this), _bucketDBStatusDelegate(compReg, *this, _bucketDBUpdater), - _idealStateManager(*this, *_bucketSpaceRepo, compReg, - manageActiveBucketCopies), - _externalOperationHandler(*this, *_bucketSpaceRepo, - _idealStateManager, compReg), + _idealStateManager(*this, *_bucketSpaceRepo, compReg, manageActiveBucketCopies), + _externalOperationHandler(*this, *_bucketSpaceRepo, _idealStateManager, compReg), _threadPool(threadPool), _initializingIsUp(true), _doneInitializeHandler(doneInitHandler), _doneInitializing(false), _messageSender(messageSender), _bucketPriorityDb(new SimpleBucketPriorityDatabase()), - _scanner(new SimpleMaintenanceScanner( - *_bucketPriorityDb, _idealStateManager, - *_bucketSpaceRepo)), - _throttlingStarter(new ThrottlingOperationStarter( - _maintenanceOperationOwner)), - _blockingStarter(new BlockingOperationStarter(_pendingMessageTracker, - *_throttlingStarter)), - _scheduler(new MaintenanceScheduler(_idealStateManager, - *_bucketPriorityDb, - *_blockingStarter)), + _scanner(new SimpleMaintenanceScanner(*_bucketPriorityDb, _idealStateManager, *_bucketSpaceRepo)), + _throttlingStarter(new ThrottlingOperationStarter(_maintenanceOperationOwner)), + _blockingStarter(new BlockingOperationStarter(_pendingMessageTracker, *_throttlingStarter)), + _scheduler(new MaintenanceScheduler(_idealStateManager, *_bucketPriorityDb, *_blockingStarter)), _schedulingMode(MaintenanceScheduler::NORMAL_SCHEDULING_MODE), _recoveryTimeStarted(_component.getClock()), _tickResult(framework::ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN), @@ -105,8 +92,7 @@ Distributor::Distributor(DistributorComponentRegister& compReg, _metricLock(), _maintenanceStats(), _bucketDbStats(), - _hostInfoReporter(_pendingMessageTracker.getLatencyStatisticsProvider(), - *this), + _hostInfoReporter(_pendingMessageTracker.getLatencyStatisticsProvider(), *this), _ownershipSafeTimeCalc( std::make_unique( std::chrono::seconds(0))) // Set by config later @@ -162,10 +148,8 @@ void Distributor::sendCommand(const std::shared_ptr& cmd) { if (cmd->getType() == api::MessageType::MERGEBUCKET) { - api::MergeBucketCommand& merge( - static_cast(*cmd)); - _idealStateManager.getMetrics().nodesPerMerge.addValue( - merge.getNodes().size()); + api::MergeBucketCommand& merge(static_cast(*cmd)); + _idealStateManager.getMetrics().nodesPerMerge.addValue(merge.getNodes().size()); } sendUp(cmd); } @@ -179,10 +163,8 @@ Distributor::sendReply(const std::shared_ptr& reply) void Distributor::setNodeStateUp() { - NodeStateUpdater::Lock::SP lock( - _component.getStateUpdater().grabStateChangeLock()); - lib::NodeState ns( - *_component.getStateUpdater().getReportedNodeState()); + NodeStateUpdater::Lock::SP lock(_component.getStateUpdater().grabStateChangeLock()); + lib::NodeState ns(*_component.getStateUpdater().getReportedNodeState()); ns.setState(lib::State::UP); _component.getStateUpdater().setReportedNodeState(ns); } @@ -832,5 +814,4 @@ Distributor::handleStatusRequest(const DelegatedStatusRequest& request) const return true; } -} // distributor -} // storage +} diff --git a/storage/src/vespa/storage/distributor/distributorinterface.h b/storage/src/vespa/storage/distributor/distributorinterface.h index bf27dc432b6..3445397c17d 100644 --- a/storage/src/vespa/storage/distributor/distributorinterface.h +++ b/storage/src/vespa/storage/distributor/distributorinterface.h @@ -1,32 +1,28 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include -#include -#include -#include +#include "bucketgctimecalculator.h" +#include "distributormessagesender.h" +#include "bucketownership.h" #include -#include -#include -#include -#include -#include +#include +namespace storage::api { class MergeBucketReply; } namespace storage { + class DistributorConfiguration; + class DistributorMetricSet; +} +namespace storage::distributor { -namespace distributor { +class PendingMessageTracker; class DistributorInterface : public DistributorMessageSender { public: virtual PendingMessageTracker& getPendingMessageTracker() = 0; - virtual DistributorMetricSet& getMetrics() = 0; - virtual void enableClusterState(const lib::ClusterState& state) = 0; - virtual BucketOwnership checkOwnershipInPendingState(const document::Bucket &bucket) const = 0; - virtual void notifyDistributionChangeEnabled() = 0; /** @@ -55,19 +51,11 @@ public: * Returns true if the node is currently initializing. */ virtual bool initializing() const = 0; - virtual void handleCompletedMerge(const std::shared_ptr&) = 0; - virtual const char* getStorageNodeUpStates() const = 0; - virtual const DistributorConfiguration& getConfig() const = 0; - virtual ChainedMessageSender& getMessageSender() = 0; - virtual const BucketGcTimeCalculator::BucketIdHasher& getBucketIdHasher() const = 0; }; } - -} - diff --git a/storage/src/vespa/storage/distributor/distributormessagesender.h b/storage/src/vespa/storage/distributor/distributormessagesender.h index 0fccaad87e3..078762dd05c 100644 --- a/storage/src/vespa/storage/distributor/distributormessagesender.h +++ b/storage/src/vespa/storage/distributor/distributormessagesender.h @@ -2,11 +2,9 @@ #pragma once #include -#include -namespace storage { - -namespace distributor { +namespace storage::lib { class NodeType; } +namespace storage::distributor { class PendingMessageTracker; @@ -16,21 +14,12 @@ public: Sends the storage command to the given node, returns message id. */ - virtual uint64_t sendToNode(const lib::NodeType& nodeType, - uint16_t node, - const std::shared_ptr& cmd, - bool useDocumentAPI = false); + virtual uint64_t sendToNode(const lib::NodeType& nodeType, uint16_t node, + const std::shared_ptr& cmd, bool useDocumentAPI = false); virtual int getDistributorIndex() const = 0; - virtual const std::string& getClusterName() const = 0; - virtual const PendingMessageTracker& getPendingMessageTracker() const = 0; }; -} // distributor - -} // storage - - - +} diff --git a/storage/src/vespa/storage/distributor/idealstatemanager.h b/storage/src/vespa/storage/distributor/idealstatemanager.h index b9607b35d28..028c9cbb0b6 100644 --- a/storage/src/vespa/storage/distributor/idealstatemanager.h +++ b/storage/src/vespa/storage/distributor/idealstatemanager.h @@ -1,18 +1,14 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include -#include -#include -#include -#include +#include "distributorcomponent.h" +#include "statechecker.h" #include #include +#include #include -#include -namespace storage { -namespace distributor { +namespace storage::distributor { class IdealStateMetricSet; class IdealStateOperation; @@ -116,8 +112,7 @@ private: DistributorComponent _distributorComponent; DistributorBucketSpaceRepo &_bucketSpaceRepo; - std::vector generateOperationsForBucket( - StateChecker::Context& c) const; + std::vector generateOperationsForBucket(StateChecker::Context& c) const; bool iAmUp() const; @@ -125,9 +120,9 @@ private: // Stats tracker to use for all generateAll() calls to avoid having // to create a new hash map for each single bucket processed. NodeMaintenanceStatsTracker _statsTracker; - const IdealStateManager& _ism; - document::BucketSpace _bucketSpace; - std::ostream& _out; + const IdealStateManager & _ism; + document::BucketSpace _bucketSpace; + std::ostream & _out; public: StatusBucketVisitor(const IdealStateManager& ism, document::BucketSpace bucketSpace, std::ostream& out) : _statsTracker(), _ism(ism), _bucketSpace(bucketSpace), _out(out) {} @@ -139,11 +134,8 @@ private: }; friend class StatusBucketVisitor; - void getBucketStatus(document::BucketSpace bucketSpace, - const BucketDatabase::Entry& entry, - NodeMaintenanceStatsTracker& statsTracker, - std::ostream& out) const; + void getBucketStatus(document::BucketSpace bucketSpace, const BucketDatabase::Entry& entry, + NodeMaintenanceStatsTracker& statsTracker, std::ostream& out) const; }; -} // distributor -} // storage +} diff --git a/storage/src/vespa/storage/distributor/messagetracker.cpp b/storage/src/vespa/storage/distributor/messagetracker.cpp index b844987e978..6568cec9a80 100644 --- a/storage/src/vespa/storage/distributor/messagetracker.cpp +++ b/storage/src/vespa/storage/distributor/messagetracker.cpp @@ -1,19 +1,19 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "messagetracker.h" +#include +#include #include LOG_SETUP(".messagetracker"); -namespace storage { - -namespace distributor { +namespace storage::distributor { MessageTracker::MessageTracker(const std::string& clusterName) : _clusterName(clusterName) {} -MessageTracker::~MessageTracker() {} +MessageTracker::~MessageTracker() = default; void MessageTracker::flushQueue(MessageSender& sender) @@ -48,7 +48,4 @@ MessageTracker::finished() return _sentMessages.empty(); } - -} - } diff --git a/storage/src/vespa/storage/distributor/messagetracker.h b/storage/src/vespa/storage/distributor/messagetracker.h index 63c0be1ca93..017979c16c0 100644 --- a/storage/src/vespa/storage/distributor/messagetracker.h +++ b/storage/src/vespa/storage/distributor/messagetracker.h @@ -1,10 +1,14 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include "distributormetricsset.h" #include -#include -#include +#include +#include + +namespace storage::api { + class BucketCommand; + class BucketReply; +} namespace storage::distributor { diff --git a/storage/src/vespa/storage/distributor/operations/external/putoperation.h b/storage/src/vespa/storage/distributor/operations/external/putoperation.h index 8beffe8b2c3..c27f2ee2266 100644 --- a/storage/src/vespa/storage/distributor/operations/external/putoperation.h +++ b/storage/src/vespa/storage/distributor/operations/external/putoperation.h @@ -5,22 +5,21 @@ #include #include #include -#include namespace document { class Document; } -namespace storage { -namespace lib { +namespace storage::lib { class Distribution; } -namespace api { +namespace storage::api { class CreateBucketReply; class PutCommand; } -namespace distributor { +namespace storage::distributor { class DistributorBucketSpace; +class OperationTargetList; class PutOperation : public SequencedOperation { @@ -78,5 +77,4 @@ private: DistributorBucketSpace &_bucketSpace; }; -} // distributor -} // storage +} diff --git a/storage/src/vespa/storage/distributor/operations/external/statbucketoperation.h b/storage/src/vespa/storage/distributor/operations/external/statbucketoperation.h index af448c2dd55..d40924e23f0 100644 --- a/storage/src/vespa/storage/distributor/operations/external/statbucketoperation.h +++ b/storage/src/vespa/storage/distributor/operations/external/statbucketoperation.h @@ -8,12 +8,11 @@ #pragma once #include +#include -namespace storage { +namespace storage::api { class StatBucketCommand; } -namespace api { class StatBucketCommand; } - -namespace distributor { +namespace storage::distributor { class DistributorComponent; class DistributorBucketSpace; @@ -21,9 +20,8 @@ class DistributorBucketSpace; class StatBucketOperation : public Operation { public: - StatBucketOperation(DistributorComponent& manager, - DistributorBucketSpace &bucketSpace, - const std::shared_ptr & cmd); + StatBucketOperation(DistributorComponent& manager, DistributorBucketSpace &bucketSpace, + const std::shared_ptr & cmd); ~StatBucketOperation(); const char* getName() const override { return "statBucket"; } @@ -37,10 +35,8 @@ private: std::shared_ptr _command; - std::map _sent; + std::map _sent; std::map _results; }; -} // distributor -} // storage - +} diff --git a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp index 79ffee7430c..db120880267 100644 --- a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp @@ -4,13 +4,12 @@ #include "getoperation.h" #include "putoperation.h" #include "updateoperation.h" -#include -#include -#include +#include #include #include +#include +#include #include -#include #include LOG_SETUP(".distributor.callback.twophaseupdate"); @@ -18,8 +17,7 @@ LOG_SETUP(".distributor.callback.twophaseupdate"); using namespace std::literals::string_literals; using document::BucketSpace; -namespace storage { -namespace distributor { +namespace storage::distributor { TwoPhaseUpdateOperation::TwoPhaseUpdateOperation( DistributorComponent& manager, @@ -570,5 +568,4 @@ TwoPhaseUpdateOperation::onClose(DistributorMessageSender& sender) { } } -} // distributor -} // storage +} diff --git a/storage/src/vespa/storage/distributor/operations/external/visitoroperation.h b/storage/src/vespa/storage/distributor/operations/external/visitoroperation.h index f35a9dcb3ec..b4f84d76649 100644 --- a/storage/src/vespa/storage/distributor/operations/external/visitoroperation.h +++ b/storage/src/vespa/storage/distributor/operations/external/visitoroperation.h @@ -11,11 +11,10 @@ namespace document { class Document; } -namespace storage { +namespace storage { class VisitorMetricSet; } +namespace storage::lib { class ClusterState; } -class VisitorMetricSet; - -namespace distributor { +namespace storage::distributor { class DistributorComponent; class DistributorBucketSpace; @@ -181,5 +180,3 @@ private: }; } - -} diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp index 2337129e375..52c8344b820 100644 --- a/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp @@ -3,9 +3,8 @@ #include #include #include -#include #include -#include +#include #include LOG_SETUP(".distributor.operation"); @@ -26,17 +25,15 @@ const uint32_t IdealStateOperation::MAINTENANCE_MESSAGE_TYPES[] = }; IdealStateOperation::IdealStateOperation(const BucketAndNodes& bucketAndNodes) - : _manager(nullptr), - _bucketSpace(nullptr), - _bucketAndNodes(bucketAndNodes), - _ok(true), - _priority(255) + : _manager(nullptr), + _bucketSpace(nullptr), + _bucketAndNodes(bucketAndNodes), + _ok(true), + _priority(255) { } -IdealStateOperation::~IdealStateOperation() -{ -} +IdealStateOperation::~IdealStateOperation() = default; BucketAndNodes::BucketAndNodes(const document::Bucket &bucket, uint16_t node) : _bucket(bucket) @@ -108,8 +105,7 @@ IdealStateOperation::setCommandMeta(api::MaintenanceCommand& cmd) const { cmd.setPriority(_priority); cmd.setReason(_detailedReason); - cmd.setLoadType( - (*_manager->getLoadTypes())["maintenance"]); + cmd.setLoadType((*_manager->getLoadTypes())["maintenance"]); } std::string diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp index 271ac35968e..32ea695bd94 100644 --- a/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp @@ -2,7 +2,7 @@ #include "mergeoperation.h" #include #include -#include +#include #include LOG_SETUP(".distributor.operation.idealstate.merge"); diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp index 1acb2dcc64b..6a87688c295 100644 --- a/storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/idealstate/setbucketstateoperation.cpp @@ -3,6 +3,7 @@ #include "setbucketstateoperation.h" #include #include +#include #include LOG_SETUP(".distributor.operation.idealstate.setactive"); diff --git a/storage/src/vespa/storage/distributor/operationtargetresolver.h b/storage/src/vespa/storage/distributor/operationtargetresolver.h index 23e0fbbcba4..20666ea254c 100644 --- a/storage/src/vespa/storage/distributor/operationtargetresolver.h +++ b/storage/src/vespa/storage/distributor/operationtargetresolver.h @@ -10,8 +10,7 @@ #include #include -namespace storage { -namespace distributor { +namespace storage::distributor { class OperationTarget : public vespalib::AsciiPrintable { @@ -68,5 +67,4 @@ public: const document::BucketId& id) = 0; }; -} // distributor -} // storage +} diff --git a/storageapi/src/vespa/storageapi/message/state.h b/storageapi/src/vespa/storageapi/message/state.h index e8062c71d22..746d92fce6b 100644 --- a/storageapi/src/vespa/storageapi/message/state.h +++ b/storageapi/src/vespa/storageapi/message/state.h @@ -6,8 +6,7 @@ #include #include -namespace storage { -namespace api { +namespace storage::api { /** * @class GetNodeStateCommand @@ -90,5 +89,4 @@ public: DECLARE_STORAGEREPLY(SetSystemStateReply, onSetSystemStateReply) }; -} // api -} // storage +} -- cgit v1.2.3