diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-18 03:02:49 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-18 03:02:49 +0200 |
commit | 7a4461355f7ee8e5ec71888516cbfd640dd7e110 (patch) | |
tree | 5f800152d48de71247177c4fca93fff24dc993ac /storage | |
parent | 15e7bcd9e902407fbe14cf830968f06c9fb5fb89 (diff) |
Include only what you need.
Diffstat (limited to 'storage')
15 files changed, 51 insertions, 61 deletions
diff --git a/storage/src/tests/storageserver/documentapiconvertertest.cpp b/storage/src/tests/storageserver/documentapiconvertertest.cpp index d8761f9e84e..a0553625c8c 100644 --- a/storage/src/tests/storageserver/documentapiconvertertest.cpp +++ b/storage/src/tests/storageserver/documentapiconvertertest.cpp @@ -13,6 +13,7 @@ #include <vespa/document/bucket/bucketidfactory.h> #include <vespa/config/subscription/configuri.h> #include <vespa/vespalib/testkit/test_kit.h> +#include <climits> using document::DataType; using document::DocIdString; diff --git a/storage/src/vespa/storage/bucketdb/bucketmanagermetrics.cpp b/storage/src/vespa/storage/bucketdb/bucketmanagermetrics.cpp index 4512c6ddf4f..84b90ceedec 100644 --- a/storage/src/vespa/storage/bucketdb/bucketmanagermetrics.cpp +++ b/storage/src/vespa/storage/bucketdb/bucketmanagermetrics.cpp @@ -2,6 +2,7 @@ #include "bucketmanagermetrics.h" #include <vespa/vespalib/util/exceptions.h> +#include <cassert> namespace storage { diff --git a/storage/src/vespa/storage/distributor/operations/external/visitororder.h b/storage/src/vespa/storage/distributor/operations/external/visitororder.h index 88fd242a454..69aefb1ec33 100644 --- a/storage/src/vespa/storage/distributor/operations/external/visitororder.h +++ b/storage/src/vespa/storage/distributor/operations/external/visitororder.h @@ -1,8 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace storage { +#include <climits> -namespace distributor { +namespace storage::distributor { struct VisitorOrder { const document::OrderingSpecification& _ordering; @@ -78,6 +78,4 @@ struct VisitorOrder { } -} - diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp index f17792302d1..536c9d764be 100644 --- a/storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/idealstate/joinoperation.cpp @@ -2,7 +2,7 @@ #include "joinoperation.h" #include <vespa/storageapi/message/bucketsplitting.h> - +#include <climits> #include <vespa/log/bufferedlogger.h> LOG_SETUP(".distributor.operation.idealstate.join"); diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp index 88f3a238a78..5c69c4576f0 100644 --- a/storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/idealstate/splitoperation.cpp @@ -4,9 +4,9 @@ #include <vespa/storage/distributor/idealstatemanager.h> #include <vespa/storage/common/bucketoperationlogger.h> #include <vespa/storageapi/message/bucketsplitting.h> +#include <climits> #include <vespa/log/bufferedlogger.h> - LOG_SETUP(".distributor.operation.idealstate.split"); using namespace storage::distributor; diff --git a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp index ac08e176a97..2039c1b5177 100644 --- a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp +++ b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp @@ -5,6 +5,7 @@ #include <vespa/storageframework/defaultimplementation/clock/realclock.h> #include <vespa/storage/common/bucketoperationlogger.h> #include <vespa/vespalib/util/xmlstream.hpp> +#include <climits> #include <vespa/log/log.h> LOG_SETUP(".pendingclusterstate"); diff --git a/storage/src/vespa/storage/persistence/bucketprocessor.cpp b/storage/src/vespa/storage/persistence/bucketprocessor.cpp index fd9b51a90c7..c512cdd461a 100644 --- a/storage/src/vespa/storage/persistence/bucketprocessor.cpp +++ b/storage/src/vespa/storage/persistence/bucketprocessor.cpp @@ -3,6 +3,7 @@ #include "bucketprocessor.h" #include <vespa/document/fieldset/fieldsets.h> #include <vespa/vespalib/stllike/asciistream.h> +#include <cassert> namespace storage { diff --git a/storage/src/vespa/storage/persistence/splitbitdetector.cpp b/storage/src/vespa/storage/persistence/splitbitdetector.cpp index d8bf01775c8..1133c470bb0 100644 --- a/storage/src/vespa/storage/persistence/splitbitdetector.cpp +++ b/storage/src/vespa/storage/persistence/splitbitdetector.cpp @@ -5,6 +5,7 @@ #include <vespa/document/bucket/bucketidfactory.h> #include <vespa/document/base/documentid.h> #include <sstream> +#include <cassert> #include <vespa/log/bufferedlogger.h> LOG_SETUP(".persistence.split.bitdetector"); diff --git a/storage/src/vespa/storage/storageserver/distributornode.h b/storage/src/vespa/storage/storageserver/distributornode.h index 47b14470639..34f2dbb42a7 100644 --- a/storage/src/vespa/storage/storageserver/distributornode.h +++ b/storage/src/vespa/storage/storageserver/distributornode.h @@ -24,7 +24,7 @@ class DistributorNode uint64_t _lastUniqueTimestampRequested; uint32_t _uniqueTimestampCounter; bool _manageActiveBucketCopies; - StorageLink::UP _retrievedCommunicationManager; + std::unique_ptr<StorageLink> _retrievedCommunicationManager; public: typedef std::unique_ptr<DistributorNode> UP; @@ -38,7 +38,7 @@ public: DistributorNodeContext&, ApplicationGenerationFetcher& generationFetcher, NeedActiveState, - StorageLink::UP communicationManager = StorageLink::UP()); + std::unique_ptr<StorageLink> communicationManager); ~DistributorNode(); const lib::NodeType& getNodeType() const override { return lib::NodeType::DISTRIBUTOR; } @@ -49,7 +49,7 @@ public: private: void initializeNodeSpecific() override; - StorageLink::UP createChain() override; + std::unique_ptr<StorageLink> createChain() override; api::Timestamp getUniqueTimestamp() override; /** diff --git a/storage/src/vespa/storage/storageserver/servicelayernode.h b/storage/src/vespa/storage/storageserver/servicelayernode.h index 4e0de3bbf24..848cc1d1475 100644 --- a/storage/src/vespa/storage/storageserver/servicelayernode.h +++ b/storage/src/vespa/storage/storageserver/servicelayernode.h @@ -11,6 +11,8 @@ #include "applicationgenerationfetcher.h" #include "servicelayernodecontext.h" #include "storagenode.h" +#include <vespa/storage/visiting/visitormessagesessionfactory.h> +#include <vespa/storage/common/visitorfactory.h> #include <vespa/storage/bucketdb/minimumusedbitstracker.h> #include <vespa/persistence/spi/persistenceprovider.h> #include <vespa/config-stor-devices.h> @@ -65,7 +67,7 @@ private: void configure(std::unique_ptr<vespa::config::storage::StorDevicesConfig> config) override; VisitorMessageSession::UP createSession(Visitor&, VisitorThread&) override; documentapi::Priority::Value toDocumentPriority(uint8_t storagePriority) const override; - StorageLink::UP createChain() override; + std::unique_ptr<StorageLink> createChain() override; void removeConfigSubscriptions() override; }; diff --git a/storage/src/vespa/storage/storageserver/storagenode.cpp b/storage/src/vespa/storage/storageserver/storagenode.cpp index ac386674032..27f98b478ce 100644 --- a/storage/src/vespa/storage/storageserver/storagenode.cpp +++ b/storage/src/vespa/storage/storageserver/storagenode.cpp @@ -1,37 +1,22 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "storagenode.h" -#include "bouncer.h" -#include "bucketintegritychecker.h" #include "communicationmanager.h" -#include "mergethrottler.h" -#include "opslogger.h" #include "statemanager.h" #include "statereporter.h" #include "storagemetricsset.h" +#include "storagenodecontext.h" -#include <vespa/storage/bucketdb/bucketmanager.h> -#include <vespa/storage/bucketdb/storagebucketdbinitializer.h> -#include <vespa/storage/bucketmover/bucketmover.h> -#include <vespa/storageframework/storageframework.h> -#include <vespa/storageframework/defaultimplementation/memory/prioritymemorylogic.h> +#include <vespa/storage/frameworkimpl/memory/memorystatusviewer.h> +#include <vespa/storage/frameworkimpl/status/statuswebserver.h> +#include <vespa/storage/frameworkimpl/thread/deadlockdetector.h> #include <vespa/storage/common/statusmetricconsumer.h> -#include <vespa/storage/common/hostreporter/hostinfo.h> -#include <vespa/storage/distributor/bucketdbupdater.h> -#include <vespa/storage/distributor/distributor.h> -#include <vespa/storage/distributor/pendingmessagetracker.h> -#include <vespa/storage/persistence/filestorage/filestormanager.h> -#include <vespa/storage/storageutil/functor.h> -#include <vespa/storage/storageutil/log.h> -#include <vespa/storage/visiting/visitormanager.h> -#include <vespa/storage/visiting/messagebusvisitormessagesession.h> -#include <vespa/vdslib/distribution/distribution.h> #include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/metrics/metricmanager.h> -#include <fstream> -#include <sstream> +#include <fcntl.h> +#include <vespa/log/log.h> LOG_SETUP(".node.server"); namespace storage { diff --git a/storage/src/vespa/storage/storageserver/storagenode.h b/storage/src/vespa/storage/storageserver/storagenode.h index 530920b7578..4c4918e6977 100644 --- a/storage/src/vespa/storage/storageserver/storagenode.h +++ b/storage/src/vespa/storage/storageserver/storagenode.h @@ -12,35 +12,23 @@ #pragma once -#include "storagemetricsset.h" -#include "storagenodecontext.h" -#include "applicationgenerationfetcher.h" -#include <vespa/document/bucket/bucketidfactory.h> -#include <vespa/storage/config/config-stor-server.h> - -#include <vespa/config/helper/legacysubscriber.h> -#include <vespa/document/bucket/bucketid.h> -#include <vespa/document/config/config-documenttypes.h> -#include <vespa/documentapi/loadtypes/loadtypeset.h> -#include <vespa/metrics/metrics.h> -#include <vespa/storage/bucketdb/storbucketdb.h> +#include <vespa/storage/storageutil/resumeguard.h> #include <vespa/storage/common/doneinitializehandler.h> -#include <vespa/storage/common/storagelink.h> -#include <vespa/storage/common/visitorfactory.h> -#include <vespa/storage/config/config-stor-prioritymapping.h> -#include <vespa/storageframework/defaultimplementation/clock/realclock.h> -#include <vespa/storageframework/defaultimplementation/component/componentregisterimpl.h> -#include <vespa/storage/frameworkimpl/status/statuswebserver.h> -#include <vespa/storage/frameworkimpl/thread/deadlockdetector.h> -#include <vespa/storageframework/defaultimplementation/memory/memorymanager.h> -#include <vespa/storageframework/defaultimplementation/thread/threadpoolimpl.h> -#include <vespa/storage/frameworkimpl/memory/memorystatusviewer.h> #include <vespa/storageframework/generic/metric/metricupdatehook.h> -#include <vespa/storage/visiting/visitormessagesessionfactory.h> -#include <vespa/storage/storageutil/resumeguard.h> +#include <vespa/storageframework/defaultimplementation/component/componentregisterimpl.h> + +#include <vespa/config/subscription/configuri.h> +#include <vespa/config/helper/ifetchercallback.h> +#include <vespa/config/helper/configfetcher.h> + +#include <vespa/storage/config/config-stor-prioritymapping.h> +#include <vespa/storage/config/config-stor-server.h> +#include <vespa/document/config/config-documenttypes.h> #include <vespa/config-upgrading.h> #include <vespa/config-stor-distribution.h> +namespace document { class DocumentTypeRepo; } + namespace storage { class StatusMetricConsumer; @@ -49,6 +37,17 @@ class CommunicationManager; class FileStorManager; class HostInfo; class StateManager; +class MemoryStatusViewer; +class StatusWebServer; +class StorageLink; +class DeadLockDetector; +class StorageMetricSet; +class StorageNodeContext; +class ApplicationGenerationFetcher; +class StorageComponent; + +namespace lib { class NodeType; } + class StorageNode : private config::IFetcherCallback<vespa::config::content::core::StorServerConfig>, private config::IFetcherCallback<vespa::config::content::StorDistributionConfig>, @@ -82,7 +81,7 @@ public: void updateMetrics(const MetricLockGuard & guard) override; /** Updates the document type repo. */ - void setNewDocumentRepo(const document::DocumentTypeRepo::SP& repo); + void setNewDocumentRepo(const std::shared_ptr<document::DocumentTypeRepo>& repo); /** * Pauses the persistence processing. While the returned ResumeGuard @@ -154,7 +153,7 @@ protected: std::unique_ptr<vespa::config::content::StorDistributionConfig> _newDistributionConfig; std::unique_ptr<vespa::config::content::core::StorPrioritymappingConfig> _newPriorityConfig; std::unique_ptr<document::DocumenttypesConfig> _newDoctypesConfig; - StorageComponent::UP _component; + std::unique_ptr<StorageComponent> _component; config::ConfigUri _configUri; CommunicationManager* _communicationManager; @@ -170,7 +169,7 @@ protected: void initialize(); virtual void subscribeToConfigs(); virtual void initializeNodeSpecific() = 0; - virtual StorageLink::UP createChain() = 0; + virtual std::unique_ptr<StorageLink> createChain() = 0; virtual void handleLiveConfigUpdate(); void shutdown(); virtual void removeConfigSubscriptions(); diff --git a/storage/src/vespa/storage/storageutil/resumeguard.h b/storage/src/vespa/storage/storageutil/resumeguard.h index f6003000205..a6fdcbbe506 100644 --- a/storage/src/vespa/storage/storageutil/resumeguard.h +++ b/storage/src/vespa/storage/storageutil/resumeguard.h @@ -13,7 +13,7 @@ public: }; ResumeGuard() - : _cb(NULL) + : _cb(nullptr) {} ResumeGuard(Callback& cb) @@ -21,7 +21,7 @@ public: ResumeGuard(const ResumeGuard& other) { _cb = other._cb; - const_cast<ResumeGuard&>(other)._cb = NULL; + const_cast<ResumeGuard&>(other)._cb = nullptr; } ~ResumeGuard() { diff --git a/storage/src/vespa/storage/tools/throttlingsim.cpp b/storage/src/vespa/storage/tools/throttlingsim.cpp index 26fa4f94875..cd3c0c1cea4 100644 --- a/storage/src/vespa/storage/tools/throttlingsim.cpp +++ b/storage/src/vespa/storage/tools/throttlingsim.cpp @@ -3,6 +3,7 @@ #include "throttlingsim.h" #include <algorithm> #include <vespa/vespalib/util/stringfmt.h> +#include <unistd.h> bool Receiver::enqueue(const Message& msg) { vespalib::MonitorGuard lock(sync); diff --git a/storage/src/vespa/storage/visiting/visitormessagesessionfactory.h b/storage/src/vespa/storage/visiting/visitormessagesessionfactory.h index fb090fc2860..5515595a1c5 100644 --- a/storage/src/vespa/storage/visiting/visitormessagesessionfactory.h +++ b/storage/src/vespa/storage/visiting/visitormessagesessionfactory.h @@ -2,7 +2,7 @@ #pragma once -#include <vespa/storage/visiting/visitormessagesession.h> +#include "visitormessagesession.h" namespace storage { |