diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-02 14:42:01 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-02 14:42:01 +0200 |
commit | 9cbab19a493e30b242e5d1896733a62d35cd9181 (patch) | |
tree | 1c81a25050010792c65c8c8f27340814257354c9 /storageapi | |
parent | 0f646f10b377b90fc37e9911f9fe383d112ff157 (diff) |
Fix warnings hidden earlier due to including application headers as system includes
Diffstat (limited to 'storageapi')
18 files changed, 94 insertions, 73 deletions
diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp index 27fb603db24..62a85e0f45e 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "storageprotocol.h" -#include "protocolserialization.h" #include "serializationhelper.h" #include "storagecommand.h" #include "storagereply.h" @@ -23,6 +22,8 @@ StorageProtocol::StorageProtocol(const document::DocumentTypeRepo::SP repo, { } +StorageProtocol::~StorageProtocol() {} + mbus::IRoutingPolicy::UP StorageProtocol::createPolicy(const mbus::string&, const mbus::string&) const { diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h index e1bcff1b27c..376d2effd4e 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h @@ -14,12 +14,11 @@ public: static mbus::string NAME; - StorageProtocol(const document::DocumentTypeRepo::SP, - const documentapi::LoadTypeSet& loadTypes); + StorageProtocol(const document::DocumentTypeRepo::SP, const documentapi::LoadTypeSet& loadTypes); + ~StorageProtocol(); const mbus::string& getName() const override { return NAME; } - mbus::IRoutingPolicy::UP createPolicy(const mbus::string& name, - const mbus::string& param) const override; + mbus::IRoutingPolicy::UP createPolicy(const mbus::string& name, const mbus::string& param) const override; mbus::Blob encode(const vespalib::Version&, const mbus::Routable&) const override; mbus::Routable::UP decode(const vespalib::Version&, mbus::BlobRef) const override; diff --git a/storageapi/src/vespa/storageapi/message/bucket.cpp b/storageapi/src/vespa/storageapi/message/bucket.cpp index 341a11ba5ee..3400e0d6399 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.cpp +++ b/storageapi/src/vespa/storageapi/message/bucket.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 "bucket.h" #include <vespa/document/fieldvalue/document.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/util/array.hpp> - namespace storage { namespace api { @@ -105,12 +105,12 @@ MergeBucketCommand::MergeBucketCommand( _maxTimestamp(maxTimestamp), _clusterStateVersion(clusterStateVersion), _chain(chain) -{ -} +{} + +MergeBucketCommand::~MergeBucketCommand() {} void -MergeBucketCommand::print(std::ostream& out, bool verbose, - const std::string& indent) const +MergeBucketCommand::print(std::ostream& out, bool verbose, const std::string& indent) const { out << "MergeBucketCommand(" << getBucketId() << ", to time " << _maxTimestamp << ", cluster state version: " @@ -208,8 +208,9 @@ GetBucketDiffCommand::GetBucketDiffCommand( : BucketCommand(MessageType::GETBUCKETDIFF, id), _nodes(nodes), _maxTimestamp(maxTimestamp) -{ -} +{} + +GetBucketDiffCommand::~GetBucketDiffCommand() {} void GetBucketDiffCommand::print(std::ostream& out, bool verbose, @@ -245,8 +246,9 @@ GetBucketDiffReply::GetBucketDiffReply(const GetBucketDiffCommand& cmd) _nodes(cmd.getNodes()), _maxTimestamp(cmd.getMaxTimestamp()), _diff(cmd.getDiff()) -{ -} +{} + +GetBucketDiffReply::~GetBucketDiffReply() {} void GetBucketDiffReply::print(std::ostream& out, bool verbose, @@ -283,8 +285,7 @@ ApplyBucketDiffCommand::Entry::Entry() _headerBlob(), _bodyBlob(), _repo() -{ -} +{} ApplyBucketDiffCommand::Entry::Entry(const GetBucketDiffCommand::Entry& e) : _entry(e), @@ -292,10 +293,14 @@ ApplyBucketDiffCommand::Entry::Entry(const GetBucketDiffCommand::Entry& e) _headerBlob(), _bodyBlob(), _repo() -{ -} +{} + +ApplyBucketDiffCommand::Entry::~Entry() {} +ApplyBucketDiffCommand::Entry::Entry(const Entry &) = default; +ApplyBucketDiffCommand::Entry & ApplyBucketDiffCommand::Entry::operator = (const Entry &) = default; -bool ApplyBucketDiffCommand::Entry::filled() const +bool +ApplyBucketDiffCommand::Entry::filled() const { return ((_headerBlob.size() > 0 || (_entry._headerSize == 0 && !_docName.empty())) && @@ -303,7 +308,8 @@ bool ApplyBucketDiffCommand::Entry::filled() const _entry._bodySize == 0)); } -void ApplyBucketDiffCommand::Entry::print( +void +ApplyBucketDiffCommand::Entry::print( std::ostream& out, bool verbose, const std::string& indent) const { out << "ApplyEntry("; @@ -324,7 +330,8 @@ void ApplyBucketDiffCommand::Entry::print( out << ")"; } -bool ApplyBucketDiffCommand::Entry::operator==(const Entry& e) const +bool +ApplyBucketDiffCommand::Entry::operator==(const Entry& e) const { return (_entry == e._entry && _headerBlob == e._headerBlob && @@ -338,8 +345,9 @@ ApplyBucketDiffCommand::ApplyBucketDiffCommand( _nodes(nodes), _diff(), _maxBufferSize(maxBufferSize) -{ -} +{} + +ApplyBucketDiffCommand::~ApplyBucketDiffCommand() {} void ApplyBucketDiffCommand::print(std::ostream& out, bool verbose, @@ -386,8 +394,9 @@ ApplyBucketDiffReply::ApplyBucketDiffReply(const ApplyBucketDiffCommand& cmd) _nodes(cmd.getNodes()), _diff(cmd.getDiff()), _maxBufferSize(cmd.getMaxBufferSize()) -{ -} +{} + +ApplyBucketDiffReply::~ApplyBucketDiffReply() {} void ApplyBucketDiffReply::print(std::ostream& out, bool verbose, diff --git a/storageapi/src/vespa/storageapi/message/bucket.h b/storageapi/src/vespa/storageapi/message/bucket.h index 31948852840..feb79772c17 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.h +++ b/storageapi/src/vespa/storageapi/message/bucket.h @@ -123,6 +123,7 @@ public: Timestamp maxTimestamp, uint32_t clusterStateVersion = 0, const std::vector<uint16_t>& chain = std::vector<uint16_t>()); + ~MergeBucketCommand(); const std::vector<Node>& getNodes() const { return _nodes; } Timestamp getMaxTimestamp() const { return _maxTimestamp; } @@ -198,6 +199,7 @@ public: GetBucketDiffCommand(const document::BucketId&, const std::vector<Node>&, Timestamp maxTimestamp); + ~GetBucketDiffCommand(); const std::vector<Node>& getNodes() const { return _nodes; } Timestamp getMaxTimestamp() const { return _maxTimestamp; } @@ -227,6 +229,7 @@ private: public: explicit GetBucketDiffReply(const GetBucketDiffCommand& cmd); + ~GetBucketDiffReply(); const std::vector<Node>& getNodes() const { return _nodes; } Timestamp getMaxTimestamp() const { return _maxTimestamp; } @@ -256,6 +259,11 @@ public: Entry(); Entry(const GetBucketDiffCommand::Entry&); + Entry(const Entry &); + Entry & operator = (const Entry &); + Entry(Entry &&) = default; + Entry & operator = (Entry &&) = default; + ~Entry(); bool filled() const; void print(std::ostream& out, bool verbose, const std::string& indent) const override; @@ -274,6 +282,7 @@ public: ApplyBucketDiffCommand(const document::BucketId& id, const std::vector<Node>& nodes, uint32_t maxBufferSize); + ~ApplyBucketDiffCommand(); const std::vector<Node>& getNodes() const { return _nodes; } const std::vector<Entry>& getDiff() const { return _diff; } @@ -302,6 +311,7 @@ private: public: explicit ApplyBucketDiffReply(const ApplyBucketDiffCommand& cmd); + ~ApplyBucketDiffReply(); const std::vector<Node>& getNodes() const { return _nodes; } const std::vector<Entry>& getDiff() const { return _diff; } diff --git a/storageapi/src/vespa/storageapi/message/datagram.cpp b/storageapi/src/vespa/storageapi/message/datagram.cpp index 11ad170eb5e..2be54c2489b 100644 --- a/storageapi/src/vespa/storageapi/message/datagram.cpp +++ b/storageapi/src/vespa/storageapi/message/datagram.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 "datagram.h" -#include <cassert> namespace storage { namespace api { @@ -26,6 +25,8 @@ DocBlockCommand::DocBlockCommand(const document::BucketId& bucketId, { } +DocBlockCommand::~DocBlockCommand() {} + void DocBlockCommand::print(std::ostream& out, bool verbose, const std::string& indent) const diff --git a/storageapi/src/vespa/storageapi/message/datagram.h b/storageapi/src/vespa/storageapi/message/datagram.h index 642caa8e12a..a5b141f2e98 100644 --- a/storageapi/src/vespa/storageapi/message/datagram.h +++ b/storageapi/src/vespa/storageapi/message/datagram.h @@ -7,8 +7,7 @@ #include <vespa/storageapi/defs.h> #include <vespa/vdslib/container/documentlist.h> -namespace storage { -namespace api { +namespace storage::api { /** * @class DocBlockCommand @@ -27,6 +26,7 @@ public: DocBlockCommand(const document::BucketId& bucketId, const vdslib::DocumentList& block, const std::shared_ptr<void>& buffer); + ~DocBlockCommand(); vdslib::DocumentList& getDocumentBlock() { assert(_docBlock.getBufferSize() > 0); return _docBlock; } @@ -174,5 +174,4 @@ public: DECLARE_STORAGEREPLY(EmptyBucketsReply, onEmptyBucketsReply) }; -} // api -} // storage +} diff --git a/storageapi/src/vespa/storageapi/message/multioperation.cpp b/storageapi/src/vespa/storageapi/message/multioperation.cpp index ff4702d7e4c..b41a636151f 100644 --- a/storageapi/src/vespa/storageapi/message/multioperation.cpp +++ b/storageapi/src/vespa/storageapi/message/multioperation.cpp @@ -5,8 +5,7 @@ using document::DocumentTypeRepo; -namespace storage { -namespace api { +namespace storage::api { IMPLEMENT_COMMAND(MultiOperationCommand, MultiOperationReply) IMPLEMENT_REPLY(MultiOperationReply) @@ -57,6 +56,8 @@ MultiOperationCommand::MultiOperationCommand(const MultiOperationCommand& o) } } +MultiOperationCommand::~MultiOperationCommand() {} + void MultiOperationCommand::print(std::ostream& out, bool verbose, const std::string& indent) const @@ -104,5 +105,4 @@ MultiOperationReply::print(std::ostream& out, bool verbose, } } -} // api -} // storage +} diff --git a/storageapi/src/vespa/storageapi/message/multioperation.h b/storageapi/src/vespa/storageapi/message/multioperation.h index a4defc6078c..2a15f5ea529 100644 --- a/storageapi/src/vespa/storageapi/message/multioperation.h +++ b/storageapi/src/vespa/storageapi/message/multioperation.h @@ -36,6 +36,7 @@ public: const std::vector<char>& buffer, bool keepTimeStamps = false); explicit MultiOperationCommand(const MultiOperationCommand& template_); + ~MultiOperationCommand(); std::vector<char>& getBuffer() { return _buffer; }; const std::vector<char>& getBuffer() const { return _buffer; }; diff --git a/storageapi/src/vespa/storageapi/message/removelocation.cpp b/storageapi/src/vespa/storageapi/message/removelocation.cpp index bdf76e7d022..72a1ba59f21 100644 --- a/storageapi/src/vespa/storageapi/message/removelocation.cpp +++ b/storageapi/src/vespa/storageapi/message/removelocation.cpp @@ -9,16 +9,16 @@ namespace api { IMPLEMENT_COMMAND(RemoveLocationCommand, RemoveLocationReply) IMPLEMENT_REPLY(RemoveLocationReply) -RemoveLocationCommand::RemoveLocationCommand( - const vespalib::stringref & documentSelection, const document::BucketId& id) +RemoveLocationCommand::RemoveLocationCommand(const vespalib::stringref & documentSelection, + const document::BucketId& id) : BucketInfoCommand(MessageType::REMOVELOCATION, id), _documentSelection(documentSelection) -{ -} +{} + +RemoveLocationCommand::~RemoveLocationCommand() {} void -RemoveLocationCommand::print(std::ostream& out, bool verbose, - const std::string& indent) const +RemoveLocationCommand::print(std::ostream& out, bool verbose, const std::string& indent) const { if (_documentSelection.length()) { out << "Remove selection(" << _documentSelection << "): "; diff --git a/storageapi/src/vespa/storageapi/message/removelocation.h b/storageapi/src/vespa/storageapi/message/removelocation.h index 6232ddece90..2f9134d76ff 100644 --- a/storageapi/src/vespa/storageapi/message/removelocation.h +++ b/storageapi/src/vespa/storageapi/message/removelocation.h @@ -11,8 +11,8 @@ namespace api { class RemoveLocationCommand : public BucketInfoCommand { public: - RemoveLocationCommand(const vespalib::stringref & documentSelection, - const document::BucketId&); + RemoveLocationCommand(const vespalib::stringref & documentSelection, const document::BucketId&); + ~RemoveLocationCommand(); void print(std::ostream& out, bool verbose, const std::string& indent) const override; uint32_t getMemoryFootprint() const override { diff --git a/storageapi/src/vespa/storageapi/message/stat.cpp b/storageapi/src/vespa/storageapi/message/stat.cpp index aae28580b5b..4464c8a42cf 100644 --- a/storageapi/src/vespa/storageapi/message/stat.cpp +++ b/storageapi/src/vespa/storageapi/message/stat.cpp @@ -18,6 +18,8 @@ StatBucketCommand::StatBucketCommand(const document::BucketId& id, { } +StatBucketCommand::~StatBucketCommand() {} + void StatBucketCommand::print(std::ostream& out, bool verbose, const std::string& indent) const @@ -84,8 +86,9 @@ GetBucketListCommand::print(std::ostream& out, bool verbose, GetBucketListReply::GetBucketListReply(const GetBucketListCommand& cmd) : BucketReply(cmd), _buckets() -{ -} +{} + +GetBucketListReply::~GetBucketListReply() {} void GetBucketListReply::print(std::ostream& out, bool verbose, diff --git a/storageapi/src/vespa/storageapi/message/stat.h b/storageapi/src/vespa/storageapi/message/stat.h index 071f3e8ebdd..f37a639280e 100644 --- a/storageapi/src/vespa/storageapi/message/stat.h +++ b/storageapi/src/vespa/storageapi/message/stat.h @@ -23,6 +23,7 @@ private: public: StatBucketCommand(const document::BucketId& bucket, const vespalib::stringref & documentSelection); + ~StatBucketCommand(); const vespalib::string& getDocumentSelection() const { return _docSelection; } void print(std::ostream& out, bool verbose, const std::string& indent) const override; @@ -79,6 +80,7 @@ private: public: GetBucketListReply(const GetBucketListCommand&); + ~GetBucketListReply(); 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; diff --git a/storageapi/src/vespa/storageapi/messageapi/CMakeLists.txt b/storageapi/src/vespa/storageapi/messageapi/CMakeLists.txt index 7b272d672ed..abe050b8829 100644 --- a/storageapi/src/vespa/storageapi/messageapi/CMakeLists.txt +++ b/storageapi/src/vespa/storageapi/messageapi/CMakeLists.txt @@ -1,13 +1,14 @@ # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_add_library(storageapi_messageapi OBJECT SOURCES - returncode.cpp - storagemessage.cpp - storagecommand.cpp - storagereply.cpp bucketcommand.cpp bucketreply.cpp bucketinfocommand.cpp bucketinforeply.cpp + maintenancecommand.cpp + returncode.cpp + storagemessage.cpp + storagecommand.cpp + storagereply.cpp DEPENDS ) diff --git a/storageapi/src/vespa/storageapi/messageapi/bucketcommand.h b/storageapi/src/vespa/storageapi/messageapi/bucketcommand.h index 95b2284661a..2376469d74e 100644 --- a/storageapi/src/vespa/storageapi/messageapi/bucketcommand.h +++ b/storageapi/src/vespa/storageapi/messageapi/bucketcommand.h @@ -10,8 +10,7 @@ #include "storagecommand.h" -namespace storage { -namespace api { +namespace storage::api { class BucketCommand : public StorageCommand { document::BucketId _bucket; @@ -19,7 +18,8 @@ class BucketCommand : public StorageCommand { protected: BucketCommand(const MessageType& type, const document::BucketId& id) - : StorageCommand(type), _bucket(id), _originalBucket() {} + : StorageCommand(type), _bucket(id), _originalBucket() + {} public: DECLARE_POINTER_TYPEDEFS(BucketCommand); @@ -36,6 +36,4 @@ public: bool hasSingleBucketId() const override { return true; } }; -} // api -} // storage - +} diff --git a/storageapi/src/vespa/storageapi/messageapi/bucketinfocommand.cpp b/storageapi/src/vespa/storageapi/messageapi/bucketinfocommand.cpp index 9f671b953f1..7a579fe1d98 100644 --- a/storageapi/src/vespa/storageapi/messageapi/bucketinfocommand.cpp +++ b/storageapi/src/vespa/storageapi/messageapi/bucketinfocommand.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 "bucketinfocommand.h" - -#include <vespa/storageapi/message/persistence.h> +#include <ostream> namespace storage { namespace api { diff --git a/storageapi/src/vespa/storageapi/messageapi/maintenancecommand.h b/storageapi/src/vespa/storageapi/messageapi/maintenancecommand.h index 0687200f9fb..980e190a8ba 100644 --- a/storageapi/src/vespa/storageapi/messageapi/maintenancecommand.h +++ b/storageapi/src/vespa/storageapi/messageapi/maintenancecommand.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/messageapi/bucketinfocommand.h> +#include "bucketinfocommand.h" namespace storage { namespace api { @@ -10,17 +10,17 @@ class MaintenanceCommand : public BucketInfoCommand { public: MaintenanceCommand(const MessageType& type, const document::BucketId& id) - : BucketInfoCommand(type, id) {} + : BucketInfoCommand(type, id) + {} + MaintenanceCommand(MaintenanceCommand &&) = default; + MaintenanceCommand & operator = (MaintenanceCommand &&) = default; + ~MaintenanceCommand(); const vespalib::string& getReason() const { return _reason; }; - void setReason(const vespalib::stringref & reason) { _reason = reason; }; - protected: vespalib::string _reason; }; } - } - diff --git a/storageapi/src/vespa/storageapi/messageapi/messagehandler.h b/storageapi/src/vespa/storageapi/messageapi/messagehandler.h index 131ee8d2400..339360f947c 100644 --- a/storageapi/src/vespa/storageapi/messageapi/messagehandler.h +++ b/storageapi/src/vespa/storageapi/messageapi/messagehandler.h @@ -114,8 +114,8 @@ class EmptyBucketsReply; class RemoveLocationCommand; class RemoveLocationReply; -#define _INTERNAL_DEF_ON_MC(m, c) virtual bool m(const std::shared_ptr<storage::api::c> & ) -#define _INTERNAL_DEF_IMPL_ON_MC(m, c) virtual bool m(const std::shared_ptr<storage::api::c> & ) { return false; } +#define _INTERNAL_DEF_ON_MC(m, c) bool m(const std::shared_ptr<storage::api::c> & ) override +#define _INTERNAL_DEF_IMPL_ON_MC(m, c) bool m(const std::shared_ptr<storage::api::c> & ) override { return false; } #define _INTERNAL_IMPL_ON_MC(cl, m, c, p) bool cl::m(const std::shared_ptr<storage::api::c> & p) #define DEF_IMPL_MSG_COMMAND_H(m) _INTERNAL_DEF_IMPL_ON_MC(on##m, m##Command) #define DEF_IMPL_MSG_REPLY_H(m) _INTERNAL_DEF_IMPL_ON_MC(on##m##Reply, m##Reply) @@ -365,4 +365,3 @@ public: } // api } // storage - diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h index 8801916c14b..59ae462432b 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h +++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h @@ -12,16 +12,15 @@ #pragma once #include "messagehandler.h" -#include <map> -#include <vespa/vespalib/util/printable.h> +#include <vespa/storageframework/generic/memory/memorytoken.h> +#include <vespa/documentapi/loadtypes/loadtype.h> #include <vespa/messagebus/routing/route.h> -#include <vespa/vespalib/util/sync.h> -#include <vespa/vdslib/state/nodetype.h> #include <vespa/messagebus/trace.h> -#include <vespa/documentapi/loadtypes/loadtype.h> -#include <vespa/storageframework/generic/memory/memorytoken.h> +#include <vespa/vdslib/state/nodetype.h> #include <vespa/document/bucket/bucketid.h> - +#include <vespa/vespalib/util/printable.h> +#include <vespa/vespalib/util/sync.h> +#include <map> namespace vespalib { class asciistream; |