diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-25 15:02:59 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-25 15:02:59 +0200 |
commit | 4c347b07d1891763316c46234897591224fd70e8 (patch) | |
tree | e11039e60137667eb11fa339c60285afbd7ddcaa /storageapi | |
parent | e18aacbe5755d1cb16b7f4651cec0b91085cb7d9 (diff) |
- No virtual on override.
- Optimize includes.
Diffstat (limited to 'storageapi')
32 files changed, 218 insertions, 448 deletions
diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp index bc71429032e..ed59b49ff04 100644 --- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp +++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp @@ -1,11 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/document/base/testdocman.h> -#include <vespa/document/document.h> -#include <vespa/document/repo/documenttyperepo.h> -#include <vespa/document/update/fieldpathupdates.h> -#include <iomanip> -#include <sstream> #include <vespa/storageapi/message/persistence.h> #include <vespa/storageapi/message/bucket.h> #include <vespa/storageapi/message/bucketsplitting.h> @@ -16,10 +10,16 @@ #include <vespa/storageapi/mbusprot/storageprotocol.h> #include <vespa/storageapi/mbusprot/storagecommand.h> #include <vespa/storageapi/mbusprot/storagereply.h> +#include <vespa/storageapi/message/visitor.h> +#include <vespa/document/base/testdocman.h> +#include <vespa/document/document.h> +#include <vespa/document/repo/documenttyperepo.h> +#include <vespa/document/update/fieldpathupdates.h> #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/vespalib/util/growablebytebuffer.h> -#include <vespa/storageapi/message/visitor.h> #include <vespa/vespalib/objects/nbostream.h> +#include <iomanip> +#include <sstream> using std::shared_ptr; using document::ByteBuffer; @@ -837,8 +837,7 @@ namespace { api::StorageReply::UP makeReply() override; - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override - { + void print(std::ostream& out, bool verbose, const std::string& indent) const override { out << "MyCommand()"; if (verbose) { out << " : "; @@ -850,8 +849,7 @@ namespace { struct MyReply : public api::InternalReply { MyReply(const MyCommand& cmd) : InternalReply(102, cmd) {} - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override - { + void print(std::ostream& out, bool verbose, const std::string& indent) const override { out << "MyReply()"; if (verbose) { out << " : "; diff --git a/storageapi/src/tests/testrunner.cpp b/storageapi/src/tests/testrunner.cpp index 9a07796a3f4..05fb3184c04 100644 --- a/storageapi/src/tests/testrunner.cpp +++ b/storageapi/src/tests/testrunner.cpp @@ -1,12 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> #include <vespa/vdstestlib/cppunit/cppunittestrunner.h> +#include <vespa/log/log.h> LOG_SETUP("storageapicppunittestrunner"); int -main(int argc, char **argv) +main(int argc, const char *argv[]) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/storageapi/src/vespa/storageapi/buckets/bucketinfo.h b/storageapi/src/vespa/storageapi/buckets/bucketinfo.h index 692cc171250..17ad75aa851 100644 --- a/storageapi/src/vespa/storageapi/buckets/bucketinfo.h +++ b/storageapi/src/vespa/storageapi/buckets/bucketinfo.h @@ -13,7 +13,6 @@ #pragma once -#include <stdint.h> #include <vespa/storageapi/defs.h> #include <vespa/vespalib/util/printable.h> #include <vespa/vespalib/util/xmlserializable.h> @@ -77,13 +76,10 @@ public: bool empty() const { return _metaCount == 0 && _usedFileSize == 0 && _checksum == 0; } - - void print(std::ostream& out, bool verbose, - const std::string& indent) const override - { + void print(std::ostream& out, bool verbose, const std::string& indent) const override { vespalib::AsciiPrintable::print(out, verbose, indent); } - virtual void print(vespalib::asciistream&, const PrintProperties&) const override; + void print(vespalib::asciistream&, const PrintProperties&) const override; void printXml(vespalib::XmlOutputStream&) const; }; diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h index 9fa125b1159..f44de9700b7 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.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/storageapi/mbusprot/protocolserialization.h> +#include "protocolserialization.h" namespace storage { namespace mbusprot { @@ -11,29 +11,29 @@ public: ProtocolSerialization4_2(const document::DocumentTypeRepo::SP&); protected: - virtual void onEncode(GBBuf&, const api::GetCommand&) const override; - virtual void onEncode(GBBuf&, const api::RemoveCommand&) const override; - virtual void onEncode(GBBuf&, const api::RevertCommand&) const override; - virtual void onEncode(GBBuf&, const api::CreateBucketCommand&) const override; - virtual void onEncode(GBBuf&, const api::MergeBucketCommand&) const override; - virtual void onEncode(GBBuf&, const api::GetBucketDiffCommand&) const override; - virtual void onEncode(GBBuf&, const api::ApplyBucketDiffCommand&) const override; - virtual void onEncode(GBBuf&, const api::RequestBucketInfoReply&) const override; - virtual void onEncode(GBBuf&, const api::NotifyBucketChangeCommand&) const override; - virtual void onEncode(GBBuf&, const api::NotifyBucketChangeReply&) const override; - virtual void onEncode(GBBuf&, const api::SplitBucketCommand&) const override; - virtual void onEncode(GBBuf&, const api::MultiOperationCommand&) const override; - virtual void onEncode(GBBuf&, const api::CreateVisitorCommand&) const override; - virtual void onEncode(GBBuf&, const api::DestroyVisitorCommand&) const override; - virtual void onEncode(GBBuf&, const api::DestroyVisitorReply&) const override; - virtual void onEncode(GBBuf&, const api::RemoveLocationCommand&) const override; - virtual void onEncode(GBBuf&, const api::RemoveLocationReply&) const override; + void onEncode(GBBuf&, const api::GetCommand&) const override; + void onEncode(GBBuf&, const api::RemoveCommand&) const override; + void onEncode(GBBuf&, const api::RevertCommand&) const override; + void onEncode(GBBuf&, const api::CreateBucketCommand&) const override; + void onEncode(GBBuf&, const api::MergeBucketCommand&) const override; + void onEncode(GBBuf&, const api::GetBucketDiffCommand&) const override; + void onEncode(GBBuf&, const api::ApplyBucketDiffCommand&) const override; + void onEncode(GBBuf&, const api::RequestBucketInfoReply&) const override; + void onEncode(GBBuf&, const api::NotifyBucketChangeCommand&) const override; + void onEncode(GBBuf&, const api::NotifyBucketChangeReply&) const override; + void onEncode(GBBuf&, const api::SplitBucketCommand&) const override; + void onEncode(GBBuf&, const api::MultiOperationCommand&) const override; + void onEncode(GBBuf&, const api::CreateVisitorCommand&) const override; + void onEncode(GBBuf&, const api::DestroyVisitorCommand&) const override; + void onEncode(GBBuf&, const api::DestroyVisitorReply&) const override; + void onEncode(GBBuf&, const api::RemoveLocationCommand&) const override; + void onEncode(GBBuf&, const api::RemoveLocationReply&) const override; // Not supported on 4.2, but implemented here for simplicity. - virtual void onEncode(GBBuf&, const api::BatchPutRemoveCommand&) const override; - virtual void onEncode(GBBuf&, const api::BatchPutRemoveReply&) const override; - virtual void onEncode(GBBuf&, const api::SetBucketStateCommand&) const override; - virtual void onEncode(GBBuf&, const api::SetBucketStateReply&) const override; + void onEncode(GBBuf&, const api::BatchPutRemoveCommand&) const override; + void onEncode(GBBuf&, const api::BatchPutRemoveReply&) const override; + void onEncode(GBBuf&, const api::SetBucketStateCommand&) const override; + void onEncode(GBBuf&, const api::SetBucketStateReply&) const override; virtual void onEncodeBucketInfoCommand(GBBuf&, const api::BucketInfoCommand&) const; virtual void onEncodeBucketInfoReply(GBBuf&, const api::BucketInfoReply&) const = 0; @@ -42,29 +42,29 @@ protected: virtual void onEncodeDiffEntry(GBBuf&, const api::GetBucketDiffCommand::Entry&) const; virtual void onEncode(GBBuf&, const api::ReturnCode&) const; - virtual SCmd::UP onDecodeGetCommand(BBuf&) const override; - virtual SCmd::UP onDecodeRemoveCommand(BBuf&) const override; - virtual SCmd::UP onDecodeRevertCommand(BBuf&) const override; - virtual SCmd::UP onDecodeCreateBucketCommand(BBuf&) const override; - virtual SCmd::UP onDecodeMergeBucketCommand(BBuf&) const override; - virtual SCmd::UP onDecodeGetBucketDiffCommand(BBuf&) const override; - virtual SCmd::UP onDecodeApplyBucketDiffCommand(BBuf&) const override; - virtual SRep::UP onDecodeRequestBucketInfoReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeNotifyBucketChangeCommand(BBuf&) const override; - virtual SRep::UP onDecodeNotifyBucketChangeReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeSplitBucketCommand(BBuf&) const override; - virtual SCmd::UP onDecodeSetBucketStateCommand(BBuf&) const override; - virtual SRep::UP onDecodeSetBucketStateReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeMultiOperationCommand(BBuf&) const override; - virtual SCmd::UP onDecodeCreateVisitorCommand(BBuf&) const override; - virtual SCmd::UP onDecodeDestroyVisitorCommand(BBuf&) const override; - virtual SRep::UP onDecodeDestroyVisitorReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeRemoveLocationCommand(BBuf&) const override; - virtual SRep::UP onDecodeRemoveLocationReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeGetCommand(BBuf&) const override; + SCmd::UP onDecodeRemoveCommand(BBuf&) const override; + SCmd::UP onDecodeRevertCommand(BBuf&) const override; + SCmd::UP onDecodeCreateBucketCommand(BBuf&) const override; + SCmd::UP onDecodeMergeBucketCommand(BBuf&) const override; + SCmd::UP onDecodeGetBucketDiffCommand(BBuf&) const override; + SCmd::UP onDecodeApplyBucketDiffCommand(BBuf&) const override; + SRep::UP onDecodeRequestBucketInfoReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeNotifyBucketChangeCommand(BBuf&) const override; + SRep::UP onDecodeNotifyBucketChangeReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeSplitBucketCommand(BBuf&) const override; + SCmd::UP onDecodeSetBucketStateCommand(BBuf&) const override; + SRep::UP onDecodeSetBucketStateReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeMultiOperationCommand(BBuf&) const override; + SCmd::UP onDecodeCreateVisitorCommand(BBuf&) const override; + SCmd::UP onDecodeDestroyVisitorCommand(BBuf&) const override; + SRep::UP onDecodeDestroyVisitorReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeRemoveLocationCommand(BBuf&) const override; + SRep::UP onDecodeRemoveLocationReply(const SCmd&, BBuf&) const override; // Not supported on 4.2, but implemented here for simplicity. - virtual SCmd::UP onDecodeBatchPutRemoveCommand(BBuf&) const override; - virtual SRep::UP onDecodeBatchPutRemoveReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeBatchPutRemoveCommand(BBuf&) const override; + SRep::UP onDecodeBatchPutRemoveReply(const SCmd&, BBuf&) const override; virtual void onDecodeBucketInfoCommand(BBuf&, api::BucketInfoCommand&) const; virtual void onDecodeBucketInfoReply(BBuf&, api::BucketInfoReply&) const = 0; diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.h index c5a26987a08..826700584da 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.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/storageapi/mbusprot/protocolserialization4_2.h> +#include "protocolserialization4_2.h" #include <vespa/documentapi/loadtypes/loadtypeset.h> namespace storage { @@ -15,66 +15,64 @@ public: ProtocolSerialization5_0(const document::DocumentTypeRepo::SP&, const documentapi::LoadTypeSet& loadTypes); - virtual api::BucketInfo getBucketInfo(document::ByteBuffer& buf) const override; - virtual void putBucketInfo(const api::BucketInfo& info, - vespalib::GrowableByteBuffer& buf) const override; + api::BucketInfo getBucketInfo(document::ByteBuffer& buf) const override; + void putBucketInfo(const api::BucketInfo& info, vespalib::GrowableByteBuffer& buf) const override; - virtual void onEncode(GBBuf&, const api::PutCommand&) const override; - virtual void onEncode(GBBuf&, const api::PutReply&) const override; - virtual void onEncode(GBBuf&, const api::UpdateCommand&) const override; - virtual void onEncode(GBBuf&, const api::UpdateReply&) const override; - virtual void onEncode(GBBuf&, const api::GetReply&) const override; - virtual void onEncode(GBBuf&, const api::RemoveReply&) const override; - virtual void onEncode(GBBuf&, const api::RevertReply&) const override; - virtual void onEncode(GBBuf&, const api::CreateBucketReply&) const override; - virtual void onEncode(GBBuf&, const api::DeleteBucketCommand&) const override; - virtual void onEncode(GBBuf&, const api::DeleteBucketReply&) const override; - virtual void onEncode(GBBuf&, const api::MergeBucketCommand&) const override; - virtual void onEncode(GBBuf&, const api::MergeBucketReply&) const override; - virtual void onEncode(GBBuf&, const api::GetBucketDiffReply&) const override; - virtual void onEncode(GBBuf&, const api::ApplyBucketDiffReply&) const override; - virtual void onEncode(GBBuf&, const api::SplitBucketReply&) const override; - virtual void onEncode(GBBuf&, const api::MultiOperationReply&) const override; - virtual void onEncode(GBBuf&, const api::JoinBucketsCommand&) const override; - virtual void onEncode(GBBuf&, const api::JoinBucketsReply&) const override; - virtual void onEncode(GBBuf&, const api::RequestBucketInfoCommand&) const override; + void onEncode(GBBuf&, const api::PutCommand&) const override; + void onEncode(GBBuf&, const api::PutReply&) const override; + void onEncode(GBBuf&, const api::UpdateCommand&) const override; + void onEncode(GBBuf&, const api::UpdateReply&) const override; + void onEncode(GBBuf&, const api::GetReply&) const override; + void onEncode(GBBuf&, const api::RemoveReply&) const override; + void onEncode(GBBuf&, const api::RevertReply&) const override; + void onEncode(GBBuf&, const api::CreateBucketReply&) const override; + void onEncode(GBBuf&, const api::DeleteBucketCommand&) const override; + void onEncode(GBBuf&, const api::DeleteBucketReply&) const override; + void onEncode(GBBuf&, const api::MergeBucketCommand&) const override; + void onEncode(GBBuf&, const api::MergeBucketReply&) const override; + void onEncode(GBBuf&, const api::GetBucketDiffReply&) const override; + void onEncode(GBBuf&, const api::ApplyBucketDiffReply&) const override; + void onEncode(GBBuf&, const api::SplitBucketReply&) const override; + void onEncode(GBBuf&, const api::MultiOperationReply&) const override; + void onEncode(GBBuf&, const api::JoinBucketsCommand&) const override; + void onEncode(GBBuf&, const api::JoinBucketsReply&) const override; + void onEncode(GBBuf&, const api::RequestBucketInfoCommand&) const override; - virtual void onEncodeBucketInfoReply(GBBuf&, const api::BucketInfoReply&) const override; + void onEncodeBucketInfoReply(GBBuf&, const api::BucketInfoReply&) const override; virtual void onEncodeBucketReply(GBBuf&, const api::BucketReply&) const; - virtual void onEncode(GBBuf&, const api::CreateVisitorCommand& msg) const override; - virtual void onEncode(GBBuf&, const api::CreateVisitorReply& msg) const override; - virtual void onEncodeCommand(GBBuf&, const api::StorageCommand&) const override; - virtual void onEncodeReply(GBBuf&, const api::StorageReply&) const override; + void onEncode(GBBuf&, const api::CreateVisitorCommand& msg) const override; + void onEncode(GBBuf&, const api::CreateVisitorReply& msg) const override; + void onEncodeCommand(GBBuf&, const api::StorageCommand&) const override; + void onEncodeReply(GBBuf&, const api::StorageReply&) const override; - virtual SCmd::UP onDecodePutCommand(BBuf&) const override; - virtual SRep::UP onDecodePutReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeUpdateCommand(BBuf&) const override; - virtual SRep::UP onDecodeUpdateReply(const SCmd&, BBuf&) const override; - virtual SRep::UP onDecodeGetReply(const SCmd&, BBuf&) const override; - virtual SRep::UP onDecodeRemoveReply(const SCmd&, BBuf&) const override; - virtual SRep::UP onDecodeRevertReply(const SCmd&, BBuf&) const override; - virtual SRep::UP onDecodeCreateBucketReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeDeleteBucketCommand(BBuf&) const override; - virtual SRep::UP onDecodeDeleteBucketReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeMergeBucketCommand(BBuf&) const override; - virtual SRep::UP onDecodeMergeBucketReply(const SCmd&, BBuf&) const override; - virtual SRep::UP onDecodeGetBucketDiffReply(const SCmd&, BBuf&) const override; - virtual SRep::UP onDecodeApplyBucketDiffReply(const SCmd&, BBuf&) const override; - virtual SRep::UP onDecodeSplitBucketReply(const SCmd&, BBuf&) const override; - virtual SRep::UP onDecodeMultiOperationReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeJoinBucketsCommand(BBuf& buf) const override; - virtual SRep::UP onDecodeJoinBucketsReply(const SCmd& cmd, BBuf& buf) const override; - virtual SCmd::UP onDecodeCreateVisitorCommand(BBuf&) const override; - virtual SCmd::UP onDecodeRequestBucketInfoCommand(BBuf& buf) const override; + SCmd::UP onDecodePutCommand(BBuf&) const override; + SRep::UP onDecodePutReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeUpdateCommand(BBuf&) const override; + SRep::UP onDecodeUpdateReply(const SCmd&, BBuf&) const override; + SRep::UP onDecodeGetReply(const SCmd&, BBuf&) const override; + SRep::UP onDecodeRemoveReply(const SCmd&, BBuf&) const override; + SRep::UP onDecodeRevertReply(const SCmd&, BBuf&) const override; + SRep::UP onDecodeCreateBucketReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeDeleteBucketCommand(BBuf&) const override; + SRep::UP onDecodeDeleteBucketReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeMergeBucketCommand(BBuf&) const override; + SRep::UP onDecodeMergeBucketReply(const SCmd&, BBuf&) const override; + SRep::UP onDecodeGetBucketDiffReply(const SCmd&, BBuf&) const override; + SRep::UP onDecodeApplyBucketDiffReply(const SCmd&, BBuf&) const override; + SRep::UP onDecodeSplitBucketReply(const SCmd&, BBuf&) const override; + SRep::UP onDecodeMultiOperationReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeJoinBucketsCommand(BBuf& buf) const override; + SRep::UP onDecodeJoinBucketsReply(const SCmd& cmd, BBuf& buf) const override; + SCmd::UP onDecodeCreateVisitorCommand(BBuf&) const override; + SCmd::UP onDecodeRequestBucketInfoCommand(BBuf& buf) const override; - virtual void onDecodeBucketInfoReply(BBuf&, api::BucketInfoReply&) const override; + void onDecodeBucketInfoReply(BBuf&, api::BucketInfoReply&) const override; virtual void onDecodeBucketReply(BBuf&, api::BucketReply&) const; - virtual SRep::UP onDecodeCreateVisitorReply(const SCmd& cmd, BBuf& buf) const override; - virtual void onDecodeCommand(BBuf& buf, api::StorageCommand& msg) const override; - virtual void onDecodeReply(BBuf&, api::StorageReply&) const override; + SRep::UP onDecodeCreateVisitorReply(const SCmd& cmd, BBuf& buf) const override; + void onDecodeCommand(BBuf& buf, api::StorageCommand& msg) const override; + void onDecodeReply(BBuf&, api::StorageReply&) const override; }; } // mbusprot } // storage - diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.h index 393596046c2..92e559f5de9 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.h @@ -1,8 +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/storageapi/mbusprot/protocolserialization5_0.h> -#include <vespa/documentapi/loadtypes/loadtypeset.h> +#include "protocolserialization5_0.h" namespace storage { namespace mbusprot { @@ -17,24 +16,22 @@ public: ProtocolSerialization5_1(const document::DocumentTypeRepo::SP&, const documentapi::LoadTypeSet& loadTypes); - virtual api::BucketInfo getBucketInfo(document::ByteBuffer& buf) const override; - virtual void putBucketInfo(const api::BucketInfo& info, - vespalib::GrowableByteBuffer& buf) const override; + api::BucketInfo getBucketInfo(document::ByteBuffer& buf) const override; + void putBucketInfo(const api::BucketInfo& info, vespalib::GrowableByteBuffer& buf) const override; protected: - virtual void onEncode(GBBuf&, const api::SetBucketStateCommand&) const override; - virtual void onEncode(GBBuf&, const api::SetBucketStateReply&) const override; - virtual void onEncode(GBBuf&, const api::GetCommand&) const override; - virtual void onEncode(GBBuf&, const api::CreateVisitorCommand&) const override; - virtual void onEncode(GBBuf&, const api::CreateBucketCommand&) const override; - - virtual SCmd::UP onDecodeSetBucketStateCommand(BBuf&) const override; - virtual SRep::UP onDecodeSetBucketStateReply(const SCmd&, BBuf&) const override; - virtual SCmd::UP onDecodeGetCommand(BBuf&) const override; - virtual SCmd::UP onDecodeCreateVisitorCommand(BBuf&) const override; - virtual SCmd::UP onDecodeCreateBucketCommand(BBuf&) const override; + void onEncode(GBBuf&, const api::SetBucketStateCommand&) const override; + void onEncode(GBBuf&, const api::SetBucketStateReply&) const override; + void onEncode(GBBuf&, const api::GetCommand&) const override; + void onEncode(GBBuf&, const api::CreateVisitorCommand&) const override; + void onEncode(GBBuf&, const api::CreateBucketCommand&) const override; + + SCmd::UP onDecodeSetBucketStateCommand(BBuf&) const override; + SRep::UP onDecodeSetBucketStateReply(const SCmd&, BBuf&) const override; + SCmd::UP onDecodeGetCommand(BBuf&) const override; + SCmd::UP onDecodeCreateVisitorCommand(BBuf&) const override; + SCmd::UP onDecodeCreateBucketCommand(BBuf&) const override; }; } // mbusprot } // storage - diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_2.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_2.h index 35af05d192b..552d9ee3508 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_2.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_2.h @@ -3,9 +3,8 @@ #pragma once +#include "protocolserialization5_1.h" #include <vespa/vespalib/util/growablebytebuffer.h> -#include <vespa/documentapi/loadtypes/loadtypeset.h> -#include <vespa/storageapi/mbusprot/protocolserialization5_1.h> #include <vespa/storageapi/message/persistence.h> namespace storage { @@ -14,20 +13,19 @@ namespace mbusprot { class ProtocolSerialization5_2 : public ProtocolSerialization5_1 { public: - ProtocolSerialization5_2( - const document::DocumentTypeRepo::SP& repo, - const documentapi::LoadTypeSet & loadTypes) + ProtocolSerialization5_2(const document::DocumentTypeRepo::SP& repo, + const documentapi::LoadTypeSet & loadTypes) : ProtocolSerialization5_1(repo, loadTypes) - {} + {} protected: - virtual void onEncode(GBBuf &, const api::PutCommand &) const override; - virtual void onEncode(GBBuf &, const api::RemoveCommand &) const override; - virtual void onEncode(GBBuf &, const api::UpdateCommand &) const override; + void onEncode(GBBuf &, const api::PutCommand &) const override; + void onEncode(GBBuf &, const api::RemoveCommand &) const override; + void onEncode(GBBuf &, const api::UpdateCommand &) const override; - virtual SCmd::UP onDecodePutCommand(BBuf &) const override; - virtual SCmd::UP onDecodeRemoveCommand(BBuf &) const override; - virtual SCmd::UP onDecodeUpdateCommand(BBuf &) const override; + SCmd::UP onDecodePutCommand(BBuf &) const override; + SCmd::UP onDecodeRemoveCommand(BBuf &) const override; + SCmd::UP onDecodeUpdateCommand(BBuf &) const override; static void decodeTasCondition(api::StorageCommand & cmd, BBuf & buf); static void encodeTasCondition(GBBuf & buf, const api::StorageCommand & cmd); diff --git a/storageapi/src/vespa/storageapi/mbusprot/storagecommand.h b/storageapi/src/vespa/storageapi/mbusprot/storagecommand.h index 8549df6077f..d6d95e2b1fe 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storagecommand.h +++ b/storageapi/src/vespa/storageapi/mbusprot/storagecommand.h @@ -1,9 +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 "storagemessage.h" +#include "storageprotocol.h" #include <vespa/messagebus/message.h> -#include <vespa/storageapi/mbusprot/storagemessage.h> -#include <vespa/storageapi/mbusprot/storageprotocol.h> #include <vespa/storageapi/messageapi/storagecommand.h> namespace storage { @@ -16,15 +16,13 @@ public: StorageCommand(const storage::api::StorageCommand::SP&); const mbus::string & getProtocol() const override { return StorageProtocol::NAME; } - uint32_t getType() const override { return _cmd->getType().getId(); } - const api::StorageCommand::SP& getCommand() { return _cmd; } api::StorageCommand::CSP getCommand() const { return _cmd; } - virtual api::StorageMessage::SP getInternalMessage() override { return _cmd; } - virtual api::StorageMessage::CSP getInternalMessage() const override { return _cmd; } + api::StorageMessage::SP getInternalMessage() override { return _cmd; } + api::StorageMessage::CSP getInternalMessage() const override { return _cmd; } - virtual uint8_t priority() const override { + uint8_t priority() const override { return ((getInternalMessage()->getPriority()) / 255) * 16; } @@ -34,4 +32,3 @@ private: } // mbusprot } // storage - diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h index 8c10ab1dfe1..e1bcff1b27c 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h @@ -1,12 +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 "protocolserialization5_2.h" #include <vespa/messagebus/iprotocol.h> -#include <string> -#include <vespa/storageapi/mbusprot/protocolserialization5_0.h> -#include <vespa/storageapi/mbusprot/protocolserialization5_1.h> -#include <vespa/storageapi/mbusprot/protocolserialization5_2.h> -#include <vespa/documentapi/loadtypes/loadtypeset.h> namespace storage { namespace mbusprot { @@ -21,17 +17,10 @@ public: StorageProtocol(const document::DocumentTypeRepo::SP, const documentapi::LoadTypeSet& loadTypes); - // Implements IProtocol. const mbus::string& getName() const override { return NAME; } - - // Implements IProtocol. mbus::IRoutingPolicy::UP createPolicy(const mbus::string& name, const mbus::string& param) const override; - - // Implements IProtocol. mbus::Blob encode(const vespalib::Version&, const mbus::Routable&) const override; - - // Implements IProtocol. mbus::Routable::UP decode(const vespalib::Version&, mbus::BlobRef) const override; private: @@ -42,6 +31,3 @@ private: } // mbusprot } // storage - - - diff --git a/storageapi/src/vespa/storageapi/mbusprot/storagereply.h b/storageapi/src/vespa/storageapi/mbusprot/storagereply.h index aa7c827a32a..2e7dafc505f 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storagereply.h +++ b/storageapi/src/vespa/storageapi/mbusprot/storagereply.h @@ -1,9 +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 "storagemessage.h" +#include "storageprotocol.h" #include <vespa/messagebus/reply.h> -#include <vespa/storageapi/mbusprot/storagemessage.h> -#include <vespa/storageapi/mbusprot/storageprotocol.h> #include <vespa/storageapi/messageapi/storagereply.h> namespace storage { @@ -20,21 +20,19 @@ public: StorageReply(const mbus::BlobRef& data, const ProtocolSerialization&); StorageReply(const api::StorageReply::SP& reply); - virtual ~StorageReply(); + ~StorageReply(); - virtual const mbus::string& getProtocol() const override - { return StorageProtocol::NAME; } + const mbus::string& getProtocol() const override { return StorageProtocol::NAME; } uint32_t getType() const override { return _mbusType; } const api::StorageReply::SP& getReply() { deserialize(); return _reply; } api::StorageReply::CSP getReply() const { deserialize(); return _reply; } - virtual api::StorageMessage::SP getInternalMessage() override - { deserialize(); return _reply; } - virtual api::StorageMessage::CSP getInternalMessage() const override - { deserialize(); return _reply; } - virtual uint8_t priority() const override { + api::StorageMessage::SP getInternalMessage() override { deserialize(); return _reply; } + api::StorageMessage::CSP getInternalMessage() const override { deserialize(); return _reply; } + + uint8_t priority() const override { if (_reply.get()) { return _reply->getPriority(); } @@ -48,4 +46,3 @@ private: } // mbusprot } // storage - diff --git a/storageapi/src/vespa/storageapi/message/batch.h b/storageapi/src/vespa/storageapi/message/batch.h index 85e7a8df9ee..c2bb8b816b8 100644 --- a/storageapi/src/vespa/storageapi/message/batch.h +++ b/storageapi/src/vespa/storageapi/message/batch.h @@ -156,14 +156,13 @@ public: @return Returns a list of the updates to be performed. */ const UpdateList& getUpdates() const { return _updates; }; - void print(std::ostream& out, bool verbose, const std::string& indent) const override; /** Returns a bucket id suitable for routing this message. */ document::BucketId getBucketId() const override { return _bucketId; } - virtual bool hasSingleBucketId() const override { return true; } + bool hasSingleBucketId() const override { return true; } DECLARE_STORAGECOMMAND(BatchDocumentUpdateCommand, onBatchDocumentUpdate) @@ -183,18 +182,12 @@ class BatchDocumentUpdateReply : public StorageReply { std::vector<bool> _documentsNotFound; public: explicit BatchDocumentUpdateReply(const BatchDocumentUpdateCommand&); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - const std::vector<bool>& getDocumentsNotFound() const { return _documentsNotFound; } std::vector<bool>& getDocumentsNotFound() { return _documentsNotFound; } DECLARE_STORAGEREPLY(BatchDocumentUpdateReply, onBatchDocumentUpdateReply) }; - - } } - - diff --git a/storageapi/src/vespa/storageapi/message/bucket.h b/storageapi/src/vespa/storageapi/message/bucket.h index c78591eca61..31948852840 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.h +++ b/storageapi/src/vespa/storageapi/message/bucket.h @@ -7,14 +7,14 @@ #pragma once -#include <vespa/document/base/globalid.h> -#include <vespa/vdslib/state/clusterstate.h> -#include <vespa/storageapi/defs.h> #include <vespa/storageapi/messageapi/bucketcommand.h> #include <vespa/storageapi/messageapi/bucketreply.h> #include <vespa/storageapi/messageapi/bucketinfocommand.h> #include <vespa/storageapi/messageapi/bucketinforeply.h> #include <vespa/storageapi/messageapi/maintenancecommand.h> +#include <vespa/document/base/globalid.h> +#include <vespa/vdslib/state/clusterstate.h> +#include <vespa/storageapi/defs.h> namespace document { class DocumentTypeRepo; } @@ -32,12 +32,9 @@ class CreateBucketCommand : public MaintenanceCommand { public: explicit CreateBucketCommand(const document::BucketId& id); - void setActive(bool active) { _active = active; } bool getActive() const { return _active; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(CreateBucketCommand, onCreateBucket) }; @@ -50,9 +47,7 @@ public: class CreateBucketReply : public BucketInfoReply { public: explicit CreateBucketReply(const CreateBucketCommand& cmd); - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGEREPLY(CreateBucketReply, onCreateBucketReply); }; @@ -69,9 +64,7 @@ public: const BucketInfo& getBucketInfo() const { return _info; } void setBucketInfo(const BucketInfo& info) { _info = info; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(DeleteBucketCommand, onDeleteBucket) }; @@ -84,9 +77,7 @@ public: class DeleteBucketReply : public BucketInfoReply { public: explicit DeleteBucketReply(const DeleteBucketCommand& cmd); - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGEREPLY(DeleteBucketReply, onDeleteBucketReply) }; @@ -136,14 +127,10 @@ public: const std::vector<Node>& getNodes() const { return _nodes; } Timestamp getMaxTimestamp() const { return _maxTimestamp; } const std::vector<uint16_t>& getChain() const { return _chain; } - uint32_t getClusterStateVersion() const { return _clusterStateVersion; } - void setClusterStateVersion(uint32_t version) { _clusterStateVersion = version; } void setChain(const std::vector<uint16_t>& chain) { _chain = chain; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(MergeBucketCommand, onMergeBucket) }; @@ -173,8 +160,7 @@ public: Timestamp getMaxTimestamp() const { return _maxTimestamp; } const std::vector<uint16_t>& getChain() const { return _chain; } uint32_t getClusterStateVersion() const { return _clusterStateVersion; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGEREPLY(MergeBucketReply, onMergeBucketReply) }; @@ -198,8 +184,7 @@ public: uint16_t _hasMask; Entry(); - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; bool operator==(const Entry&) const; bool operator<(const Entry& e) const { return (_timestamp < e._timestamp); } @@ -219,7 +204,7 @@ public: const std::vector<Entry>& getDiff() const { return _diff; } std::vector<Entry>& getDiff() { return _diff; } - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(GetBucketDiffCommand, onGetBucketDiff) }; @@ -247,8 +232,7 @@ public: Timestamp getMaxTimestamp() const { return _maxTimestamp; } const std::vector<Entry>& getDiff() const { return _diff; } std::vector<Entry>& getDiff() { return _diff; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGEREPLY(GetBucketDiffReply, onGetBucketDiffReply) }; @@ -274,8 +258,7 @@ public: Entry(const GetBucketDiffCommand::Entry&); bool filled() const; - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; bool operator==(const Entry&) const; }; private: @@ -296,8 +279,7 @@ public: const std::vector<Entry>& getDiff() const { return _diff; } std::vector<Entry>& getDiff() { return _diff; } uint32_t getMaxBufferSize() const { return _maxBufferSize; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(ApplyBucketDiffCommand, onApplyBucketDiff) }; @@ -326,7 +308,7 @@ public: std::vector<Entry>& getDiff() { return _diff; } uint32_t getMaxBufferSize() const { return _maxBufferSize; } - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGEREPLY(ApplyBucketDiffReply, onApplyBucketDiffReply) }; @@ -359,13 +341,11 @@ public: RequestBucketInfoCommand(uint16_t distributor, const lib::ClusterState& state); - const std::vector<document::BucketId>& getBuckets() const - { return _buckets; } + const std::vector<document::BucketId>& getBuckets() const { return _buckets; } bool hasSystemState() const { return (_state.get() != 0); } uint16_t getDistributor() const { return _distributor; } - const lib::ClusterState& getSystemState() const - { return *_state; } + const lib::ClusterState& getSystemState() const { return *_state; } const vespalib::string& getDistributionHash() const { return _distributionHash; } @@ -402,14 +382,10 @@ public: explicit RequestBucketInfoReply(const RequestBucketInfoCommand& cmd); ~RequestBucketInfoReply(); - const EntryVector & getBucketInfo() const { return _buckets; } EntryVector & getBucketInfo() { return _buckets; } - uint32_t getMemoryFootprint() const override; - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(RequestBucketInfoReply, onRequestBucketInfoReply) }; @@ -426,15 +402,11 @@ public: */ class NotifyBucketChangeCommand : public BucketCommand { BucketInfo _info; - public: NotifyBucketChangeCommand(const document::BucketId& bucket, const BucketInfo& bucketInfo); - const BucketInfo& getBucketInfo() const { return _info; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGECOMMAND(NotifyBucketChangeCommand, onNotifyBucketChange) }; @@ -451,9 +423,7 @@ public: class NotifyBucketChangeReply : public BucketReply { public: explicit NotifyBucketChangeReply(const NotifyBucketChangeCommand& cmd); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(NotifyBucketChangeReply, onNotifyBucketChangeReply) }; @@ -474,16 +444,13 @@ public: private: BUCKET_STATE _state; public: - SetBucketStateCommand(const document::BucketId& bucket, - BUCKET_STATE state); - + SetBucketStateCommand(const document::BucketId& bucket, BUCKET_STATE state); void print(std::ostream& out, bool verbose, const std::string& indent) const override; - BUCKET_STATE getState() const { return _state; } - DECLARE_STORAGECOMMAND(SetBucketStateCommand, onSetBucketState) private: - virtual vespalib::string getSummary() const override; + + vespalib::string getSummary() const override; }; /** @@ -496,12 +463,9 @@ class SetBucketStateReply : public BucketInfoReply { public: explicit SetBucketStateReply(const SetBucketStateCommand&); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(SetBucketStateReply, onSetBucketStateReply) }; } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/message/bucketsplitting.h b/storageapi/src/vespa/storageapi/message/bucketsplitting.h index 6188a7cc44f..4e7c9397716 100644 --- a/storageapi/src/vespa/storageapi/message/bucketsplitting.h +++ b/storageapi/src/vespa/storageapi/message/bucketsplitting.h @@ -57,7 +57,7 @@ public: void setMinByteSize(uint32_t v) { _minByteSize = v; } void setMinDocCount(uint32_t v) { _minDocCount = v; } - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(SplitBucketCommand, onSplitBucket) }; @@ -71,19 +71,14 @@ public: class SplitBucketReply : public BucketReply { public: typedef std::pair<document::BucketId, BucketInfo> Entry; - -private: - std::vector<Entry> _result; - -public: explicit SplitBucketReply(const SplitBucketCommand& cmd); - std::vector<Entry>& getSplitInfo() { return _result; } const std::vector<Entry>& getSplitInfo() const { return _result; } - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGEREPLY(SplitBucketReply, onSplitBucketReply) +private: + std::vector<Entry> _result; }; /** @@ -97,19 +92,13 @@ public: class JoinBucketsCommand : public MaintenanceCommand { std::vector<document::BucketId> _sources; uint8_t _minJoinBits; - public: explicit JoinBucketsCommand(const document::BucketId& target); - std::vector<document::BucketId>& getSourceBuckets() { return _sources; } - const std::vector<document::BucketId>& getSourceBuckets() const - { return _sources; } - + const std::vector<document::BucketId>& getSourceBuckets() const { return _sources; } void setMinJoinBits(uint8_t minJoinBits) { _minJoinBits = minJoinBits; } uint8_t getMinJoinBits() const { return _minJoinBits; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(JoinBucketsCommand, onJoinBuckets) }; @@ -121,20 +110,13 @@ public: */ class JoinBucketsReply : public BucketInfoReply { std::vector<document::BucketId> _sources; - public: explicit JoinBucketsReply(const JoinBucketsCommand& cmd); - JoinBucketsReply(const JoinBucketsCommand& cmd, const BucketInfo& bucketInfo); - - const std::vector<document::BucketId>& getSourceBuckets() const - { return _sources; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - + const std::vector<document::BucketId>& getSourceBuckets() const { return _sources; } + void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGEREPLY(JoinBucketsReply, onJoinBucketsReply) }; } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/message/datagram.h b/storageapi/src/vespa/storageapi/message/datagram.h index 040f925f98a..642caa8e12a 100644 --- a/storageapi/src/vespa/storageapi/message/datagram.h +++ b/storageapi/src/vespa/storageapi/message/datagram.h @@ -1,12 +1,11 @@ // 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/bucket/bucketid.h> -#include <vespa/vdslib/container/documentlist.h> +#include "visitor.h" #include <vespa/storageapi/messageapi/storagecommand.h> #include <vespa/storageapi/messageapi/storagereply.h> #include <vespa/storageapi/defs.h> -#include <vespa/storageapi/message/visitor.h> +#include <vespa/vdslib/container/documentlist.h> namespace storage { namespace api { @@ -33,16 +32,11 @@ public: { assert(_docBlock.getBufferSize() > 0); return _docBlock; } const vdslib::DocumentList& getDocumentBlock() const { assert(_docBlock.getBufferSize() > 0); return _docBlock; } - - void setDocumentBlock(vdslib::DocumentList& block) { - _docBlock = block; - } + void setDocumentBlock(vdslib::DocumentList& block) { _docBlock = block; } document::BucketId getBucketId() const override { return _bucketId; } - virtual bool hasSingleBucketId() const override { return true; } - + bool hasSingleBucketId() const override { return true; } void print(std::ostream& out, bool verbose, const std::string& indent) const override; - bool keepTimeStamps() const { return _keepTimeStamps; } void keepTimeStamps(bool keepTime) { _keepTimeStamps = keepTime; } @@ -58,9 +52,7 @@ public: class DocBlockReply : public StorageReply { public: explicit DocBlockReply(const DocBlockCommand&); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(DocBlockReply, onDocBlockReply) }; @@ -76,15 +68,11 @@ public: */ class MapVisitorCommand : public StorageCommand { vdslib::Parameters _statistics; - public: MapVisitorCommand(); - vdslib::Parameters& getData() { return _statistics; }; const vdslib::Parameters& getData() const { return _statistics; }; - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGECOMMAND(MapVisitorCommand, onMapVisitor) }; @@ -97,9 +85,7 @@ public: class MapVisitorReply : public StorageReply { public: explicit MapVisitorReply(const MapVisitorCommand&); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(MapVisitorReply, onMapVisitorReply) }; @@ -120,7 +106,6 @@ public: bool _removeEntry; Entry() : _doc(), _lastModified(0), _removeEntry(false) {} - Entry(const document::Document::SP& doc, int64_t lastModified, bool removeEntry) : _doc(doc), @@ -132,18 +117,13 @@ public: private: document::BucketId _bucketId; std::vector<Entry> _documents; - public: DocumentListCommand(const document::BucketId& bid); - const document::BucketId& getBucketId() { return _bucketId; } std::vector<Entry>& getDocuments() { return _documents; } const std::vector<Entry>& getDocuments() const { return _documents; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGECOMMAND(DocumentListCommand, onDocumentList) - }; std::ostream& operator<<(std::ostream& out, const DocumentListCommand::Entry& e); @@ -157,9 +137,7 @@ std::ostream& operator<<(std::ostream& out, const DocumentListCommand::Entry& e) class DocumentListReply : public StorageReply { public: explicit DocumentListReply(const DocumentListCommand&); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(DocumentListReply, onDocumentListReply) }; @@ -176,18 +154,11 @@ public: */ class EmptyBucketsCommand : public StorageCommand { std::vector<document::BucketId> _buckets; - public: EmptyBucketsCommand(const std::vector<document::BucketId>&); - - const std::vector<document::BucketId>& getBuckets() const - { return _buckets; } - + const std::vector<document::BucketId>& getBuckets() const { return _buckets; } void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGECOMMAND(EmptyBucketsCommand, onEmptyBuckets) - -private: }; /** @@ -199,12 +170,9 @@ private: class EmptyBucketsReply : public StorageReply { public: explicit EmptyBucketsReply(const EmptyBucketsCommand&); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(EmptyBucketsReply, onEmptyBucketsReply) }; } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/message/documentsummary.h b/storageapi/src/vespa/storageapi/message/documentsummary.h index b32723c6ddb..d9f943afc07 100644 --- a/storageapi/src/vespa/storageapi/message/documentsummary.h +++ b/storageapi/src/vespa/storageapi/message/documentsummary.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 "visitor.h" #include <vespa/vdslib/container/documentsummary.h> -#include <vespa/storageapi/message/visitor.h> namespace storage { namespace api { @@ -18,13 +18,10 @@ class DocumentSummaryCommand : public StorageCommand, { public: explicit DocumentSummaryCommand(); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - uint32_t getMemoryFootprint() const override { return getSerializedSize(); } - DECLARE_STORAGECOMMAND(DocumentSummaryCommand, onDocumentSummary) }; @@ -37,12 +34,9 @@ public: class DocumentSummaryReply : public StorageReply { public: explicit DocumentSummaryReply(const DocumentSummaryCommand& command); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(DocumentSummaryReply, onDocumentSummaryReply) }; } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/message/persistence.h b/storageapi/src/vespa/storageapi/message/persistence.h index 470acca566b..251750eed60 100644 --- a/storageapi/src/vespa/storageapi/message/persistence.h +++ b/storageapi/src/vespa/storageapi/message/persistence.h @@ -67,12 +67,9 @@ public: uint32_t getMemoryFootprint() const override { return (_doc.get() ? 4096 : 0) + 20; } - vespalib::string getSummary() const override; - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - virtual StorageCommand::UP createCopyToForward(const document::BucketId& bucket, uint64_t timestamp) const override; + StorageCommand::UP createCopyToForward(const document::BucketId& bucket, uint64_t timestamp) const override; DECLARE_STORAGECOMMAND(PutCommand, onPut); }; @@ -140,8 +137,7 @@ public: vespalib::string getSummary() const override; void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - virtual StorageCommand::UP createCopyToForward(const document::BucketId& bucket, uint64_t timestamp) const override; + StorageCommand::UP createCopyToForward(const document::BucketId& bucket, uint64_t timestamp) const override; DECLARE_STORAGECOMMAND(UpdateCommand, onUpdate); }; @@ -203,9 +199,7 @@ public: GetCommand(const document::BucketId&, const document::DocumentId&, const vespalib::stringref & fieldSet, Timestamp before = MAX_TIMESTAMP); ~GetCommand(); - void setBeforeTimestamp(Timestamp ts) { _beforeTimestamp = ts; } - const document::DocumentId& getDocumentId() const { return _docId; } Timestamp getBeforeTimestamp() const { return _beforeTimestamp; } const vespalib::string& getFieldSet() const { return _fieldSet; } @@ -214,7 +208,7 @@ public: vespalib::string getSummary() const override; void print(std::ostream& out, bool verbose, const std::string& indent) const override; - virtual StorageCommand::UP createCopyToForward(const document::BucketId& bucket, uint64_t timestamp) const override; + StorageCommand::UP createCopyToForward(const document::BucketId& bucket, uint64_t timestamp) const override; DECLARE_STORAGECOMMAND(GetCommand, onGet) }; @@ -246,13 +240,10 @@ public: Timestamp getBeforeTimestamp() const { return _beforeTimestamp; } bool wasFound() const { return (_doc.get() != 0); } - uint32_t getMemoryFootprint() const override { return (_doc.get() ? 4096 : 0) + 30; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(GetReply, onGetReply) }; @@ -267,20 +258,15 @@ class RemoveCommand : public TestAndSetCommand { Timestamp _timestamp; public: - RemoveCommand(const document::BucketId&, const document::DocumentId& docId, - Timestamp timestamp); + RemoveCommand(const document::BucketId&, const document::DocumentId& docId, Timestamp timestamp); ~RemoveCommand(); void setTimestamp(Timestamp ts) { _timestamp = ts; } - const document::DocumentId& getDocumentId() const override { return _docId; } Timestamp getTimestamp() const { return _timestamp; } - vespalib::string getSummary() const override; void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - virtual StorageCommand::UP createCopyToForward(const document::BucketId& bucket, uint64_t timestamp) const override; - + StorageCommand::UP createCopyToForward(const document::BucketId& bucket, uint64_t timestamp) const override; DECLARE_STORAGECOMMAND(RemoveCommand, onRemove) }; @@ -294,7 +280,6 @@ class RemoveReply : public BucketInfoReply { document::DocumentId _docId; Timestamp _timestamp; Timestamp _oldTimestamp; - public: explicit RemoveReply(const RemoveCommand& cmd, Timestamp oldTimestamp = 0); ~RemoveReply(); @@ -302,13 +287,9 @@ public: const document::DocumentId& getDocumentId() const { return _docId; } Timestamp getTimestamp() { return _timestamp; }; Timestamp getOldTimestamp() const { return _oldTimestamp; } - void setOldTimestamp(Timestamp oldTimestamp) { _oldTimestamp = oldTimestamp; } - bool wasFound() const { return (_oldTimestamp != 0); } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(RemoveReply, onRemoveReply) }; @@ -320,16 +301,12 @@ public: */ class RevertCommand : public BucketInfoCommand { std::vector<Timestamp> _tokens; - public: RevertCommand(const document::BucketId& bucket, const std::vector<Timestamp>& revertTokens); ~RevertCommand(); - const std::vector<Timestamp>& getRevertTokens() const { return _tokens; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGECOMMAND(RevertCommand, onRevert) }; @@ -341,19 +318,13 @@ public: */ class RevertReply : public BucketInfoReply { std::vector<Timestamp> _tokens; - public: explicit RevertReply(const RevertCommand& cmd); ~RevertReply(); - const std::vector<Timestamp>& getRevertTokens() const { return _tokens; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(RevertReply, onRevertReply) }; } // api } // storage - - diff --git a/storageapi/src/vespa/storageapi/message/queryresult.h b/storageapi/src/vespa/storageapi/message/queryresult.h index 8020fa22dea..282a45ee43b 100644 --- a/storageapi/src/vespa/storageapi/message/queryresult.h +++ b/storageapi/src/vespa/storageapi/message/queryresult.h @@ -1,9 +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 "visitor.h" #include <vespa/vdslib/container/searchresult.h> #include <vespa/vdslib/container/documentsummary.h> -#include <vespa/storageapi/message/visitor.h> namespace storage { namespace api { @@ -43,12 +43,9 @@ private: class QueryResultReply : public StorageReply { public: explicit QueryResultReply(const QueryResultCommand& command); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(QueryResultReply, onQueryResultReply) }; } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/message/removelocation.h b/storageapi/src/vespa/storageapi/message/removelocation.h index 08b5663e2d6..6232ddece90 100644 --- a/storageapi/src/vespa/storageapi/message/removelocation.h +++ b/storageapi/src/vespa/storageapi/message/removelocation.h @@ -5,7 +5,6 @@ #include <vespa/storageapi/messageapi/storagecommand.h> #include <vespa/storageapi/messageapi/bucketinforeply.h> - namespace storage { namespace api { @@ -15,17 +14,12 @@ public: RemoveLocationCommand(const vespalib::stringref & documentSelection, const document::BucketId&); - void print(std::ostream& out, bool verbose, - const std::string& indent) const override; - + void print(std::ostream& out, bool verbose, const std::string& indent) const override; uint32_t getMemoryFootprint() const override { return _documentSelection.length(); } - const vespalib::string& getDocumentSelection() const { return _documentSelection; } - DECLARE_STORAGECOMMAND(RemoveLocationCommand, onRemoveLocation); - private: vespalib::string _documentSelection; }; @@ -34,10 +28,8 @@ class RemoveLocationReply : public BucketInfoReply { public: RemoveLocationReply(const RemoveLocationCommand& cmd); - DECLARE_STORAGEREPLY(RemoveLocationReply, onRemoveLocationReply) }; } } - diff --git a/storageapi/src/vespa/storageapi/message/searchresult.h b/storageapi/src/vespa/storageapi/message/searchresult.h index b2662800a9d..220f48a5973 100644 --- a/storageapi/src/vespa/storageapi/message/searchresult.h +++ b/storageapi/src/vespa/storageapi/message/searchresult.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 "visitor.h" #include <vespa/vdslib/container/searchresult.h> -#include <vespa/storageapi/message/visitor.h> namespace storage { namespace api { @@ -16,13 +16,8 @@ namespace api { class SearchResultCommand : public StorageCommand, public vdslib::SearchResult { public: SearchResultCommand(); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - uint32_t getMemoryFootprint() const override { - return getSerializedSize(); - } - + uint32_t getMemoryFootprint() const override { return getSerializedSize(); } DECLARE_STORAGECOMMAND(SearchResultCommand, onSearchResult) }; @@ -35,12 +30,9 @@ public: class SearchResultReply : public StorageReply { public: explicit SearchResultReply(const SearchResultCommand& command); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(SearchResultReply, onSearchResultReply) }; } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/message/stat.h b/storageapi/src/vespa/storageapi/message/stat.h index 3ee4afbb4ba..071f3e8ebdd 100644 --- a/storageapi/src/vespa/storageapi/message/stat.h +++ b/storageapi/src/vespa/storageapi/message/stat.h @@ -20,30 +20,22 @@ namespace api { class StatBucketCommand : public BucketCommand { private: vespalib::string _docSelection; - public: StatBucketCommand(const document::BucketId& bucket, const vespalib::stringref & documentSelection); const vespalib::string& getDocumentSelection() const { return _docSelection; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - virtual StorageCommand::UP createCopyToForward(const document::BucketId&, uint64_t timestamp) const override; - + StorageCommand::UP createCopyToForward(const document::BucketId&, uint64_t timestamp) const override; DECLARE_STORAGECOMMAND(StatBucketCommand, onStatBucket); }; class StatBucketReply : public BucketReply { vespalib::string _results; - public: StatBucketReply(const StatBucketCommand&, const vespalib::stringref & results = ""); - const vespalib::string& getResults() { return _results; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(StatBucketReply, onStatBucketReply) }; @@ -60,9 +52,7 @@ public: class GetBucketListCommand : public BucketCommand { public: GetBucketListCommand(const document::BucketId& bucket); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGECOMMAND(GetBucketListCommand, onGetBucketList); }; @@ -76,8 +66,7 @@ public: const vespalib::stringref & bucketInformation) : _bucket(id), _bucketInformation(bucketInformation) - { - } + {} bool operator==(const BucketInfo& other) const { return (_bucket == other._bucket @@ -90,12 +79,9 @@ private: public: GetBucketListReply(const GetBucketListCommand&); - std::vector<BucketInfo>& getBuckets() { return _buckets; } const std::vector<BucketInfo>& getBuckets() const { return _buckets; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - DECLARE_STORAGEREPLY(GetBucketListReply, onGetBucketListReply) }; @@ -104,4 +90,3 @@ std::ostream& operator<<(std::ostream& out, const GetBucketListReply::BucketInfo } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/message/state.h b/storageapi/src/vespa/storageapi/message/state.h index 12a357c1b40..86830f86e7b 100644 --- a/storageapi/src/vespa/storageapi/message/state.h +++ b/storageapi/src/vespa/storageapi/message/state.h @@ -1,9 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * @file state.h - * - * State commands. - */ + #pragma once #include <vespa/storageapi/messageapi/storagecommand.h> @@ -25,9 +21,7 @@ class GetNodeStateCommand : public StorageCommand { public: explicit GetNodeStateCommand(lib::NodeState::UP expectedState); - const lib::NodeState* getExpectedState() const - { return _expectedState.get(); } - + const lib::NodeState* getExpectedState() const { return _expectedState.get(); } void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(GetNodeStateCommand, onGetNodeState) @@ -71,9 +65,7 @@ class SetSystemStateCommand : public StorageCommand { public: explicit SetSystemStateCommand(const lib::ClusterState&); - const lib::ClusterState& getSystemState() const { return _state; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGECOMMAND(SetSystemStateCommand, onSetSystemState) @@ -93,7 +85,6 @@ public: // Not serialized. Available locally const lib::ClusterState& getSystemState() const { return _state; } - void print(std::ostream& out, bool verbose, const std::string& indent) const override; DECLARE_STORAGEREPLY(SetSystemStateReply, onSetSystemStateReply) @@ -101,4 +92,3 @@ public: } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/message/visitor.h b/storageapi/src/vespa/storageapi/message/visitor.h index a9d1de402da..c1d0bb637a0 100644 --- a/storageapi/src/vespa/storageapi/message/visitor.h +++ b/storageapi/src/vespa/storageapi/message/visitor.h @@ -108,14 +108,11 @@ public: void setVisitorOrdering(document::OrderingSpecification::Order ordering) { _ordering = ordering; } document::OrderingSpecification::Order getVisitorOrdering() const { return _ordering; } - void setMaxBucketsPerVisitor(uint32_t max) - { _maxBucketsPerVisitor = max; } - uint32_t getMaxBucketsPerVisitor() const - { return _maxBucketsPerVisitor; } + void setMaxBucketsPerVisitor(uint32_t max) { _maxBucketsPerVisitor = max; } + uint32_t getMaxBucketsPerVisitor() const { return _maxBucketsPerVisitor; } void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - virtual StorageCommand::UP createCopyToForward(const document::BucketId&, uint64_t timestamp) const override; + StorageCommand::UP createCopyToForward(const document::BucketId&, uint64_t timestamp) const override; DECLARE_STORAGECOMMAND(CreateVisitorCommand, onCreateVisitor) }; diff --git a/storageapi/src/vespa/storageapi/messageapi/bucketcommand.h b/storageapi/src/vespa/storageapi/messageapi/bucketcommand.h index 7c078b9545a..95b2284661a 100644 --- a/storageapi/src/vespa/storageapi/messageapi/bucketcommand.h +++ b/storageapi/src/vespa/storageapi/messageapi/bucketcommand.h @@ -8,8 +8,7 @@ #pragma once -#include <vespa/document/bucket/bucketid.h> -#include <vespa/storageapi/messageapi/storagecommand.h> +#include "storagecommand.h" namespace storage { namespace api { @@ -32,13 +31,9 @@ public: document::BucketId getBucketId() const override { return _bucket; } bool hasBeenRemapped() const { return (_originalBucket.getRawId() != 0); } - const document::BucketId& getOriginalBucketId() const - { return _originalBucket; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - virtual bool hasSingleBucketId() const override { return true; } - + const document::BucketId& getOriginalBucketId() const { return _originalBucket; } + void print(std::ostream& out, bool verbose, const std::string& indent) const override; + bool hasSingleBucketId() const override { return true; } }; } // api diff --git a/storageapi/src/vespa/storageapi/messageapi/bucketinfocommand.h b/storageapi/src/vespa/storageapi/messageapi/bucketinfocommand.h index 62171a9e3c0..d9d924bc338 100644 --- a/storageapi/src/vespa/storageapi/messageapi/bucketinfocommand.h +++ b/storageapi/src/vespa/storageapi/messageapi/bucketinfocommand.h @@ -12,7 +12,7 @@ #pragma once -#include <vespa/storageapi/messageapi/bucketcommand.h> +#include "bucketcommand.h" namespace storage { namespace api { @@ -24,8 +24,7 @@ protected: public: DECLARE_POINTER_TYPEDEFS(BucketInfoCommand); - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; }; } // api diff --git a/storageapi/src/vespa/storageapi/messageapi/bucketinforeply.h b/storageapi/src/vespa/storageapi/messageapi/bucketinforeply.h index d39a6a5eaf8..d5b174e4f2e 100644 --- a/storageapi/src/vespa/storageapi/messageapi/bucketinforeply.h +++ b/storageapi/src/vespa/storageapi/messageapi/bucketinforeply.h @@ -12,9 +12,9 @@ #pragma once +#include "bucketreply.h" +#include "bucketinfocommand.h" #include <vespa/storageapi/buckets/bucketinfo.h> -#include <vespa/storageapi/messageapi/bucketreply.h> -#include <vespa/storageapi/messageapi/bucketinfocommand.h> namespace storage { namespace api { @@ -31,11 +31,8 @@ public: const BucketInfo& getBucketInfo() const { return _result; }; void setBucketInfo(const BucketInfo& info) { _result = info; } - - /** Overload this to get more descriptive message output. */ - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; }; } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/messageapi/bucketreply.h b/storageapi/src/vespa/storageapi/messageapi/bucketreply.h index 833f1396c49..0cd2c2065fe 100644 --- a/storageapi/src/vespa/storageapi/messageapi/bucketreply.h +++ b/storageapi/src/vespa/storageapi/messageapi/bucketreply.h @@ -8,8 +8,7 @@ #pragma once -#include <vespa/document/bucket/bucketid.h> -#include <vespa/storageapi/messageapi/storagereply.h> +#include "storagereply.h" namespace storage { namespace api { @@ -39,10 +38,8 @@ public: if (_originalBucket.getRawId() == 0) _originalBucket = _bucket; _bucket = bucket; } - - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; }; } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/messageapi/messagehandler.h b/storageapi/src/vespa/storageapi/messageapi/messagehandler.h index 66873dfba27..131ee8d2400 100644 --- a/storageapi/src/vespa/storageapi/messageapi/messagehandler.h +++ b/storageapi/src/vespa/storageapi/messageapi/messagehandler.h @@ -13,6 +13,7 @@ #pragma once +#include <memory> namespace storage { namespace api { diff --git a/storageapi/src/vespa/storageapi/messageapi/returncode.cpp b/storageapi/src/vespa/storageapi/messageapi/returncode.cpp index f11d91b7079..e2d10487431 100644 --- a/storageapi/src/vespa/storageapi/messageapi/returncode.cpp +++ b/storageapi/src/vespa/storageapi/messageapi/returncode.cpp @@ -1,10 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "returncode.h" -#include <vespa/messagebus/errorcode.h> - -#include <vespa/document/util/bytebuffer.h> -#include <vespa/fnet/frt/error.h> #include <ostream> namespace storage { diff --git a/storageapi/src/vespa/storageapi/messageapi/returncode.h b/storageapi/src/vespa/storageapi/messageapi/returncode.h index a7be570e8f4..0aa87c64012 100644 --- a/storageapi/src/vespa/storageapi/messageapi/returncode.h +++ b/storageapi/src/vespa/storageapi/messageapi/returncode.h @@ -14,7 +14,6 @@ #include <vespa/document/util/serializable.h> #include <vespa/documentapi/messagebus/documentprotocol.h> #include <iosfwd> -#include <string> namespace document { class ByteBuffer; @@ -68,9 +67,7 @@ public: private: Result _result; vespalib::string _message; - - void onDeserialize(const document::DocumentTypeRepo &repo, - document::ByteBuffer& buffer) override; + void onDeserialize(const document::DocumentTypeRepo &repo, document::ByteBuffer& buffer) override; void onSerialize(document::ByteBuffer& buffer) const override; public: @@ -123,4 +120,3 @@ public: } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/messageapi/storagecommand.h b/storageapi/src/vespa/storageapi/messageapi/storagecommand.h index 00f17458e6a..d67cbcf2bcb 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagecommand.h +++ b/storageapi/src/vespa/storageapi/messageapi/storagecommand.h @@ -12,7 +12,7 @@ #pragma once -#include <vespa/storageapi/messageapi/storagemessage.h> +#include "storagemessage.h" namespace storage { namespace api { @@ -46,7 +46,7 @@ public: void setNewId() { StorageMessage::setNewMsgId(); } /** Overload this to get more descriptive message output. */ - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; /** * A way for someone to make a reply to a storage message without diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h index 47dd93a9535..8801916c14b 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h +++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h @@ -11,11 +11,11 @@ #pragma once +#include "messagehandler.h" #include <map> #include <vespa/vespalib/util/printable.h> #include <vespa/messagebus/routing/route.h> #include <vespa/vespalib/util/sync.h> -#include <vespa/storageapi/messageapi/messagehandler.h> #include <vespa/vdslib/state/nodetype.h> #include <vespa/messagebus/trace.h> #include <vespa/documentapi/loadtypes/loadtype.h> @@ -42,9 +42,8 @@ namespace vespalib { public: \ DECLARE_POINTER_TYPEDEFS(reply) \ private: \ - virtual bool callHandler( \ - MessageHandler& h, \ - const std::shared_ptr<StorageMessage>& m) const override \ + bool callHandler(MessageHandler& h, \ + const std::shared_ptr<StorageMessage>& m) const override \ { \ return h.callback(std::static_pointer_cast<reply>(m)); \ } @@ -66,7 +65,7 @@ public: \ #define IMPLEMENT_COMMAND(command, reply) \ IMPLEMENT_COMMON(command) \ std::unique_ptr<storage::api::StorageReply> \ - storage::api::command::makeReply() \ + storage::api::command::makeReply() \ { \ return std::unique_ptr<storage::api::StorageReply>(new reply(*this)); \ } diff --git a/storageapi/src/vespa/storageapi/messageapi/storagereply.h b/storageapi/src/vespa/storageapi/messageapi/storagereply.h index eab6470f463..4d185ea7a29 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagereply.h +++ b/storageapi/src/vespa/storageapi/messageapi/storagereply.h @@ -12,8 +12,8 @@ #pragma once -#include <vespa/storageapi/messageapi/returncode.h> -#include <vespa/storageapi/messageapi/storagemessage.h> +#include "returncode.h" +#include "storagemessage.h" namespace storage { namespace api { @@ -34,9 +34,7 @@ public: void setResult(const ReturnCode& r) { _result = r; } void setResult(ReturnCode::Result r) { _result = ReturnCode(r); } const ReturnCode& getResult() const { return _result; } - - /** Overload this to get more descriptive output. */ - virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; }; } // api |