summaryrefslogtreecommitdiffstats
path: root/documentapi
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-05-30 14:03:14 +0000
committerTor Brede Vekterli <vekterli@oath.com>2018-05-30 14:03:14 +0000
commit2fb0ac0c967e09009d31b7378129bceff62f7ece (patch)
tree187ae000a79ad611ffef30f1c5cdcb00e781bb7e /documentapi
parent6cd4e8945facda874bf1ada7ea8694c2c633f9da (diff)
Hardcode DocumentAPI RemoveLocation bucket space for now
Not present in wire format, so doing a pragmatic workaround until we can bump the protocol version. Should not be too problematic, as using RemoveLocation in the global bucket space sounds like a pretty esoteric use case.
Diffstat (limited to 'documentapi')
-rw-r--r--documentapi/src/tests/messages/messages50test.cpp3
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/documentapi/src/tests/messages/messages50test.cpp b/documentapi/src/tests/messages/messages50test.cpp
index 0346cadbf9b..48728ff6057 100644
--- a/documentapi/src/tests/messages/messages50test.cpp
+++ b/documentapi/src/tests/messages/messages50test.cpp
@@ -7,6 +7,7 @@
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/update/fieldpathupdates.h>
#include <vespa/documentapi/documentapi.h>
+#include <vespa/document/bucket/fixed_bucket_spaces.h>
using document::DataType;
using document::DocumentTypeRepo;
@@ -240,6 +241,8 @@ Messages50Test::testRemoveLocationMessage()
if (EXPECT_TRUE(obj.get() != NULL)) {
RemoveLocationMessage &ref = static_cast<RemoveLocationMessage&>(*obj);
EXPECT_EQUAL(string("id.group == \"mygroup\""), ref.getDocumentSelection());
+ // FIXME add to wire format, currently hardcoded.
+ EXPECT_EQUAL(string(document::FixedBucketSpaces::default_space_name()), ref.getBucketSpace());
}
}
}
diff --git a/documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp b/documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp
index b5a4a8306b1..a73d6901f91 100644
--- a/documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp
+++ b/documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp
@@ -696,7 +696,10 @@ RoutableFactories50::RemoveLocationMessageFactory::doDecode(document::ByteBuffer
document::BucketIdFactory factory;
document::select::Parser parser(_repo, factory);
- return DocumentMessage::UP(new RemoveLocationMessage(factory, parser, selection));
+ auto msg = std::make_unique<RemoveLocationMessage>(factory, parser, selection);
+ // FIXME bucket space not part of wire format, implicitly limiting to only default space for now.
+ msg->setBucketSpace(document::FixedBucketSpaces::default_space_name());
+ return msg;
}
bool