aboutsummaryrefslogtreecommitdiffstats
path: root/storageapi
diff options
context:
space:
mode:
authorHÃ¥kon Hallingstad <hakon@oath.com>2017-10-23 20:31:31 +0200
committerGitHub <noreply@github.com>2017-10-23 20:31:31 +0200
commitf777a0c3323d2fad706addb5426e1889f5332e0d (patch)
tree7532bba6326061e0294acb468cab96e42ee52e3c /storageapi
parent0d7ce451d2d4cda2ee6938573d130bd3ccff092b (diff)
Revert "Use existing bucket space instead of placeholder value"
Diffstat (limited to 'storageapi')
-rw-r--r--storageapi/src/tests/mbusprot/storageprotocoltest.cpp7
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp3
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp5
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp3
-rw-r--r--storageapi/src/vespa/storageapi/message/bucket.cpp6
-rw-r--r--storageapi/src/vespa/storageapi/message/bucket.h8
-rw-r--r--storageapi/src/vespa/storageapi/message/visitor.cpp5
-rw-r--r--storageapi/src/vespa/storageapi/message/visitor.h5
8 files changed, 10 insertions, 32 deletions
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 <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/update/fieldpathupdates.h>
#include <vespa/document/test/make_document_bucket.h>
-#include <vespa/document/test/make_bucket_space.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/util/growablebytebuffer.h>
#include <vespa/vespalib/objects/nbostream.h>
@@ -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<document::BucketId> 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<document::BucketId>& 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<document::BucketId> _buckets;
std::unique_ptr<lib::ClusterState> _state;
uint16_t _distributor;
@@ -344,15 +343,12 @@ class RequestBucketInfoCommand : public StorageCommand {
public:
explicit RequestBucketInfoCommand(
- document::BucketSpace bucketSpace,
const std::vector<document::BucketId>& 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<document::BucketId>& 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