summaryrefslogtreecommitdiffstats
path: root/storageapi
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-12-03 19:49:12 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-12-12 02:55:45 +0100
commit925ec7eb8ee709c0d6722227104df6dc89f307f0 (patch)
treea65777dda4504597c2df50b77c13ee8814d869c7 /storageapi
parent5a9f64253ca71c0923304c033d121d5f27dd69ad (diff)
Avoid pulling in the config library everywhere.
Diffstat (limited to 'storageapi')
-rw-r--r--storageapi/src/vespa/storageapi/messageapi/bucketcommand.cpp4
-rw-r--r--storageapi/src/vespa/storageapi/messageapi/storagecommand.cpp4
-rw-r--r--storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp22
-rw-r--r--storageapi/src/vespa/storageapi/messageapi/storagemessage.h15
4 files changed, 24 insertions, 21 deletions
diff --git a/storageapi/src/vespa/storageapi/messageapi/bucketcommand.cpp b/storageapi/src/vespa/storageapi/messageapi/bucketcommand.cpp
index 465833a7abf..d27e971006f 100644
--- a/storageapi/src/vespa/storageapi/messageapi/bucketcommand.cpp
+++ b/storageapi/src/vespa/storageapi/messageapi/bucketcommand.cpp
@@ -1,7 +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 <vespa/storageapi/messageapi/bucketcommand.h>
+#include "bucketcommand.h"
+#include <ostream>
namespace storage {
namespace api {
diff --git a/storageapi/src/vespa/storageapi/messageapi/storagecommand.cpp b/storageapi/src/vespa/storageapi/messageapi/storagecommand.cpp
index 65027712905..3248142d464 100644
--- a/storageapi/src/vespa/storageapi/messageapi/storagecommand.cpp
+++ b/storageapi/src/vespa/storageapi/messageapi/storagecommand.cpp
@@ -1,9 +1,9 @@
// 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 "storagecommand.h"
#include <limits>
-#include <vespa/storageapi/messageapi/storagecommand.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <ostream>
namespace storage {
namespace api {
diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp
index 1c1342dc7f3..536135c48e6 100644
--- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp
+++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp
@@ -166,7 +166,8 @@ const MessageType MessageType::SETBUCKETSTATE_REPLY(
SETBUCKETSTATE_REPLY_ID,
&MessageType::SETBUCKETSTATE);
-const MessageType& MessageType::get(Id id)
+const MessageType&
+MessageType::MessageType::get(Id id)
{
std::map<Id, MessageType*>::const_iterator it = _codes.find(id);
if (it == _codes.end()) {
@@ -177,6 +178,17 @@ const MessageType& MessageType::get(Id id)
return *it->second;
}
+void
+MessageType::print(std::ostream& out, bool verbose, const std::string& indent) const
+{
+ (void) verbose; (void) indent;
+ out << "MessageType(" << _id << ", " << _name;
+ if (_replyOf) {
+ out << ", reply of " << _replyOf->getName();
+ }
+ out << ")";
+}
+
StorageMessageAddress::StorageMessageAddress(const mbus::Route& route)
: _route(route),
_retryEnabled(false),
@@ -184,12 +196,14 @@ StorageMessageAddress::StorageMessageAddress(const mbus::Route& route)
_cluster(""),
_type(0),
_index(0xFFFF)
-{
+{ }
+
+std::ostream & operator << (std::ostream & os, const StorageMessageAddress & addr) {
+ return os << addr.toString();
}
static vespalib::string
-createAddress(const vespalib::stringref & cluster, const lib::NodeType& type,
- uint16_t index)
+createAddress(const vespalib::stringref & cluster, const lib::NodeType& type, uint16_t index)
{
vespalib::asciistream os;
os << STORAGEADDRESS_PREFIX << cluster << '/' << type.toString() << '/' << index << "/default";
diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h
index 27d87dd44ca..6d16a6546f9 100644
--- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h
+++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h
@@ -279,15 +279,7 @@ public:
bool operator==(const MessageType& type) const { return (_id == type._id); }
bool operator!=(const MessageType& type) const { return (_id != type._id); }
- void print(std::ostream& out, bool verbose, const std::string& indent) const
- {
- (void) verbose; (void) indent;
- out << "MessageType(" << _id << ", " << _name;
- if (_replyOf) {
- out << ", reply of " << _replyOf->getName();
- }
- out << ")";
- }
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
};
/**
@@ -328,10 +320,7 @@ public:
bool operator==(const StorageMessageAddress& other) const;
vespalib::string toString() const;
- friend std::ostream & operator <<
- (std::ostream & os, const StorageMessageAddress & addr) {
- return os << addr.toString();
- }
+ friend std::ostream & operator << (std::ostream & os, const StorageMessageAddress & addr);
private:
void print(vespalib::asciistream & out) const;