diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-14 22:58:54 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-15 13:12:36 +0100 |
commit | 2a85dc3fd5af5c33601cf04ead06c7545fa46d75 (patch) | |
tree | f46f355235fd7684a9f8a6bb562797fd985d1180 /documentapi | |
parent | d9b45214d28207564329991afe70afc358fe6d12 (diff) |
Split in hash_xxx, array, lru, cache ++ in hpp files. To reduce clinon build
Diffstat (limited to 'documentapi')
17 files changed, 39 insertions, 57 deletions
diff --git a/documentapi/src/vespa/documentapi/loadtypes/loadtypeset.cpp b/documentapi/src/vespa/documentapi/loadtypes/loadtypeset.cpp index d992110513f..20b01ae59c9 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/vespalib/stllike/hash_map.hpp> namespace documentapi { diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/documentmessage.h b/documentapi/src/vespa/documentapi/messagebus/messages/documentmessage.h index 3a626f966d8..98277cac427 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/documentmessage.h +++ b/documentapi/src/vespa/documentapi/messagebus/messages/documentmessage.h @@ -1,10 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/document/util/bytebuffer.h> +#include "documentreply.h" #include <vespa/messagebus/message.h> #include <vespa/messagebus/reply.h> -#include "documentreply.h" #include <vespa/documentapi/loadtypes/loadtype.h> #include <vespa/documentapi/messagebus/priority.h> diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/documentreply.h b/documentapi/src/vespa/documentapi/messagebus/messages/documentreply.h index addc3890d7e..c1e13ccbc16 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/documentreply.h +++ b/documentapi/src/vespa/documentapi/messagebus/messages/documentreply.h @@ -2,7 +2,6 @@ #pragma once #include <vespa/messagebus/reply.h> -#include <vespa/documentapi/messagebus/documentprotocol.h> #include <vespa/documentapi/messagebus/priority.h> namespace documentapi { diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/documentstate.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/documentstate.cpp index 4b073afbb6f..b177475f82a 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/documentstate.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/messages/documentstate.cpp @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "documentstate.h" - #include <vespa/document/util/bytebuffer.h> #include <vespa/documentapi/common.h> #include <vespa/vespalib/objects/nbostream.h> diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/documentsummarymessage.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/documentsummarymessage.cpp index 5416b73d548..4525b37ef14 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/documentsummarymessage.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/messages/documentsummarymessage.cpp @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/vespalib/util/exceptions.h> -#include <vespa/documentapi/messagebus/messages/documentsummarymessage.h> + +#include "documentsummarymessage.h" using vdslib::DocumentSummary; diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/emptybucketsmessage.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/emptybucketsmessage.cpp index 5d1d1ed00e5..ef87fa631fe 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/emptybucketsmessage.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/messages/emptybucketsmessage.cpp @@ -1,6 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/documentapi/messagebus/messages/emptybucketsmessage.h> + +#include "emptybucketsmessage.h" #include <vespa/documentapi/messagebus/documentprotocol.h> namespace documentapi { diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistmessage.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistmessage.cpp index ad7a44c1cc9..af68c6b4886 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistmessage.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistmessage.cpp @@ -1,8 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + +#include "getbucketlistmessage.h" +#include "getbucketlistreply.h" #include <vespa/documentapi/messagebus/documentprotocol.h> -#include <vespa/documentapi/messagebus/messages/getbucketlistmessage.h> -#include <vespa/documentapi/messagebus/messages/getbucketlistreply.h> namespace documentapi { diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistmessage.h b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistmessage.h index 8d5fa587ffd..b8cf4f72293 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistmessage.h +++ b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistmessage.h @@ -1,8 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once +#include "documentmessage.h" #include <vespa/document/bucket/bucketid.h> -#include <vespa/documentapi/messagebus/messages/documentmessage.h> namespace documentapi { diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistreply.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistreply.cpp index 4ac6a91fd47..b1dadc9bf0e 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistreply.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistreply.cpp @@ -9,17 +9,13 @@ namespace documentapi { GetBucketListReply::BucketInfo::BucketInfo() : _bucket(), _bucketInformation() -{ - // empty -} +{ } GetBucketListReply::BucketInfo::BucketInfo(const document::BucketId &bucketId, const string &bucketInformation) : _bucket(bucketId), _bucketInformation(bucketInformation) -{ - // empty -} +{ } bool GetBucketListReply::BucketInfo::operator==(const GetBucketListReply::BucketInfo &rhs) const diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatemessage.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatemessage.cpp index 93c4f261fc5..fc465a61706 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatemessage.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatemessage.cpp @@ -1,24 +1,20 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + +#include "getbucketstatemessage.h" +#include "getbucketstatereply.h" #include <vespa/documentapi/messagebus/documentprotocol.h> -#include <vespa/documentapi/messagebus/messages/getbucketstatemessage.h> -#include <vespa/documentapi/messagebus/messages/getbucketstatereply.h> namespace documentapi { GetBucketStateMessage::GetBucketStateMessage() : DocumentMessage(), _bucket() -{ - // empty -} +{ } GetBucketStateMessage::GetBucketStateMessage(const document::BucketId &bucket) : DocumentMessage(), _bucket(bucket) -{ - // empty -} +{ } DocumentReply::UP GetBucketStateMessage::doCreateReply() const diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.cpp index f0ce18f66b7..c2b628c7d05 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.cpp @@ -1,16 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> +#include "getbucketstatereply.h" #include <vespa/documentapi/messagebus/documentprotocol.h> -#include <vespa/documentapi/messagebus/messages/getbucketstatereply.h> namespace documentapi { GetBucketStateReply::GetBucketStateReply() : DocumentReply(DocumentProtocol::REPLY_GETBUCKETSTATE), _state() -{ - // empty -} +{ } GetBucketStateReply::GetBucketStateReply(std::vector<DocumentState> &state) : DocumentReply(DocumentProtocol::REPLY_GETBUCKETSTATE), @@ -19,4 +16,6 @@ GetBucketStateReply::GetBucketStateReply(std::vector<DocumentState> &state) : _state.swap(state); } +GetBucketStateReply::~GetBucketStateReply() { } + } diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.h b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.h index 4de839d5e6c..ece8e4e69a1 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.h +++ b/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.h @@ -1,7 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/documentapi/messagebus/messages/documentreply.h> +#include "documentreply.h" #include "documentstate.h" namespace documentapi { @@ -23,6 +23,7 @@ public: * @param state The state to swap. */ GetBucketStateReply(std::vector<DocumentState> &state); + ~GetBucketStateReply(); /** * Sets the bucket state of this by swapping the content of the provided state object. diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/contentpolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/contentpolicy.cpp index 5a577ac450b..8d67c6fbe5c 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/contentpolicy.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/policies/contentpolicy.cpp @@ -1,6 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/documentapi/messagebus/policies/contentpolicy.h> +#include "contentpolicy.h" namespace documentapi { diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/externslobrokpolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/externslobrokpolicy.cpp index 57103b265a3..1e3a46f6370 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/externslobrokpolicy.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/policies/externslobrokpolicy.cpp @@ -1,9 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/documentapi/messagebus/policies/externslobrokpolicy.h> + +#include "externslobrokpolicy.h" #include <vespa/vespalib/text/stringtokenizer.h> #include <vespa/messagebus/routing/routingcontext.h> -#include <vespa/slobrok/cfg.h> using slobrok::api::IMirrorAPI; using slobrok::api::MirrorAPI; diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp index 399931dbbd5..f55967b1c09 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp @@ -1,8 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include "messagetypepolicy.h" #include <vespa/documentapi/messagebus/documentprotocol.h> -#include <vespa/messagebus/routing/routingcontext.h> +#include <vespa/vespalib/stllike/hash_map.hpp> using vespa::config::content::MessagetyperouteselectorpolicyConfig; diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h b/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h index 536be0044fe..aee4e1bc071 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h +++ b/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h @@ -30,8 +30,8 @@ private: typedef vespalib::PtrHolder<MessageTypeMap> MessageTypeHolder; typedef vespalib::PtrHolder<mbus::Route> RouteHolder; - MessageTypeHolder _map; - RouteHolder _defaultRoute; + MessageTypeHolder _map; + RouteHolder _defaultRoute; config::ConfigFetcher _fetcher; public: diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/storagepolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/storagepolicy.cpp index 39cdad6f46b..fba1d648d23 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/storagepolicy.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/policies/storagepolicy.cpp @@ -11,6 +11,8 @@ LOG_SETUP(".storagepolicy"); +using vespalib::make_string; + namespace documentapi { StoragePolicy::StoragePolicy(const string& param) @@ -207,9 +209,7 @@ StoragePolicy::doSelect(mbus::RoutingContext &context) } else { context.setError( mbus::ErrorCode::NO_ADDRESS_FOR_SERVICE, - vespalib::make_string( - "Could not resolve a distributor to send to in cluster %s", - _clusterName.c_str())); + make_string("Could not resolve a distributor to send to in cluster %s", _clusterName.c_str())); } } @@ -219,8 +219,7 @@ StoragePolicy::getRecipient(mbus::RoutingContext& context, int distributor) slobrok::api::IMirrorAPI::SpecList entries = lookup(context, createPattern(_clusterName, distributor)); if (!entries.empty()) { - return mbus::Hop::parse( - entries[random() % entries.size()].second + "/default"); + return mbus::Hop::parse(entries[random() % entries.size()].second + "/default"); } return mbus::Hop(); @@ -248,21 +247,17 @@ StoragePolicy::updateStateFromReply(WrongDistributionReply& wdr) new storage::lib::ClusterState(wdr.getSystemState())); if (_state.get() == 0 || newState->getVersion() >= _state->getVersion()) { if (_state.get()) { - wdr.getTrace().trace(1, vespalib::make_string( - "System state changed from version %u to %u", - _state->getVersion(), - newState->getVersion())); + wdr.getTrace().trace(1, make_string("System state changed from version %u to %u", + _state->getVersion(), newState->getVersion())); } else { - wdr.getTrace().trace(1, vespalib::make_string( - "System state set to version %u", newState->getVersion())); + wdr.getTrace().trace(1, make_string("System state set to version %u", newState->getVersion())); } _state = std::move(newState); } else { - wdr.getTrace().trace(1, vespalib::make_string( - "System state cleared because system state returned had version %d, while old state had version %d. New states should not have a lower version than the old.", - newState->getVersion(), - _state->getVersion())); + wdr.getTrace().trace(1, make_string("System state cleared because system state returned had version %d, " + "while old state had version %d. New states should not have a lower version than the old.", + newState->getVersion(), _state->getVersion())); _state.reset(); } } |