diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-08 14:41:50 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-08 14:41:50 +0200 |
commit | 135eb2f993346c5cbc360b4bb874381cf73ecc24 (patch) | |
tree | e3fd0c8a20a7f5bc7b6ae26fb8efde2110bd2371 | |
parent | 18d779a4cf527c22b3898a6501cb266505c77ee0 (diff) |
Reduce exposure to config internals.
40 files changed, 97 insertions, 77 deletions
diff --git a/config/src/tests/configparser/configparser.cpp b/config/src/tests/configparser/configparser.cpp index 40c0a5b99bd..f9e36a11def 100644 --- a/config/src/tests/configparser/configparser.cpp +++ b/config/src/tests/configparser/configparser.cpp @@ -2,6 +2,7 @@ #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/config/config.h> #include <vespa/config/common/configparser.h> +#include <vespa/config/common/exceptions.h> #include "config-foo.h" #include <fstream> #include <vespa/vespalib/stllike/asciistream.h> diff --git a/config/src/tests/configretriever/configretriever.cpp b/config/src/tests/configretriever/configretriever.cpp index 8273eee2c73..8e2d38e3c4d 100644 --- a/config/src/tests/configretriever/configretriever.cpp +++ b/config/src/tests/configretriever/configretriever.cpp @@ -9,6 +9,7 @@ #include <vespa/config/retriever/simpleconfigurer.h> #include <vespa/config/common/configholder.h> #include <vespa/config/subscription/configsubscription.h> +#include <vespa/config/common/exceptions.h> #include "config-bootstrap.h" #include "config-foo.h" #include "config-bar.h" diff --git a/config/src/tests/file_subscription/file_subscription.cpp b/config/src/tests/file_subscription/file_subscription.cpp index 622610ac1b5..25d27bcf905 100644 --- a/config/src/tests/file_subscription/file_subscription.cpp +++ b/config/src/tests/file_subscription/file_subscription.cpp @@ -3,6 +3,7 @@ #include <vespa/config/config.h> #include <vespa/config/common/configholder.h> #include <vespa/config/file/filesource.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/util/sync.h> #include <fstream> #include <config-my.h> diff --git a/config/src/tests/functiontest/functiontest.cpp b/config/src/tests/functiontest/functiontest.cpp index 28b688c189e..34429ab4016 100644 --- a/config/src/tests/functiontest/functiontest.cpp +++ b/config/src/tests/functiontest/functiontest.cpp @@ -1,6 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/config/config.h> +#include <vespa/config/common/exceptions.h> #include "config-function-test.h" #include <fstream> diff --git a/config/src/tests/subscriber/subscriber.cpp b/config/src/tests/subscriber/subscriber.cpp index f0b7fe18930..ce9a8fcbb6a 100644 --- a/config/src/tests/subscriber/subscriber.cpp +++ b/config/src/tests/subscriber/subscriber.cpp @@ -4,6 +4,7 @@ #include <vespa/config/common/misc.h> #include <vespa/config/common/configholder.h> #include <vespa/config/subscription/configsubscription.h> +#include <vespa/config/common/exceptions.h> #include <fstream> #include "config-foo.h" #include "config-bar.h" diff --git a/config/src/vespa/config/print/fileconfigsnapshotreader.cpp b/config/src/vespa/config/print/fileconfigsnapshotreader.cpp index 0cc7fe9fe38..951619aee6f 100644 --- a/config/src/vespa/config/print/fileconfigsnapshotreader.cpp +++ b/config/src/vespa/config/print/fileconfigsnapshotreader.cpp @@ -1,10 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <fstream> -#include <sstream> #include "fileconfigsnapshotreader.h" #include "jsonconfigformatter.h" -#include <iostream> +#include <vespa/config/common/exceptions.h> +#include <fstream> +#include <sstream> namespace config { diff --git a/config/src/vespa/config/print/fileconfigsnapshotwriter.cpp b/config/src/vespa/config/print/fileconfigsnapshotwriter.cpp index de5c3af065d..5717e5e9781 100644 --- a/config/src/vespa/config/print/fileconfigsnapshotwriter.cpp +++ b/config/src/vespa/config/print/fileconfigsnapshotwriter.cpp @@ -1,8 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <fstream> #include "fileconfigsnapshotwriter.h" #include "jsonconfigformatter.h" +#include <vespa/config/common/exceptions.h> +#include <fstream> namespace config { diff --git a/config/src/vespa/config/retriever/configretriever.cpp b/config/src/vespa/config/retriever/configretriever.cpp index 240ba3bac00..9d49ad3324e 100644 --- a/config/src/vespa/config/retriever/configretriever.cpp +++ b/config/src/vespa/config/retriever/configretriever.cpp @@ -1,6 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "configretriever.h" +#include <vespa/config/common/exceptions.h> + namespace config { diff --git a/config/src/vespa/config/retriever/configsnapshot.cpp b/config/src/vespa/config/retriever/configsnapshot.cpp index b04f44bf600..717c10d30e0 100644 --- a/config/src/vespa/config/retriever/configsnapshot.cpp +++ b/config/src/vespa/config/retriever/configsnapshot.cpp @@ -1,10 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "configsnapshot.h" -#include <vespa/vespalib/stllike/asciistream.h> +#include <vespa/config/subscription/configsubscription.h> +#include <vespa/config/print/configdatabuffer.h> +#include <vespa/config/common/exceptions.h> #include <vespa/config/common/misc.h> #include <vespa/vespalib/data/slime/slime.h> -#include <vespa/vespalib/data/memory.h> +#include <vespa/vespalib/stllike/asciistream.h> using vespalib::Slime; using vespalib::slime::Cursor; @@ -16,23 +18,19 @@ namespace config { const int64_t ConfigSnapshot::SNAPSHOT_FORMAT_VERSION = 1; ConfigSnapshot::ConfigSnapshot() - : _valueMap(), - _generation(0) -{} + : _valueMap(), + _generation(0) {} -ConfigSnapshot::~ConfigSnapshot() -{ +ConfigSnapshot::~ConfigSnapshot() { } -ConfigSnapshot::ConfigSnapshot(const ConfigSnapshot & rhs) : - _valueMap(rhs._valueMap), - _generation(rhs._generation) -{ +ConfigSnapshot::ConfigSnapshot(const ConfigSnapshot &rhs) : + _valueMap(rhs._valueMap), + _generation(rhs._generation) { } ConfigSnapshot & -ConfigSnapshot::operator = (const ConfigSnapshot & rhs) -{ +ConfigSnapshot::operator=(const ConfigSnapshot &rhs) { if (&rhs != this) { ConfigSnapshot tmp(rhs); tmp.swap(*this); @@ -41,25 +39,31 @@ ConfigSnapshot::operator = (const ConfigSnapshot & rhs) } void -ConfigSnapshot::swap(ConfigSnapshot & rhs) -{ +ConfigSnapshot::swap(ConfigSnapshot &rhs) { _valueMap.swap(rhs._valueMap); std::swap(_generation, rhs._generation); } -ConfigSnapshot::ConfigSnapshot(const SubscriptionList & subscriptionList, int64_t generation) - : _valueMap(), - _generation(generation) -{ +ConfigSnapshot::ConfigSnapshot(const SubscriptionList &subscriptionList, int64_t generation) + : _valueMap(), + _generation(generation) { for (SubscriptionList::const_iterator it(subscriptionList.begin()), mt(subscriptionList.end()); it != mt; it++) { _valueMap[(*it)->getKey()] = Value((*it)->getLastGenerationChanged(), (*it)->getConfig()); } } -ConfigSnapshot::ConfigSnapshot(const ValueMap & valueMap, int64_t generation) - : _valueMap(valueMap), - _generation(generation) -{ +ConfigSnapshot::ConfigSnapshot(const ValueMap &valueMap, int64_t generation) + : _valueMap(valueMap), + _generation(generation) { +} + +ConfigSnapshot::ValueMap::const_iterator +ConfigSnapshot::find(const ConfigKey &key) const { + ValueMap::const_iterator it(_valueMap.find(key)); + if (it == _valueMap.end()) { + throw IllegalConfigKeyException("Unable to find config for key " + key.toString()); + } + return it; } ConfigSnapshot diff --git a/config/src/vespa/config/retriever/configsnapshot.h b/config/src/vespa/config/retriever/configsnapshot.h index 4cb4eeb3e23..24a16876720 100644 --- a/config/src/vespa/config/retriever/configsnapshot.h +++ b/config/src/vespa/config/retriever/configsnapshot.h @@ -1,14 +1,16 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/config/subscription/configsubscription.h> -#include <vespa/config/print/configdatabuffer.h> +#include "configkeyset.h" +#include <vespa/config/common/configvalue.h> #include <vespa/vespalib/stllike/string.h> #include <map> -#include "configkeyset.h" namespace config { +class ConfigSubscription; +class ConfigDataBuffer; + /** * A ConfigSnapshot contains a map of config keys to config instances. You may * request an instance of a config by calling the getConfig method. @@ -16,7 +18,7 @@ namespace config { class ConfigSnapshot { public: - typedef std::vector<ConfigSubscription::SP> SubscriptionList; + typedef std::vector<std::shared_ptr<ConfigSubscription>> SubscriptionList; /** * Construct an empty config snapshot. @@ -112,6 +114,8 @@ private: void deserializeV2(vespalib::slime::Inspector & root); Value deserializeValueV2(vespalib::slime::Inspector & inspector) const; + ValueMap::const_iterator find(const ConfigKey & key) const; + ValueMap _valueMap; int64_t _generation; }; @@ -119,4 +123,3 @@ private: } // namespace config #include "configsnapshot.hpp" - diff --git a/config/src/vespa/config/retriever/configsnapshot.hpp b/config/src/vespa/config/retriever/configsnapshot.hpp index 395d36bb4f6..bb07431cdef 100644 --- a/config/src/vespa/config/retriever/configsnapshot.hpp +++ b/config/src/vespa/config/retriever/configsnapshot.hpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/config/common/exceptions.h> - namespace config { template <typename ConfigType> @@ -9,11 +7,7 @@ std::unique_ptr<ConfigType> ConfigSnapshot::getConfig(const vespalib::string & configId) const { ConfigKey key(ConfigKey::create<ConfigType>(configId)); - ValueMap::const_iterator it(_valueMap.find(key)); - if (it == _valueMap.end()) { - throw IllegalConfigKeyException("Unable to find config for key " + key.toString()); - } - return it->second.second.newInstance<ConfigType>(); + return find(key)->second.second.newInstance<ConfigType>(); } template <typename ConfigType> @@ -21,11 +15,7 @@ bool ConfigSnapshot::isChanged(const vespalib::string & configId, int64_t currentGeneration) const { ConfigKey key(ConfigKey::create<ConfigType>(configId)); - ValueMap::const_iterator it(_valueMap.find(key)); - if (it == _valueMap.end()) { - throw IllegalConfigKeyException("Unable to find config for key " + key.toString()); - } - return currentGeneration < it->second.first; + return currentGeneration < find(key)->second.first; } template <typename ConfigType> diff --git a/configd/src/apps/sentinel/sentinel.cpp b/configd/src/apps/sentinel/sentinel.cpp index fed65c7fbab..d557cc04993 100644 --- a/configd/src/apps/sentinel/sentinel.cpp +++ b/configd/src/apps/sentinel/sentinel.cpp @@ -1,19 +1,15 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <sys/types.h> +#include <vespa/config/common/exceptions.h> #include <signal.h> -#include <cstring> #include <unistd.h> #include <sys/time.h> - #include <vespa/defaults.h> +#include "config-handler.h" + #include <vespa/log/log.h> LOG_SETUP("config-sentinel"); -#include <vespa/config-sentinel.h> - -#include "config-handler.h" - using namespace config; constexpr uint64_t CONFIG_TIMEOUT_MS = 3 * 60 * 1000; diff --git a/configutil/src/lib/configstatus.cpp b/configutil/src/lib/configstatus.cpp index 8b721543c54..3cafccdf62e 100644 --- a/configutil/src/lib/configstatus.cpp +++ b/configutil/src/lib/configstatus.cpp @@ -7,6 +7,7 @@ #include <vbench/http/http_result_handler.h> #include <vbench/http/server_spec.h> #include <vbench/http/http_client.h> +#include <vespa/config/common/exceptions.h> #include <iostream> using configdefinitions::tagsContain; diff --git a/configutil/src/lib/modelinspect.cpp b/configutil/src/lib/modelinspect.cpp index 12a262bc6aa..e9aa744c478 100644 --- a/configutil/src/lib/modelinspect.cpp +++ b/configutil/src/lib/modelinspect.cpp @@ -3,6 +3,7 @@ #include "modelinspect.h" #include <lib/tags.h> #include <vespa/config/helper/configgetter.hpp> +#include <vespa/config/common/exceptions.h> #include <iostream> using configdefinitions::tagsContain; @@ -26,7 +27,7 @@ ModelInspect::ModelInspect(Flags flags, const config::ConfigUri uri, std::ostrea try { _cfg = config::ConfigGetter<cloud::config::ModelConfig>::getConfig(uri.getConfigId(), uri.getContext()); - } catch(config::ConfigRuntimeException &e) { + } catch (config::ConfigRuntimeException &e) { std::cerr << e.getMessage() << "\n"; } if (_cfg.get() != NULL) { diff --git a/documentapi/src/tests/loadtypes/loadtypetest.cpp b/documentapi/src/tests/loadtypes/loadtypetest.cpp index 03c1da178b0..9afd5783546 100644 --- a/documentapi/src/tests/loadtypes/loadtypetest.cpp +++ b/documentapi/src/tests/loadtypes/loadtypetest.cpp @@ -3,6 +3,7 @@ #include <vespa/documentapi/loadtypes/loadtypeset.h> #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/config/config.h> +#include <vespa/config/common/exceptions.h> namespace documentapi { diff --git a/documentapi/src/vespa/documentapi/loadtypes/loadtypeset.cpp b/documentapi/src/vespa/documentapi/loadtypes/loadtypeset.cpp index 062ed58ca87..34d843b2a01 100644 --- a/documentapi/src/vespa/documentapi/loadtypes/loadtypeset.cpp +++ b/documentapi/src/vespa/documentapi/loadtypes/loadtypeset.cpp @@ -3,6 +3,7 @@ #include "loadtypeset.h" #include <vespa/config-load-type.h> #include <vespa/config/config.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/stllike/hash_map.hpp> #include <vespa/config/helper/configgetter.hpp> diff --git a/filedistribution/src/apps/filedistributor/filedistributor.cpp b/filedistribution/src/apps/filedistributor/filedistributor.cpp index 222f157b8e4..d4055f51ccd 100644 --- a/filedistribution/src/apps/filedistributor/filedistributor.cpp +++ b/filedistribution/src/apps/filedistributor/filedistributor.cpp @@ -12,6 +12,7 @@ #include <vespa/filedistribution/rpc/filedistributorrpc.h> #include <vespa/filedistribution/common/componentsdeleter.h> #include <vespa/fileacquirer/config-filedistributorrpc.h> +#include <vespa/config/common/exceptions.h> #include <vespa/config-zookeepers.h> #include <vespa/fastos/app.h> #include <boost/program_options.hpp> diff --git a/searchcommon/src/vespa/searchcommon/common/schema.cpp b/searchcommon/src/vespa/searchcommon/common/schema.cpp index 720b4572fa8..c52a886fb3a 100644 --- a/searchcommon/src/vespa/searchcommon/common/schema.cpp +++ b/searchcommon/src/vespa/searchcommon/common/schema.cpp @@ -11,7 +11,6 @@ LOG_SETUP(".index.schema"); using namespace config; using namespace search::index; -using config::InvalidConfigException; namespace { diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp index 57c4b62cddb..2235cf3e342 100644 --- a/searchcore/src/apps/proton/proton.cpp +++ b/searchcore/src/apps/proton/proton.cpp @@ -9,6 +9,7 @@ #include <vespa/vespalib/util/signalhandler.h> #include <vespa/vespalib/util/programoptions.h> #include <vespa/vespalib/io/fileutil.h> +#include <vespa/config/common/exceptions.h> #include <vespa/fastos/app.h> #include <string> diff --git a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp index 5731700a55f..46250301c18 100644 --- a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp +++ b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp @@ -6,6 +6,7 @@ #include <vespa/config-rank-profiles.h> #include <vespa/config/config.h> #include <vespa/config/helper/legacy.h> +#include <vespa/config/common/exceptions.h> #include <vespa/eval/eval/tensor_spec.h> #include <vespa/eval/eval/value_cache/constant_value.h> #include <vespa/eval/tensor/default_tensor_engine.h> diff --git a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp index 423a3f509c0..59f0635d56a 100644 --- a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp +++ b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp @@ -18,6 +18,7 @@ #include <vespa/vespalib/util/slaveproc.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/objects/nbostream.h> +#include <vespa/config/common/exceptions.h> #include <vespa/config/helper/configgetter.hpp> #include <iostream> diff --git a/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp b/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp index 58844dc969c..7aa4bf908f2 100644 --- a/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp +++ b/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp @@ -3,6 +3,7 @@ #include <vespa/slobrok/sbmirror.h> #include <vespa/config-slobroks.h> #include <vespa/config/common/configsystem.h> +#include <vespa/config/common/exceptions.h> #include <vespa/fnet/frt/frt.h> #include <vespa/vespalib/util/host_name.h> #include <vespa/vespalib/util/stringfmt.h> diff --git a/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp b/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp index b5d76c3f60a..44a99395427 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp @@ -2,10 +2,12 @@ #include "proton_config_fetcher.h" #include "bootstrapconfig.h" -#include <vespa/vespalib/util/exceptions.h> -#include <thread> #include "proton_config_snapshot.h" #include "i_proton_configurer.h" +#include <vespa/config/common/exceptions.h> +#include <vespa/vespalib/util/exceptions.h> +#include <thread> + #include <vespa/log/log.h> LOG_SETUP(".proton.server.proton_config_fetcher"); diff --git a/slobrok/src/apps/slobrok/slobrok.cpp b/slobrok/src/apps/slobrok/slobrok.cpp index fb785a55562..50d0c2a0399 100644 --- a/slobrok/src/apps/slobrok/slobrok.cpp +++ b/slobrok/src/apps/slobrok/slobrok.cpp @@ -1,6 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fnet/fnet.h> #include <vespa/slobrok/server/sbenv.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/fastos/app.h> diff --git a/slobrok/src/vespa/slobrok/server/sbenv.cpp b/slobrok/src/vespa/slobrok/server/sbenv.cpp index 88d34f228c4..d525bbd3e62 100644 --- a/slobrok/src/vespa/slobrok/server/sbenv.cpp +++ b/slobrok/src/vespa/slobrok/server/sbenv.cpp @@ -6,6 +6,7 @@ #include <sstream> #include <vespa/vespalib/net/state_server.h> #include <vespa/vespalib/util/host_name.h> +#include <vespa/vespalib/util/exception.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/fnet/frt/supervisor.h> #include <vespa/fnet/transport.h> diff --git a/storage/src/tests/bucketmover/bucketmovertest.cpp b/storage/src/tests/bucketmover/bucketmovertest.cpp index c233765ad27..9940cb0e55b 100644 --- a/storage/src/tests/bucketmover/bucketmovertest.cpp +++ b/storage/src/tests/bucketmover/bucketmovertest.cpp @@ -6,7 +6,7 @@ #include <tests/common/dummystoragelink.h> #include <tests/common/testhelper.h> #include <tests/common/teststorageapp.h> -#include <vespa/storage/bucketdb/storbucketdb.h> +#include <vespa/config/common/exceptions.h> bool debug = false; diff --git a/storage/src/tests/common/metricstest.cpp b/storage/src/tests/common/metricstest.cpp index 15f0373e680..8eb1ed69bf8 100644 --- a/storage/src/tests/common/metricstest.cpp +++ b/storage/src/tests/common/metricstest.cpp @@ -11,9 +11,10 @@ #include <tests/common/teststorageapp.h> #include <tests/common/testhelper.h> #include <tests/common/dummystoragelink.h> -#include <thread> #include <vespa/metrics/metricmanager.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/stllike/hash_map.hpp> +#include <thread> #include <vespa/log/log.h> LOG_SETUP(".test.metrics"); diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp index 52b976586e8..a62e6fab640 100644 --- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp +++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp @@ -1,4 +1,14 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include <tests/common/testhelper.h> +#include <tests/common/storagelinktest.h> +#include <tests/common/teststorageapp.h> +#include <tests/persistence/filestorage/forwardingmessagesender.h> +#include <vespa/storage/storageserver/statemanager.h> +#include <vespa/storage/bucketdb/bucketmanager.h> +#include <vespa/storage/persistence/persistencethread.h> +#include <vespa/storage/persistence/filestorage/filestormanager.h> +#include <vespa/storage/persistence/filestorage/modifiedbucketchecker.h> #include <vespa/document/update/assignvalueupdate.h> #include <vespa/document/datatype/datatype.h> #include <vespa/document/fieldvalue/document.h> @@ -17,17 +27,9 @@ #include <vespa/storageapi/message/multioperation.h> #include <vespa/storageapi/message/persistence.h> #include <vespa/storageapi/message/removelocation.h> -#include <vespa/storage/bucketdb/bucketmanager.h> -#include <vespa/storage/persistence/persistencethread.h> -#include <vespa/storage/persistence/filestorage/filestormanager.h> -#include <vespa/storage/persistence/filestorage/modifiedbucketchecker.h> -#include <tests/common/testhelper.h> -#include <tests/common/storagelinktest.h> -#include <tests/common/teststorageapp.h> -#include <tests/persistence/filestorage/forwardingmessagesender.h> #include <vespa/persistence/dummyimpl/dummypersistence.h> #include <vespa/storageapi/message/batch.h> -#include <vespa/storage/storageserver/statemanager.h> +#include <vespa/config/common/exceptions.h> #include <vespa/fastos/file.h> #include <vespa/log/log.h> diff --git a/storage/src/tests/persistence/filestorage/modifiedbucketcheckertest.cpp b/storage/src/tests/persistence/filestorage/modifiedbucketcheckertest.cpp index 58b4ae4d475..4c6e4e42b06 100644 --- a/storage/src/tests/persistence/filestorage/modifiedbucketcheckertest.cpp +++ b/storage/src/tests/persistence/filestorage/modifiedbucketcheckertest.cpp @@ -6,6 +6,7 @@ #include <tests/common/teststorageapp.h> #include <vespa/persistence/dummyimpl/dummypersistence.h> #include <vespa/storage/persistence/filestorage/modifiedbucketchecker.h> +#include <vespa/config/common/exceptions.h> namespace storage { diff --git a/storage/src/tests/storageserver/bouncertest.cpp b/storage/src/tests/storageserver/bouncertest.cpp index 751d6b535a3..ff7f5f02077 100644 --- a/storage/src/tests/storageserver/bouncertest.cpp +++ b/storage/src/tests/storageserver/bouncertest.cpp @@ -1,16 +1,16 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <boost/pointer_cast.hpp> #include <cppunit/extensions/HelperMacros.h> #include <vespa/storageapi/message/bucket.h> #include <vespa/storageapi/message/state.h> #include <vespa/storageapi/message/stat.h> -#include <vespa/vdslib/state/nodestate.h> #include <vespa/storage/storageserver/bouncer.h> #include <tests/common/teststorageapp.h> #include <tests/common/testhelper.h> #include <tests/common/dummystoragelink.h> #include <vespa/storageapi/message/persistence.h> +#include <vespa/config/common/exceptions.h> + namespace storage { diff --git a/storage/src/tests/storageserver/statereportertest.cpp b/storage/src/tests/storageserver/statereportertest.cpp index 8a164361c88..39d423f37fe 100644 --- a/storage/src/tests/storageserver/statereportertest.cpp +++ b/storage/src/tests/storageserver/statereportertest.cpp @@ -9,6 +9,7 @@ #include <tests/common/teststorageapp.h> #include <tests/common/testhelper.h> #include <tests/common/dummystoragelink.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/data/slime/slime.h> #include <vespa/log/log.h> diff --git a/storage/src/tests/visiting/visitormanagertest.cpp b/storage/src/tests/visiting/visitormanagertest.cpp index 1824b976aea..ff1c3e3a5de 100644 --- a/storage/src/tests/visiting/visitormanagertest.cpp +++ b/storage/src/tests/visiting/visitormanagertest.cpp @@ -16,6 +16,7 @@ #include <vespa/documentapi/messagebus/messages/multioperationmessage.h> #include <vespa/documentapi/messagebus/messages/putdocumentmessage.h> #include <vespa/documentapi/messagebus/messages/removedocumentmessage.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/util/exceptions.h> namespace storage { diff --git a/storage/src/tests/visiting/visitortest.cpp b/storage/src/tests/visiting/visitortest.cpp index 84f1297b05f..e5759e7fa85 100644 --- a/storage/src/tests/visiting/visitortest.cpp +++ b/storage/src/tests/visiting/visitortest.cpp @@ -15,6 +15,7 @@ #include <vespa/documentapi/messagebus/messages/multioperationmessage.h> #include <vespa/documentapi/messagebus/messages/putdocumentmessage.h> #include <vespa/documentapi/messagebus/messages/removedocumentmessage.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/util/exceptions.h> #include <thread> diff --git a/storage/src/vespa/storage/bucketmover/bucketmover.cpp b/storage/src/vespa/storage/bucketmover/bucketmover.cpp index 063050baa3c..b5522360b11 100644 --- a/storage/src/vespa/storage/bucketmover/bucketmover.cpp +++ b/storage/src/vespa/storage/bucketmover/bucketmover.cpp @@ -6,6 +6,7 @@ #include <vespa/storage/common/bucketmessages.h> #include <vespa/storage/common/nodestateupdater.h> #include <vespa/storage/storageutil/log.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/util/stringfmt.h> #include <thread> diff --git a/storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp b/storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp index f0e640afe27..9d98deef199 100644 --- a/storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/modifiedbucketchecker.cpp @@ -2,8 +2,9 @@ #include "modifiedbucketchecker.h" #include "filestormanager.h" -#include <vespa/log/log.h> +#include <vespa/config/common/exceptions.h> +#include <vespa/log/log.h> LOG_SETUP(".persistence.filestor.modifiedbucketchecker"); namespace storage { @@ -81,9 +82,7 @@ ModifiedBucketChecker::onClose() void ModifiedBucketChecker::run(framework::ThreadHandle& thread) { - LOG(debug, - "Started modified bucket checker thread with pid %d", - getpid()); + LOG(debug, "Started modified bucket checker thread with pid %d", getpid()); while (!thread.interrupted()) { thread.registerTick(); @@ -202,4 +201,3 @@ ModifiedBucketChecker::tick() } } // ns storage - diff --git a/storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp b/storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp index 05b581d839a..f606ba5b584 100644 --- a/storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp +++ b/storage/src/vespa/storage/storageserver/bucketintegritychecker.cpp @@ -1,13 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "bucketintegritychecker.h" - #include <vespa/storage/common/bucketmessages.h> #include <vespa/storage/storageutil/log.h> #include <vespa/storage/bucketdb/storbucketdb.h> #include <vespa/storageapi/message/state.h> #include <vespa/vdslib/distribution/distribution.h> #include <vespa/storage/bucketdb/lockablemap.hpp> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/log/bufferedlogger.h> diff --git a/storage/src/vespa/storage/storageserver/mergethrottler.cpp b/storage/src/vespa/storage/storageserver/mergethrottler.cpp index d37b45435ce..99ce5c5df64 100644 --- a/storage/src/vespa/storage/storageserver/mergethrottler.cpp +++ b/storage/src/vespa/storage/storageserver/mergethrottler.cpp @@ -1,13 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "mergethrottler.h" -#include "storagemetricsset.h" #include <vespa/storage/common/nodestateupdater.h> #include <vespa/storage/persistence/messages.h> #include <vespa/messagebus/message.h> +#include <vespa/config/common/exceptions.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/util/stringfmt.h> -#include <sstream> #include <vespa/log/log.h> diff --git a/storage/src/vespa/storage/visiting/visitormanager.cpp b/storage/src/vespa/storage/visiting/visitormanager.cpp index 5e1f8b4df79..e069202e5f9 100644 --- a/storage/src/vespa/storage/visiting/visitormanager.cpp +++ b/storage/src/vespa/storage/visiting/visitormanager.cpp @@ -9,9 +9,9 @@ #include "recoveryvisitor.h" #include <vespa/storageframework/generic/memory/memorymanagerinterface.h> #include <vespa/storage/common/statusmessages.h> +#include <vespa/config/common/exceptions.h> #include <vespa/documentapi/loadtypes/loadtypeset.h> #include <vespa/vespalib/util/stringfmt.h> -#include <sstream> #include <vespa/log/log.h> LOG_SETUP(".visitor.manager"); diff --git a/streamingvisitors/src/vespa/searchvisitor/rankmanager.cpp b/streamingvisitors/src/vespa/searchvisitor/rankmanager.cpp index 4befe163377..59e301e5dd3 100644 --- a/streamingvisitors/src/vespa/searchvisitor/rankmanager.cpp +++ b/streamingvisitors/src/vespa/searchvisitor/rankmanager.cpp @@ -4,6 +4,7 @@ #include <vespa/searchlib/features/setup.h> #include <vespa/searchlib/fef/functiontablefactory.h> #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/vespalib/util/exception.h> #include <vespa/log/log.h> LOG_SETUP(".searchvisitor.rankmanager"); diff --git a/vespaclient/src/vespa/vespaclient/vesparoute/application.cpp b/vespaclient/src/vespa/vespaclient/vesparoute/application.cpp index baf7c01d631..e01104943cd 100644 --- a/vespaclient/src/vespa/vespaclient/vesparoute/application.cpp +++ b/vespaclient/src/vespa/vespaclient/vesparoute/application.cpp @@ -11,6 +11,7 @@ #include <vespa/messagebus/routing/routedirective.h> #include <vespa/messagebus/rpcmessagebus.h> #include <vespa/slobrok/sbmirror.h> +#include <vespa/config/common/exceptions.h> #include <vespa/config/helper/configgetter.hpp> #include <vespa/vespalib/util/stringfmt.h> |