From f777a0c3323d2fad706addb5426e1889f5332e0d Mon Sep 17 00:00:00 2001 From: HÃ¥kon Hallingstad Date: Mon, 23 Oct 2017 20:31:31 +0200 Subject: Revert "Use existing bucket space instead of placeholder value" --- storageapi/src/tests/mbusprot/storageprotocoltest.cpp | 7 ++----- .../src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp | 3 +-- .../src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp | 5 ++--- .../src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp | 3 +-- storageapi/src/vespa/storageapi/message/bucket.cpp | 6 ------ storageapi/src/vespa/storageapi/message/bucket.h | 8 ++------ storageapi/src/vespa/storageapi/message/visitor.cpp | 5 +---- storageapi/src/vespa/storageapi/message/visitor.h | 5 +---- 8 files changed, 10 insertions(+), 32 deletions(-) (limited to 'storageapi') diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp index cb0cf756586..bfd657c2f05 100644 --- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp +++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -31,7 +30,6 @@ using document::DocumentId; using document::DocumentType; using document::DocumentTypeRepo; using document::test::makeDocumentBucket; -using document::test::makeBucketSpace; using storage::lib::ClusterState; using vespalib::string; @@ -391,7 +389,7 @@ StorageProtocolTest::testRequestBucketInfo51() std::vector ids; ids.push_back(document::BucketId(3)); ids.push_back(document::BucketId(7)); - RequestBucketInfoCommand::SP cmd(new RequestBucketInfoCommand(makeBucketSpace(), ids)); + RequestBucketInfoCommand::SP cmd(new RequestBucketInfoCommand(ids)); RequestBucketInfoCommand::SP cmd2(copyCommand(cmd, _version5_1)); CPPUNIT_ASSERT_EQUAL(ids, cmd2->getBuckets()); CPPUNIT_ASSERT(!cmd2->hasSystemState()); @@ -401,7 +399,6 @@ StorageProtocolTest::testRequestBucketInfo51() { ClusterState state("distributor:3 .1.s:d"); RequestBucketInfoCommand::SP cmd(new RequestBucketInfoCommand( - makeBucketSpace(), 3, state, "14")); RequestBucketInfoCommand::SP cmd2(copyCommand(cmd, _version5_1)); CPPUNIT_ASSERT(cmd2->hasSystemState()); @@ -660,7 +657,7 @@ StorageProtocolTest::testCreateVisitor51() buckets.push_back(document::BucketId(16, 2)); CreateVisitorCommand::SP cmd( - new CreateVisitorCommand(makeBucketSpace(), "library", "id", "doc selection")); + new CreateVisitorCommand("library", "id", "doc selection")); cmd->setControlDestination("controldest"); cmd->setDataDestination("datadest"); cmd->setVisitorCmdId(1); diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp index e4993a1ee7b..d207b307593 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp @@ -562,12 +562,11 @@ ProtocolSerialization4_2::onEncode( api::StorageCommand::UP ProtocolSerialization4_2::onDecodeCreateVisitorCommand(BBuf& buf) const { - BucketSpace bucketSpace(BucketSpace::placeHolder()); vespalib::stringref libraryName = SH::getString(buf); vespalib::stringref instanceId = SH::getString(buf); vespalib::stringref selection = SH::getString(buf); api::CreateVisitorCommand::UP msg( - new api::CreateVisitorCommand(bucketSpace, libraryName, instanceId, selection)); + new api::CreateVisitorCommand(libraryName, instanceId, selection)); msg->setVisitorCmdId(SH::getInt(buf)); msg->setControlDestination(SH::getString(buf)); msg->setDataDestination(SH::getString(buf)); diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp index 22f58ebc58b..2bd160b1aab 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp @@ -638,13 +638,12 @@ ProtocolSerialization5_0::onDecodeRequestBucketInfoCommand(BBuf& buf) const buckets[i] = document::BucketId(SH::getLong(buf)); } api::RequestBucketInfoCommand::UP msg; - BucketSpace bucketSpace(BucketSpace::placeHolder()); if (buckets.size() != 0) { - msg.reset(new api::RequestBucketInfoCommand(bucketSpace, buckets)); + msg.reset(new api::RequestBucketInfoCommand(buckets)); } else { int distributor = SH::getShort(buf); lib::ClusterState state(SH::getString(buf)); - msg.reset(new api::RequestBucketInfoCommand(bucketSpace, distributor, state, SH::getString(buf))); + msg.reset(new api::RequestBucketInfoCommand(distributor, state, SH::getString(buf))); } onDecodeCommand(buf, *msg); return api::StorageCommand::UP(msg.release()); diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp index dc97742b733..4f84eff0ab8 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp @@ -161,12 +161,11 @@ ProtocolSerialization5_1::onEncode( api::StorageCommand::UP ProtocolSerialization5_1::onDecodeCreateVisitorCommand(BBuf& buf) const { - BucketSpace bucketSpace(BucketSpace::placeHolder()); vespalib::stringref libraryName = SH::getString(buf); vespalib::stringref instanceId = SH::getString(buf); vespalib::stringref selection = SH::getString(buf); api::CreateVisitorCommand::UP msg( - new api::CreateVisitorCommand(bucketSpace, libraryName, instanceId, selection)); + new api::CreateVisitorCommand(libraryName, instanceId, selection)); msg->setVisitorCmdId(SH::getInt(buf)); msg->setControlDestination(SH::getString(buf)); msg->setDataDestination(SH::getString(buf)); diff --git a/storageapi/src/vespa/storageapi/message/bucket.cpp b/storageapi/src/vespa/storageapi/message/bucket.cpp index 18ad95c2c02..983a65114b3 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.cpp +++ b/storageapi/src/vespa/storageapi/message/bucket.cpp @@ -440,10 +440,8 @@ ApplyBucketDiffReply::print(std::ostream& out, bool verbose, } RequestBucketInfoCommand::RequestBucketInfoCommand( - document::BucketSpace bucketSpace, const std::vector& buckets) : StorageCommand(MessageType::REQUESTBUCKETINFO), - _bucketSpace(bucketSpace), _buckets(buckets), _state(), _distributor(0xFFFF) @@ -451,11 +449,9 @@ RequestBucketInfoCommand::RequestBucketInfoCommand( } RequestBucketInfoCommand::RequestBucketInfoCommand( - document::BucketSpace bucketSpace, uint16_t distributor, const lib::ClusterState& state, const vespalib::stringref & distributionHash) : StorageCommand(MessageType::REQUESTBUCKETINFO), - _bucketSpace(bucketSpace), _buckets(), _state(new lib::ClusterState(state)), _distributor(distributor), @@ -464,10 +460,8 @@ RequestBucketInfoCommand::RequestBucketInfoCommand( } RequestBucketInfoCommand::RequestBucketInfoCommand( - document::BucketSpace bucketSpace, uint16_t distributor, const lib::ClusterState& state) : StorageCommand(MessageType::REQUESTBUCKETINFO), - _bucketSpace(bucketSpace), _buckets(), _state(new lib::ClusterState(state)), _distributor(distributor), diff --git a/storageapi/src/vespa/storageapi/message/bucket.h b/storageapi/src/vespa/storageapi/message/bucket.h index 0c97772d184..d2bf97e7768 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.h +++ b/storageapi/src/vespa/storageapi/message/bucket.h @@ -336,7 +336,6 @@ public: * the buckets that belong to the given distributor should be returned. */ class RequestBucketInfoCommand : public StorageCommand { - document::BucketSpace _bucketSpace; std::vector _buckets; std::unique_ptr _state; uint16_t _distributor; @@ -344,15 +343,12 @@ class RequestBucketInfoCommand : public StorageCommand { public: explicit RequestBucketInfoCommand( - document::BucketSpace bucketSpace, const std::vector& buckets); - RequestBucketInfoCommand(document::BucketSpace bucketSpace, - uint16_t distributor, + RequestBucketInfoCommand(uint16_t distributor, const lib::ClusterState& state, const vespalib::stringref & _distributionHash); - RequestBucketInfoCommand(document::BucketSpace bucketSpace, - uint16_t distributor, + RequestBucketInfoCommand(uint16_t distributor, const lib::ClusterState& state); const std::vector& getBuckets() const { return _buckets; } diff --git a/storageapi/src/vespa/storageapi/message/visitor.cpp b/storageapi/src/vespa/storageapi/message/visitor.cpp index 7b5a614bd3e..8c10eb501b2 100644 --- a/storageapi/src/vespa/storageapi/message/visitor.cpp +++ b/storageapi/src/vespa/storageapi/message/visitor.cpp @@ -13,12 +13,10 @@ IMPLEMENT_REPLY(DestroyVisitorReply) IMPLEMENT_COMMAND(VisitorInfoCommand, VisitorInfoReply) IMPLEMENT_REPLY(VisitorInfoReply) -CreateVisitorCommand::CreateVisitorCommand(document::BucketSpace bucketSpace, - const vespalib::stringref & libraryName, +CreateVisitorCommand::CreateVisitorCommand(const vespalib::stringref & libraryName, const vespalib::stringref & instanceId, const vespalib::stringref & docSelection) : StorageCommand(MessageType::VISITOR_CREATE), - _bucketSpace(bucketSpace), _libName(libraryName), _params(), _controlDestination(), @@ -43,7 +41,6 @@ CreateVisitorCommand::CreateVisitorCommand(document::BucketSpace bucketSpace, CreateVisitorCommand::CreateVisitorCommand(const CreateVisitorCommand& o) : StorageCommand(o), - _bucketSpace(o._bucketSpace), _libName(o._libName), _params(o._params), _controlDestination(o._controlDestination), diff --git a/storageapi/src/vespa/storageapi/message/visitor.h b/storageapi/src/vespa/storageapi/message/visitor.h index f252ecd344f..3d659831351 100644 --- a/storageapi/src/vespa/storageapi/message/visitor.h +++ b/storageapi/src/vespa/storageapi/message/visitor.h @@ -26,7 +26,6 @@ namespace api { */ class CreateVisitorCommand : public StorageCommand { private: - document::BucketSpace _bucketSpace; vespalib::string _libName; // Name of visitor library to use, ie. DumpVisitor.so vdslib::Parameters _params; @@ -54,8 +53,7 @@ private: uint32_t _maxBucketsPerVisitor; public: - CreateVisitorCommand(document::BucketSpace bucketSpace, - const vespalib::stringref & libraryName, + CreateVisitorCommand(const vespalib::stringref & libraryName, const vespalib::stringref & instanceId, const vespalib::stringref & docSelection); @@ -85,7 +83,6 @@ public: VisitorId getVisitorId() const { return _visitorId; } uint32_t getVisitorCmdId() const { return _visitorCmdId; } - document::BucketSpace getBucketSpace() const { return _bucketSpace; } const vespalib::string & getLibraryName() const { return _libName; } const vespalib::string & getInstanceId() const { return _instanceId; } const vespalib::string & getControlDestination() const -- cgit v1.2.3