aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--document/src/tests/fieldsettest.cpp28
-rw-r--r--document/src/vespa/document/fieldset/fieldsetrepo.cpp7
-rw-r--r--documentapi/src/tests/policies/policies_test.cpp8
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.cpp14
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.h28
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/messages/visitor.cpp5
-rw-r--r--storage/src/tests/distributor/distributortest.cpp3
-rw-r--r--storage/src/tests/distributor/externaloperationhandlertest.cpp5
-rw-r--r--storage/src/tests/distributor/getoperationtest.cpp3
-rw-r--r--storage/src/tests/distributor/twophaseupdateoperationtest.cpp10
-rw-r--r--storage/src/tests/distributor/visitoroperationtest.cpp10
-rw-r--r--storage/src/tests/persistence/common/filestortestfixture.cpp4
-rw-r--r--storage/src/tests/persistence/filestorage/filestormanagertest.cpp16
-rw-r--r--storage/src/tests/persistence/persistencequeuetest.cpp7
-rw-r--r--storage/src/tests/persistence/testandsettest.cpp3
-rw-r--r--storage/src/tests/storageserver/bouncertest.cpp3
-rw-r--r--storage/src/tests/storageserver/communicationmanagertest.cpp6
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp7
-rw-r--r--storage/src/vespa/storage/visiting/visitor.cpp3
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp13
-rw-r--r--storageapi/src/vespa/storageapi/message/visitor.cpp4
21 files changed, 84 insertions, 103 deletions
diff --git a/document/src/tests/fieldsettest.cpp b/document/src/tests/fieldsettest.cpp
index f77bd9bfb09..b82cca86ce7 100644
--- a/document/src/tests/fieldsettest.cpp
+++ b/document/src/tests/fieldsettest.cpp
@@ -40,9 +40,9 @@ TEST_F(FieldSetTest, testParsing)
FieldSetRepo repo;
- (void) dynamic_cast<AllFields&>(*repo.parse(docRepo, "[all]"));
- (void) dynamic_cast<NoFields&>(*repo.parse(docRepo, "[none]"));
- (void) dynamic_cast<DocIdOnly&>(*repo.parse(docRepo, "[id]"));
+ (void) dynamic_cast<AllFields&>(*repo.parse(docRepo, AllFields::NAME));
+ (void) dynamic_cast<NoFields&>(*repo.parse(docRepo, NoFields::NAME));
+ (void) dynamic_cast<DocIdOnly&>(*repo.parse(docRepo, DocIdOnly::NAME));
FieldSet::UP set = repo.parse(docRepo, "testdoctype1:headerval,content");
FieldCollection& coll = dynamic_cast<FieldCollection&>(*set);
@@ -195,11 +195,11 @@ TEST_F(FieldSetTest, testCopyDocumentFields)
Document::UP src(createTestDocument(testDocMan));
EXPECT_EQ(std::string(""),
- doCopyFields(*src, repo, "[none]"));
+ doCopyFields(*src, repo, NoFields::NAME));
EXPECT_EQ(std::string("content: megafoo megabar\n"
"headerval: 5678\n"
"hstringval: hello fantastic world\n"),
- doCopyFields(*src, repo, "[all]"));
+ doCopyFields(*src, repo, AllFields::NAME));
EXPECT_EQ(std::string("content: megafoo megabar\n"
"hstringval: hello fantastic world\n"),
doCopyFields(*src, repo, "testdoctype1:hstringval,content"));
@@ -236,13 +236,13 @@ TEST_F(FieldSetTest, testDocumentSubsetCopy)
EXPECT_TRUE(doc.get());
EXPECT_EQ(src->getId(), doc->getId());
EXPECT_EQ(src->getType(), doc->getType());
- EXPECT_EQ(doCopyFields(*src, repo, "[all]"),
+ EXPECT_EQ(doCopyFields(*src, repo, AllFields::NAME),
stringifyFields(*doc));
}
const char* fieldSets[] = {
- "[all]",
- "[none]",
+ AllFields::NAME,
+ NoFields::NAME,
"testdoctype1:hstringval,content"
};
for (size_t i = 0; i < sizeof(fieldSets) / sizeof(fieldSets[0]); ++i) {
@@ -257,9 +257,9 @@ TEST_F(FieldSetTest, testSerialize)
const DocumentTypeRepo& docRepo = testDocMan.getTypeRepo();
const char* fieldSets[] = {
- "[all]",
- "[none]",
- "[docid]",
+ AllFields::NAME,
+ NoFields::NAME,
+ DocIdOnly::NAME,
"testdoctype1:content",
"testdoctype1:content,hstringval"
};
@@ -278,13 +278,13 @@ TEST_F(FieldSetTest, testStripFields)
Document::UP src(createTestDocument(testDocMan));
EXPECT_EQ(std::string(""),
- doStripFields(*src, repo, "[none]"));
+ doStripFields(*src, repo, NoFields::NAME));
EXPECT_EQ(std::string(""),
- doStripFields(*src, repo, "[id]"));
+ doStripFields(*src, repo, DocIdOnly::NAME));
EXPECT_EQ(std::string("content: megafoo megabar\n"
"headerval: 5678\n"
"hstringval: hello fantastic world\n"),
- doStripFields(*src, repo, "[all]"));
+ doStripFields(*src, repo, AllFields::NAME));
EXPECT_EQ(std::string("content: megafoo megabar\n"
"hstringval: hello fantastic world\n"),
doStripFields(*src, repo, "testdoctype1:hstringval,content"));
diff --git a/document/src/vespa/document/fieldset/fieldsetrepo.cpp b/document/src/vespa/document/fieldset/fieldsetrepo.cpp
index c7d91ec5175..e3212f3bd25 100644
--- a/document/src/vespa/document/fieldset/fieldsetrepo.cpp
+++ b/document/src/vespa/document/fieldset/fieldsetrepo.cpp
@@ -85,7 +85,6 @@ FieldSetRepo::serialize(const FieldSet& fieldSet)
switch (fieldSet.getType()) {
case FieldSet::FIELD:
return static_cast<const Field&>(fieldSet).getName();
- break;
case FieldSet::SET:
{
const FieldCollection& collection = static_cast<const FieldCollection&>(fieldSet);
@@ -105,11 +104,11 @@ FieldSetRepo::serialize(const FieldSet& fieldSet)
return stream.str();
}
case FieldSet::ALL:
- return "[all]";
+ return AllFields::NAME;
case FieldSet::NONE:
- return "[none]";
+ return NoFields::NAME;
case FieldSet::DOCID:
- return "[docid]";
+ return DocIdOnly::NAME;
default:
return "";
}
diff --git a/documentapi/src/tests/policies/policies_test.cpp b/documentapi/src/tests/policies/policies_test.cpp
index 0f0b9bd4504..61a8618556b 100644
--- a/documentapi/src/tests/policies/policies_test.cpp
+++ b/documentapi/src/tests/policies/policies_test.cpp
@@ -329,7 +329,7 @@ Test::testExternSend()
mbus::DestinationSession::UP ds = dst.mb.createDestinationSession("session", true, dr);
// Send message from local node to remote cluster and resolve route there.
- mbus::Message::UP msg(new GetDocumentMessage(DocumentId("id:ns:testdoc::"), 0));
+ mbus::Message::UP msg = std::make_unique<GetDocumentMessage>(DocumentId("id:ns:testdoc::"));
msg->getTrace().setLevel(9);
msg->setRoute(mbus::Route::parse(vespalib::make_string("[Extern:tcp/localhost:%d;itr/session] default", slobrok.port())));
@@ -365,7 +365,7 @@ Test::testExternMultipleSlobroks()
std::make_shared<DocumentProtocol>(_loadTypes, _repo));
mbus::DestinationSession::UP ds = dst.mb.createDestinationSession("session", true, dr);
- mbus::Message::UP msg(new GetDocumentMessage(DocumentId("id:ns:testdoc::"), 0));
+ mbus::Message::UP msg = std::make_unique<GetDocumentMessage>(DocumentId("id:ns:testdoc::"));
msg->setRoute(mbus::Route::parse(vespalib::make_string("[Extern:%s;dst/session]", spec.c_str())));
ASSERT_TRUE(ss->send(std::move(msg)).isAccepted());
ASSERT_TRUE((msg = dr.getMessage(TIMEOUT)));
@@ -381,7 +381,7 @@ Test::testExternMultipleSlobroks()
std::make_shared<DocumentProtocol>(_loadTypes, _repo));
mbus::DestinationSession::UP ds = dst.mb.createDestinationSession("session", true, dr);
- mbus::Message::UP msg(new GetDocumentMessage(DocumentId("id:ns:testdoc::"), 0));
+ mbus::Message::UP msg = std::make_unique<GetDocumentMessage>(DocumentId("id:ns:testdoc::"));
msg->setRoute(mbus::Route::parse(vespalib::make_string("[Extern:%s;dst/session]", spec.c_str())));
ASSERT_TRUE(ss->send(std::move(msg)).isAccepted());
ASSERT_TRUE((msg = dr.getMessage(TIMEOUT)));
@@ -615,7 +615,7 @@ Test::testDocumentRouteSelector()
.addRecipient("foo")
.addRecipient("bar"));
- frame.setMessage(make_unique<GetDocumentMessage>(DocumentId("id:ns:testdoc::"), 0));
+ frame.setMessage(make_unique<GetDocumentMessage>(DocumentId("id:ns:testdoc::")));
EXPECT_TRUE(frame.testSelect(StringList().add("foo")));
mbus::Message::UP put = make_unique<PutDocumentMessage>(make_shared<Document>(*_docType, DocumentId("id:ns:testdoc::")));
diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.cpp
index 821af8e256b..acc3e61843e 100644
--- a/documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.cpp
+++ b/documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.cpp
@@ -3,20 +3,21 @@
#include "getdocumentmessage.h"
#include "getdocumentreply.h"
#include <vespa/documentapi/messagebus/documentprotocol.h>
+#include <vespa/document/fieldset/fieldsets.h>
namespace documentapi {
GetDocumentMessage::GetDocumentMessage() :
DocumentMessage(),
_documentId(),
- _fieldSet("[all]")
+ _fieldSet(document::AllFields::NAME)
{}
-GetDocumentMessage::GetDocumentMessage(const document::DocumentId &documentId, int flags) :
+GetDocumentMessage::GetDocumentMessage(const document::DocumentId &documentId) :
DocumentMessage(),
- _documentId(documentId)
+ _documentId(documentId),
+ _fieldSet(document::AllFields::NAME)
{
- setFlags(flags);
}
GetDocumentMessage::GetDocumentMessage(const document::DocumentId &documentId,
@@ -27,13 +28,12 @@ GetDocumentMessage::GetDocumentMessage(const document::DocumentId &documentId,
{
}
-GetDocumentMessage::~GetDocumentMessage() {
-}
+GetDocumentMessage::~GetDocumentMessage() = default;
DocumentReply::UP
GetDocumentMessage::doCreateReply() const
{
- return DocumentReply::UP(new GetDocumentReply());
+ return std::make_unique<GetDocumentReply>();
}
uint32_t
diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.h b/documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.h
index 619367faf4d..d157b68c4ed 100644
--- a/documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.h
+++ b/documentapi/src/vespa/documentapi/messagebus/messages/getdocumentmessage.h
@@ -21,11 +21,6 @@ public:
typedef std::unique_ptr<GetDocumentMessage> UP;
typedef std::shared_ptr<GetDocumentMessage> SP;
- enum {
- FLAG_NONE = 0,
- FLAG_ONLY_HEADER = 1
- };
-
/**
* Constructs a new message for deserialization.
*/
@@ -35,9 +30,8 @@ public:
* Constructs a new document get message.
*
* @param documentId The identifier of the document to retrieve.
- * @param flags How to retrieve the document.
*/
- GetDocumentMessage(const document::DocumentId &documentId, int flags = 0);
+ explicit GetDocumentMessage(const document::DocumentId &documentId);
/**
* Constructs a new document get message.
@@ -45,8 +39,7 @@ public:
* @param documentId The identifier of the document to retrieve.
* @param fieldSet The fields to retrieve (comma-separated)
*/
- GetDocumentMessage(const document::DocumentId &documentId,
- vespalib::stringref fieldSet);
+ GetDocumentMessage(const document::DocumentId &documentId, vespalib::stringref fieldSet);
~GetDocumentMessage();
@@ -65,23 +58,6 @@ public:
void setDocumentId(const document::DocumentId &documentId);
/**
- * Returs the storage flags of this message.
- *
- * @return The storage flags.
- */
- int getFlags() const { return (_fieldSet == "[header]" ? FLAG_ONLY_HEADER :
- FLAG_NONE); };
-
- /**
- * Sets the storage flags of this message.
- *
- * @param flags The flags to set.
- */
- void setFlags(int flags) {
- _fieldSet = (flags == FLAG_ONLY_HEADER) ? "[header]" : "[all]";
- }
-
- /**
* Returns the fields to be retrieved by the get.
*/
const string& getFieldSet() const { return _fieldSet; }
diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/visitor.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/visitor.cpp
index 453e93fd7eb..26e5344df2d 100644
--- a/documentapi/src/vespa/documentapi/messagebus/messages/visitor.cpp
+++ b/documentapi/src/vespa/documentapi/messagebus/messages/visitor.cpp
@@ -5,6 +5,7 @@
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/growablebytebuffer.h>
#include <vespa/document/util/bytebuffer.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <climits>
using document::FixedBucketSpaces;
@@ -24,7 +25,7 @@ CreateVisitorMessage::CreateVisitorMessage() :
_fromTime(0),
_toTime(0),
_visitRemoves(false),
- _fieldSet("[all]"),
+ _fieldSet(document::AllFields::NAME),
_visitInconsistentBuckets(false),
_params(),
_version(42),
@@ -47,7 +48,7 @@ CreateVisitorMessage::CreateVisitorMessage(const string& libraryName,
_fromTime(0),
_toTime(0),
_visitRemoves(false),
- _fieldSet("[all]"),
+ _fieldSet(document::AllFields::NAME),
_visitInconsistentBuckets(false),
_params(),
_version(42),
diff --git a/storage/src/tests/distributor/distributortest.cpp b/storage/src/tests/distributor/distributortest.cpp
index 0da860d0542..dc0a01448af 100644
--- a/storage/src/tests/distributor/distributortest.cpp
+++ b/storage/src/tests/distributor/distributortest.cpp
@@ -8,6 +8,7 @@
#include <vespa/storageframework/defaultimplementation/thread/threadpoolimpl.h>
#include <tests/distributor/distributortestutil.h>
#include <vespa/document/bucket/fixed_bucket_spaces.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/document/test/make_document_bucket.h>
#include <vespa/document/test/make_bucket_space.h>
#include <vespa/storage/config/config-stor-distributormanager.h>
@@ -755,7 +756,7 @@ auto make_dummy_get_command_for_bucket_1() {
return std::make_shared<api::GetCommand>(
makeDocumentBucket(document::BucketId(0)),
document::DocumentId("id:foo:testdoctype1:n=1:foo"),
- "[all]");
+ document::AllFields::NAME);
}
}
diff --git a/storage/src/tests/distributor/externaloperationhandlertest.cpp b/storage/src/tests/distributor/externaloperationhandlertest.cpp
index 03ba148277e..1f0fba90200 100644
--- a/storage/src/tests/distributor/externaloperationhandlertest.cpp
+++ b/storage/src/tests/distributor/externaloperationhandlertest.cpp
@@ -8,6 +8,7 @@
#include <vespa/storageapi/message/persistence.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/update/documentupdate.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/document/test/make_document_bucket.h>
#include <vespa/vespalib/gtest/gtest.h>
@@ -157,13 +158,13 @@ ExternalOperationHandlerTest::findOwned1stNotOwned2ndInStates(
std::shared_ptr<api::GetCommand>
ExternalOperationHandlerTest::makeGetCommand(const vespalib::string& id) const {
- return std::make_shared<api::GetCommand>(makeDocumentBucket(document::BucketId(0)), DocumentId(id), "[all]");
+ return std::make_shared<api::GetCommand>(makeDocumentBucket(document::BucketId(0)), DocumentId(id), document::AllFields::NAME);
}
std::shared_ptr<api::GetCommand>
ExternalOperationHandlerTest::makeGetCommandForUser(uint64_t id) const {
DocumentId docId(vespalib::make_string("id:foo:test:n=%" PRIu64 ":bar", id));
- return std::make_shared<api::GetCommand>(makeDocumentBucket(document::BucketId(0)), docId, "[all]");
+ return std::make_shared<api::GetCommand>(makeDocumentBucket(document::BucketId(0)), docId, document::AllFields::NAME);
}
std::shared_ptr<api::UpdateCommand> ExternalOperationHandlerTest::makeUpdateCommand(
diff --git a/storage/src/tests/distributor/getoperationtest.cpp b/storage/src/tests/distributor/getoperationtest.cpp
index d4d14314790..09e4f41d275 100644
--- a/storage/src/tests/distributor/getoperationtest.cpp
+++ b/storage/src/tests/distributor/getoperationtest.cpp
@@ -3,6 +3,7 @@
#include <vespa/config/helper/configgetter.h>
#include <vespa/document/config/config-documenttypes.h>
#include <vespa/document/repo/documenttyperepo.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/storage/bucketdb/bucketdatabase.h>
#include <vespa/storage/distributor/distributor_bucket_space.h>
#include <vespa/storage/distributor/externaloperationhandler.h>
@@ -53,7 +54,7 @@ struct GetOperationTest : Test, DistributorTestUtil {
}
void sendGet(api::InternalReadConsistency consistency = api::InternalReadConsistency::Strong) {
- auto msg = std::make_shared<api::GetCommand>(makeDocumentBucket(BucketId(0)), docId, "[all]");
+ auto msg = std::make_shared<api::GetCommand>(makeDocumentBucket(BucketId(0)), docId, document::AllFields::NAME);
op = std::make_unique<GetOperation>(
getExternalOperationHandler(), getDistributorBucketSpace(),
getDistributorBucketSpace().getBucketDatabase().acquire_read_guard(),
diff --git a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
index e42e7684f81..635e5b9883b 100644
--- a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
+++ b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
@@ -1,18 +1,16 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/config/helper/configgetter.h>
-#include <vespa/document/config/config-documenttypes.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/base/testdocrepo.h>
#include <vespa/document/update/arithmeticvalueupdate.h>
-#include <iomanip>
-#include <tests/common/dummystoragelink.h>
#include <vespa/storage/distributor/externaloperationhandler.h>
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storage/distributor/operations/external/twophaseupdateoperation.h>
#include <tests/distributor/distributortestutil.h>
#include <vespa/document/test/make_document_bucket.h>
#include <vespa/storage/distributor/distributor.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <gmock/gmock.h>
@@ -1100,13 +1098,13 @@ TEST_F(ThreePhaseUpdateTest, metadata_only_gets_are_sent_if_3phase_update_enable
ASSERT_EQ("Get => 0,Get => 1", _sender.getCommands(true));
{
auto& get_cmd = dynamic_cast<const api::GetCommand&>(*_sender.command(0));
- EXPECT_EQ("[none]", get_cmd.getFieldSet());
+ EXPECT_EQ(document::NoFields::NAME, get_cmd.getFieldSet());
EXPECT_EQ(get_cmd.internal_read_consistency(), api::InternalReadConsistency::Weak);
checkMessageSettingsPropagatedTo(_sender.command(0));
}
{
auto& get_cmd = dynamic_cast<const api::GetCommand&>(*_sender.command(1));
- EXPECT_EQ("[none]", get_cmd.getFieldSet());
+ EXPECT_EQ(document::NoFields::NAME, get_cmd.getFieldSet());
EXPECT_EQ(get_cmd.internal_read_consistency(), api::InternalReadConsistency::Weak);
checkMessageSettingsPropagatedTo(_sender.command(1));
}
@@ -1125,7 +1123,7 @@ TEST_F(ThreePhaseUpdateTest, full_document_get_sent_to_replica_with_highest_time
ASSERT_EQ("Get => 1", _sender.getCommands(true, false, 2));
{
auto& get_cmd = dynamic_cast<const api::GetCommand&>(*_sender.command(2));
- EXPECT_EQ("[all]", get_cmd.getFieldSet());
+ EXPECT_EQ(document::AllFields::NAME, get_cmd.getFieldSet());
EXPECT_EQ(get_cmd.internal_read_consistency(), api::InternalReadConsistency::Strong);
}
}
diff --git a/storage/src/tests/distributor/visitoroperationtest.cpp b/storage/src/tests/distributor/visitoroperationtest.cpp
index 5d7871376cb..8a9d8063525 100644
--- a/storage/src/tests/distributor/visitoroperationtest.cpp
+++ b/storage/src/tests/distributor/visitoroperationtest.cpp
@@ -9,11 +9,9 @@
#include <vespa/storage/distributor/distributormetricsset.h>
#include <tests/distributor/distributortestutil.h>
#include <vespa/storage/distributor/distributor.h>
-#include <tests/common/dummystoragelink.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/document/test/make_bucket_space.h>
#include <vespa/vespalib/gtest/gtest.h>
-#include <gmock/gmock.h>
-#include <ostream>
using namespace document;
using namespace storage::api;
@@ -57,7 +55,7 @@ struct VisitorOperationTest : Test, DistributorTestUtil {
makeBucketSpace(), libraryName, instanceId, docSelection);
cmd->setControlDestination("controldestination");
cmd->setDataDestination("datadestination");
- cmd->setFieldSet("[header]");
+ cmd->setFieldSet(document::AllFields::NAME);
if (visitRemoves) {
cmd->setVisitRemoves();
}
@@ -176,7 +174,7 @@ VisitorOperationTest::doStandardVisitTest(const std::string& clusterState)
msg->setToTime(0);
msg->addBucketToBeVisited(id);
msg->addBucketToBeVisited(nullId);
- msg->setFieldSet("[header]");
+ msg->setFieldSet(document::AllFields::NAME);
msg->setVisitRemoves();
msg->setTimeout(1234ms);
msg->getTrace().setLevel(7);
@@ -201,7 +199,7 @@ VisitorOperationTest::doStandardVisitTest(const std::string& clusterState)
EXPECT_EQ(1, cvc->getBuckets().size());
EXPECT_EQ(api::Timestamp(10), cvc->getFromTime());
EXPECT_GT(cvc->getToTime(), 0);
- EXPECT_EQ("[header]", cvc->getFieldSet());
+ EXPECT_EQ(document::AllFields::NAME, cvc->getFieldSet());
EXPECT_TRUE(cvc->visitRemoves());
EXPECT_EQ(1234ms, cvc->getTimeout());
EXPECT_EQ(7, cvc->getTrace().getLevel());
diff --git a/storage/src/tests/persistence/common/filestortestfixture.cpp b/storage/src/tests/persistence/common/filestortestfixture.cpp
index 63b7885fc53..352f1326463 100644
--- a/storage/src/tests/persistence/common/filestortestfixture.cpp
+++ b/storage/src/tests/persistence/common/filestortestfixture.cpp
@@ -5,6 +5,7 @@
#include <vespa/persistence/dummyimpl/dummypersistence.h>
#include <tests/persistence/common/filestortestfixture.h>
#include <vespa/document/repo/documenttyperepo.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/document/test/make_document_bucket.h>
#include <vespa/persistence/spi/test.h>
#include <sstream>
@@ -96,8 +97,7 @@ FileStorTestFixture::TestFileStorComponents::sendDummyGet(
{
std::ostringstream id;
id << "id:foo:testdoctype1:n=" << bid.getId() << ":0";
- std::shared_ptr<api::GetCommand> cmd(
- new api::GetCommand(makeDocumentBucket(bid), document::DocumentId(id.str()), "[all]"));
+ auto cmd = std::make_shared<api::GetCommand>(makeDocumentBucket(bid), document::DocumentId(id.str()), document::AllFields::NAME);
cmd->setAddress(makeSelfAddress());
cmd->setPriority(255);
top.sendDown(cmd);
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
index 3407b77d698..b7f2cb81956 100644
--- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
+++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
@@ -6,6 +6,7 @@
#include <tests/persistence/filestorage/forwardingmessagesender.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/storage/storageserver/statemanager.h>
#include <vespa/storage/bucketdb/bucketmanager.h>
#include <vespa/storage/persistence/persistencethread.h>
@@ -20,7 +21,6 @@
#include <vespa/persistence/spi/test.h>
#include <vespa/config/common/exceptions.h>
#include <vespa/fastos/file.h>
-#include <vespa/vespalib/util/time.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <atomic>
#include <thread>
@@ -281,7 +281,7 @@ TEST_F(FileStorManagerTest, header_only_put) {
}
// Getting it
{
- auto cmd = std::make_shared<api::GetCommand>(makeDocumentBucket(bid), doc->getId(), "[all]");
+ auto cmd = std::make_shared<api::GetCommand>(makeDocumentBucket(bid), doc->getId(), document::AllFields::NAME);
cmd->setAddress(address);
top.sendDown(cmd);
top.waitForMessages(1, _waitTime);
@@ -870,7 +870,7 @@ TEST_F(FileStorManagerTest, split1) {
document::BucketId bucket(
17, i % 3 == 0 ? 0x10001 : 0x0100001);
auto cmd = std::make_shared<api::GetCommand>(
- makeDocumentBucket(bucket), documents[i]->getId(), "[all]");
+ makeDocumentBucket(bucket), documents[i]->getId(), document::AllFields::NAME);
api::StorageMessageAddress address("storage", lib::NodeType::STORAGE, 3);
cmd->setAddress(address);
filestorHandler.schedule(cmd, 0);
@@ -906,7 +906,7 @@ TEST_F(FileStorManagerTest, split1) {
documents[i]->getId()).getRawId());
}
auto cmd = std::make_shared<api::GetCommand>(
- makeDocumentBucket(bucket), documents[i]->getId(), "[all]");
+ makeDocumentBucket(bucket), documents[i]->getId(), document::AllFields::NAME);
api::StorageMessageAddress address("storage", lib::NodeType::STORAGE, 3);
cmd->setAddress(address);
filestorHandler.schedule(cmd, 0);
@@ -993,7 +993,7 @@ TEST_F(FileStorManagerTest, split_single_group) {
for (uint32_t i=0; i<documents.size(); ++i) {
document::BucketId bucket(17, state ? 0x10001 : 0x00001);
auto cmd = std::make_shared<api::GetCommand>
- (makeDocumentBucket(bucket), documents[i]->getId(), "[all]");
+ (makeDocumentBucket(bucket), documents[i]->getId(), document::AllFields::NAME);
api::StorageMessageAddress address("storage", lib::NodeType::STORAGE, 3);
cmd->setAddress(address);
filestorHandler.schedule(cmd, 0);
@@ -1221,7 +1221,7 @@ TEST_F(FileStorManagerTest, join) {
for (uint32_t i=0; i<documents.size(); ++i) {
document::BucketId bucket(16, 1);
auto cmd = std::make_shared<api::GetCommand>(
- makeDocumentBucket(bucket), documents[i]->getId(), "[all]");
+ makeDocumentBucket(bucket), documents[i]->getId(), document::AllFields::NAME);
api::StorageMessageAddress address("storage", lib::NodeType::STORAGE, 3);
cmd->setAddress(address);
filestorHandler.schedule(cmd, 0);
@@ -1255,7 +1255,7 @@ createIterator(DummyStorageLink& link,
selection.setToTimestamp(spi::Timestamp(toTime.getTime()));
auto createIterCmd = std::make_shared<CreateIteratorCommand>(
makeDocumentBucket(bucket), selection,
- "[all]",
+ document::AllFields::NAME,
spi::NEWEST_DOCUMENT_ONLY);
link.sendDown(createIterCmd);
link.waitForMessages(1, FileStorManagerTest::LONG_WAITTIME);
@@ -2044,7 +2044,7 @@ TEST_F(FileStorManagerTest, get_command_size_is_added_to_metric) {
document::BucketId bucket(16, 4000);
createBucket(bucket, 0);
auto cmd = std::make_shared<api::GetCommand>(
- makeDocumentBucket(bucket), document::DocumentId("id:foo:testdoctype1::bar"), "[all]");
+ makeDocumentBucket(bucket), document::DocumentId("id:foo:testdoctype1::bar"), document::AllFields::NAME);
assert_request_size_set(c, std::move(cmd), thread_metrics_of(*c.manager)->get[defaultLoadType]);
}
diff --git a/storage/src/tests/persistence/persistencequeuetest.cpp b/storage/src/tests/persistence/persistencequeuetest.cpp
index 3754a82e7ae..289d5462203 100644
--- a/storage/src/tests/persistence/persistencequeuetest.cpp
+++ b/storage/src/tests/persistence/persistencequeuetest.cpp
@@ -1,12 +1,11 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-#include <vespa/storageapi/message/bucket.h>
-#include <tests/persistence/common/persistenceproviderwrapper.h>
#include <vespa/persistence/dummyimpl/dummypersistence.h>
#include <tests/persistence/common/filestortestfixture.h>
#include <tests/persistence/filestorage/forwardingmessagesender.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/document/fieldset/fieldsets.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistencequeuetest");
@@ -80,7 +79,7 @@ std::shared_ptr<api::StorageMessage> PersistenceQueueTest::createPut(uint64_t bu
std::shared_ptr<api::StorageMessage> PersistenceQueueTest::createGet(uint64_t bucket) const {
auto cmd = std::make_shared<api::GetCommand>(
makeDocumentBucket(document::BucketId(16, bucket)),
- document::DocumentId(vespalib::make_string("id:foo:testdoctype1:n=%" PRIu64 ":0", bucket)), "[all]");
+ document::DocumentId(vespalib::make_string("id:foo:testdoctype1:n=%" PRIu64 ":0", bucket)), document::AllFields::NAME);
cmd->setAddress(makeSelfAddress());
return cmd;
}
diff --git a/storage/src/tests/persistence/testandsettest.cpp b/storage/src/tests/persistence/testandsettest.cpp
index 578a90081c7..18d78e1e8cf 100644
--- a/storage/src/tests/persistence/testandsettest.cpp
+++ b/storage/src/tests/persistence/testandsettest.cpp
@@ -7,6 +7,7 @@
#include <vespa/document/fieldvalue/fieldvalues.h>
#include <vespa/document/update/documentupdate.h>
#include <vespa/document/update/assignvalueupdate.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/persistence/spi/test.h>
#include <functional>
@@ -252,7 +253,7 @@ TestAndSetTest::createTestDocument()
document::Document::SP TestAndSetTest::retrieveTestDocument()
{
- auto get = std::make_shared<api::GetCommand>(BUCKET, testDocId, "[all]");
+ auto get = std::make_shared<api::GetCommand>(BUCKET, testDocId, document::AllFields::NAME);
auto tracker = thread->handleGet(*get, createTracker(get, BUCKET));
assert(tracker->getResult() == api::ReturnCode::Result::OK);
diff --git a/storage/src/tests/storageserver/bouncertest.cpp b/storage/src/tests/storageserver/bouncertest.cpp
index 29a56b234d0..46dad62de48 100644
--- a/storage/src/tests/storageserver/bouncertest.cpp
+++ b/storage/src/tests/storageserver/bouncertest.cpp
@@ -10,6 +10,7 @@
#include <tests/common/dummystoragelink.h>
#include <vespa/document/bucket/fixed_bucket_spaces.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/storageapi/message/persistence.h>
#include <vespa/config/common/exceptions.h>
#include <vespa/vespalib/gtest/gtest.h>
@@ -122,7 +123,7 @@ std::shared_ptr<api::StorageCommand> create_dummy_get_message() {
return std::make_shared<api::GetCommand>(
document::Bucket(document::FixedBucketSpaces::default_space(), document::BucketId(0)),
document::DocumentId("id:ns:foo::bar"),
- "[all]");
+ document::AllFields::NAME);
}
TEST_F(BouncerTest, future_timestamp) {
diff --git a/storage/src/tests/storageserver/communicationmanagertest.cpp b/storage/src/tests/storageserver/communicationmanagertest.cpp
index 8444319b395..0f95f7e7ece 100644
--- a/storage/src/tests/storageserver/communicationmanagertest.cpp
+++ b/storage/src/tests/storageserver/communicationmanagertest.cpp
@@ -11,11 +11,11 @@
#include <tests/common/dummystoragelink.h>
#include <tests/common/testhelper.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/documentapi/messagebus/messages/getdocumentmessage.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/documentapi/messagebus/messages/removedocumentmessage.h>
#include <vespa/documentapi/messagebus/messages/getdocumentreply.h>
-#include <vespa/vespalib/util/time.h>
#include <thread>
#include <vespa/vespalib/gtest/gtest.h>
@@ -35,7 +35,7 @@ struct CommunicationManagerTest : Test {
{
auto cmd = std::make_shared<api::GetCommand>(makeDocumentBucket(document::BucketId(0)),
document::DocumentId("id:ns:mytype::mydoc"),
- "[all]");
+ document::AllFields::NAME);
cmd->setAddress(api::StorageMessageAddress("storage", lib::NodeType::STORAGE, 1));
cmd->setPriority(priority);
return cmd;
@@ -71,7 +71,7 @@ TEST_F(CommunicationManagerTest, simple) {
// Send a message through from distributor to storage
auto cmd = std::make_shared<api::GetCommand>(
- makeDocumentBucket(document::BucketId(0)), document::DocumentId("id:ns:mytype::mydoc"), "[all]");
+ makeDocumentBucket(document::BucketId(0)), document::DocumentId("id:ns:mytype::mydoc"), document::AllFields::NAME);
cmd->setAddress(api::StorageMessageAddress("storage", lib::NodeType::STORAGE, 1));
distributorLink->sendUp(cmd);
storageLink->waitForMessages(1, MESSAGE_WAIT_TIME_SEC);
diff --git a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
index 73788d0affe..53940426a63 100644
--- a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
@@ -9,6 +9,7 @@
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/select/parser.h>
+#include <vespa/document/fieldset//fieldsets.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/log/log.h>
@@ -205,7 +206,7 @@ TwoPhaseUpdateOperation::startSafePathUpdate(DistributorMessageSender& sender)
std::shared_ptr<GetOperation>
TwoPhaseUpdateOperation::create_initial_safe_path_get_operation() {
document::Bucket bucket(_updateCmd->getBucket().getBucketSpace(), document::BucketId(0));
- const char* field_set = _use_initial_cheap_metadata_fetch_phase ? "[none]" : "[all]";
+ const char* field_set = _use_initial_cheap_metadata_fetch_phase ? document::NoFields::NAME : document::AllFields::NAME;
auto get = std::make_shared<api::GetCommand>(bucket, _updateCmd->getDocumentId(), field_set);
copyMessageSettings(*_updateCmd, *get);
// Metadata-only Gets just look at the data in the meta-store, not any fields.
@@ -345,7 +346,7 @@ TwoPhaseUpdateOperation::handleFastPathReceive(DistributorMessageSender& sender,
_updateReply = intermediate._reply;
_fast_path_repair_source_node = bestNode.second;
document::Bucket bucket(_updateCmd->getBucket().getBucketSpace(), bestNode.first);
- auto cmd = std::make_shared<api::GetCommand>(bucket, _updateCmd->getDocumentId(), "[all]");
+ auto cmd = std::make_shared<api::GetCommand>(bucket, _updateCmd->getDocumentId(), document::AllFields::NAME);
copyMessageSettings(*_updateCmd, *cmd);
sender.sendToNode(lib::NodeType::STORAGE, _fast_path_repair_source_node, cmd);
@@ -471,7 +472,7 @@ void TwoPhaseUpdateOperation::handle_safe_path_received_metadata_get(
LOG(debug, "Update(%s): sending single payload Get to %s on node %u (had timestamp %" PRIu64 ")",
update_doc_id().c_str(), bucket.toString().c_str(),
newest_replica->node, newest_replica->timestamp);
- auto cmd = std::make_shared<api::GetCommand>(bucket, _updateCmd->getDocumentId(), "[all]");
+ auto cmd = std::make_shared<api::GetCommand>(bucket, _updateCmd->getDocumentId(), document::AllFields::NAME);
copyMessageSettings(*_updateCmd, *cmd);
sender.sendToNode(lib::NodeType::STORAGE, newest_replica->node, cmd);
diff --git a/storage/src/vespa/storage/visiting/visitor.cpp b/storage/src/vespa/storage/visiting/visitor.cpp
index c9cda047784..dcd8cc4ba39 100644
--- a/storage/src/vespa/storage/visiting/visitor.cpp
+++ b/storage/src/vespa/storage/visiting/visitor.cpp
@@ -7,6 +7,7 @@
#include <vespa/storage/persistence/messages.h>
#include <vespa/documentapi/messagebus/messages/visitor.h>
#include <vespa/document/select/node.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/stringfmt.h>
@@ -165,7 +166,7 @@ Visitor::VisitorOptions::VisitorOptions()
_maxParallel(1),
_maxParallelOneBucket(2),
_maxPending(1),
- _fieldSet("[all]"),
+ _fieldSet(document::AllFields::NAME),
_visitRemoves(false)
{
}
diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp
index 0cfd2160497..8deb689d3a8 100644
--- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp
+++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp
@@ -10,11 +10,13 @@
#include <vespa/storageapi/message/visitor.h>
#include <vespa/storageapi/message/removelocation.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/log/log.h>
LOG_SETUP(".storage.api.mbusprot.serialization.4_2");
using document::BucketSpace;
+using document::AllFields;
namespace storage::mbusprot {
@@ -29,7 +31,7 @@ void ProtocolSerialization4_2::onEncode(GBBuf& buf, const api::GetCommand& msg)
buf.putString(msg.getDocumentId().toString());
putBucket(msg.getBucket(), buf);
buf.putLong(msg.getBeforeTimestamp());
- buf.putBoolean(msg.getFieldSet() == "[header]");
+ buf.putBoolean(false);
onEncodeCommand(buf, msg);
}
@@ -39,8 +41,9 @@ ProtocolSerialization4_2::onDecodeGetCommand(BBuf& buf) const
document::DocumentId did(SH::getString(buf));
document::Bucket bucket = getBucket(buf);
api::Timestamp beforeTimestamp(SH::getLong(buf));
- bool headerOnly(SH::getBoolean(buf));
- auto msg = std::make_unique<api::GetCommand>(bucket, did, headerOnly ? "[header]" : "[all]", beforeTimestamp);
+ bool headerOnly(SH::getBoolean(buf)); // Ignored header only flag
+ (void) headerOnly;
+ auto msg = std::make_unique<api::GetCommand>(bucket, did, AllFields::NAME, beforeTimestamp);
onDecodeCommand(buf, *msg);
return msg;
}
@@ -371,7 +374,7 @@ ProtocolSerialization4_2::onEncode(GBBuf& buf, const api::CreateVisitorCommand&
}
buf.putBoolean(msg.visitRemoves());
- buf.putBoolean(msg.getFieldSet() == "[header]");
+ buf.putBoolean(false);
buf.putBoolean(msg.visitInconsistentBuckets());
buf.putInt(vespalib::count_ms(msg.getQueueTimeout()));
msg.getParameters().serialize(buf);
@@ -409,7 +412,7 @@ ProtocolSerialization4_2::onDecodeCreateVisitorCommand(BBuf& buf) const
msg->setVisitRemoves();
}
if (SH::getBoolean(buf)) {
- msg->setFieldSet("[header]");
+ msg->setFieldSet(AllFields::NAME);
}
if (SH::getBoolean(buf)) {
msg->setVisitInconsistentBuckets();
diff --git a/storageapi/src/vespa/storageapi/message/visitor.cpp b/storageapi/src/vespa/storageapi/message/visitor.cpp
index e531e73fea5..faf58361276 100644
--- a/storageapi/src/vespa/storageapi/message/visitor.cpp
+++ b/storageapi/src/vespa/storageapi/message/visitor.cpp
@@ -1,9 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "visitor.h"
+#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/vespalib/util/array.hpp>
#include <climits>
-#include <ostream>
namespace storage::api {
@@ -32,7 +32,7 @@ CreateVisitorCommand::CreateVisitorCommand(document::BucketSpace bucketSpace,
_instanceId(instanceId),
_visitorId(0),
_visitRemoves(false),
- _fieldSet("[all]"),
+ _fieldSet(document::AllFields::NAME),
_visitInconsistentBuckets(false),
_queueTimeout(2000ms),
_maxPendingReplyCount(2),