diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2018-09-25 14:43:55 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2018-09-25 15:41:09 +0200 |
commit | 7d61a960839ea0400cd2e345997425419ab697f4 (patch) | |
tree | f99fabb2631f7d67b270d1dd928df36494369735 /documentapi | |
parent | 8c58a2f4ed9b873c712c41f7e1f407d078b9a4d4 (diff) |
Remove BatchDocumentUpdateMessage and BatchDocumentUpdateReply from
C++ portion of documentapi.
Remove corresponding document api cross language files.
Remove corresponding storageapi messages.
Diffstat (limited to 'documentapi')
30 files changed, 1 insertions, 395 deletions
diff --git a/documentapi/src/tests/messages/messages50test.cpp b/documentapi/src/tests/messages/messages50test.cpp index 6705277d5c3..8da7b692802 100644 --- a/documentapi/src/tests/messages/messages50test.cpp +++ b/documentapi/src/tests/messages/messages50test.cpp @@ -22,7 +22,6 @@ Messages50Test::Messages50Test() { // This list MUST mirror the list of routable factories from the DocumentProtocol constructor that support // version 5.0. When adding tests to this list, please KEEP THEM ORDERED alphabetically like they are now. - putTest(DocumentProtocol::MESSAGE_BATCHDOCUMENTUPDATE, TEST_METHOD(Messages50Test::testBatchDocumentUpdateMessage)); putTest(DocumentProtocol::MESSAGE_CREATEVISITOR, TEST_METHOD(Messages50Test::testCreateVisitorMessage)); putTest(DocumentProtocol::MESSAGE_DESTROYVISITOR, TEST_METHOD(Messages50Test::testDestroyVisitorMessage)); putTest(DocumentProtocol::MESSAGE_DOCUMENTLIST, TEST_METHOD(Messages50Test::testDocumentListMessage)); @@ -41,7 +40,6 @@ Messages50Test::Messages50Test() putTest(DocumentProtocol::MESSAGE_UPDATEDOCUMENT, TEST_METHOD(Messages50Test::testUpdateDocumentMessage)); putTest(DocumentProtocol::MESSAGE_VISITORINFO, TEST_METHOD(Messages50Test::testVisitorInfoMessage)); - putTest(DocumentProtocol::REPLY_BATCHDOCUMENTUPDATE, TEST_METHOD(Messages50Test::testBatchDocumentUpdateReply)); putTest(DocumentProtocol::REPLY_CREATEVISITOR, TEST_METHOD(Messages50Test::testCreateVisitorReply)); putTest(DocumentProtocol::REPLY_DESTROYVISITOR, TEST_METHOD(Messages50Test::testDestroyVisitorReply)); putTest(DocumentProtocol::REPLY_DOCUMENTLIST, TEST_METHOD(Messages50Test::testDocumentListReply)); @@ -693,90 +691,6 @@ Messages50Test::testUpdateDocumentMessage() } bool -Messages50Test::testBatchDocumentUpdateMessage() -{ - const DocumentTypeRepo &repo = getTypeRepo(); - const document::DocumentType &docType = *repo.getDocumentType("testdoc"); - - BatchDocumentUpdateMessage msg(1234); - - { - document::DocumentUpdate::SP upd; - upd.reset(new document::DocumentUpdate(repo, docType, document::DocumentId("userdoc:footype:1234:foo"))); - upd->addFieldPathUpdate(document::FieldPathUpdate::CP( - new document::RemoveFieldPathUpdate("intfield", "testdoc.intfield > 0"))); - msg.addUpdate(upd); - } - { - document::DocumentUpdate::SP upd; - upd.reset(new document::DocumentUpdate(repo, docType, document::DocumentId("orderdoc(32,17):footype:1234:123456789:foo"))); - upd->addFieldPathUpdate(document::FieldPathUpdate::CP( - new document::RemoveFieldPathUpdate("intfield", "testdoc.intfield > 0"))); - msg.addUpdate(upd); - } - try { - document::DocumentUpdate::SP upd; - upd.reset(new document::DocumentUpdate(repo, docType, document::DocumentId("userdoc:footype:5678:foo"))); - upd->addFieldPathUpdate(document::FieldPathUpdate::CP( - new document::RemoveFieldPathUpdate("intfield", "testdoc.intfield > 0"))); - msg.addUpdate(upd); - EXPECT_TRUE(false); - } catch (...) { - } - try { - document::DocumentUpdate::SP upd; - upd.reset(new document::DocumentUpdate(repo, docType, document::DocumentId("groupdoc:footype:hable:foo"))); - upd->addFieldPathUpdate(document::FieldPathUpdate::CP( - new document::RemoveFieldPathUpdate("intfield", "testdoc.intfield > 0"))); - msg.addUpdate(upd); - EXPECT_TRUE(false); - } catch (...) { - } - - EXPECT_EQUAL(MESSAGE_BASE_LENGTH + 202u, serialize("BatchDocumentUpdateMessage", msg)); - for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) { - mbus::Routable::UP obj = deserialize("BatchDocumentUpdateMessage", DocumentProtocol::MESSAGE_BATCHDOCUMENTUPDATE, lang); - if (EXPECT_TRUE(obj.get() != NULL)) { - BatchDocumentUpdateMessage &ref = static_cast<BatchDocumentUpdateMessage&>(*obj); - EXPECT_EQUAL(2u, ref.getUpdates().size()); - } - } - - return true; -} - -bool -Messages50Test::testBatchDocumentUpdateReply() -{ - BatchDocumentUpdateReply reply; - reply.setHighestModificationTimestamp(30); - { - std::vector<bool> notFound(3); - notFound[0] = false; - notFound[1] = true; - notFound[2] = true; - reply.getDocumentsNotFound() = notFound; - } - - EXPECT_EQUAL(20u, serialize("BatchDocumentUpdateReply", reply)); - - for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) { - mbus::Routable::UP obj = deserialize("BatchDocumentUpdateReply", DocumentProtocol::REPLY_BATCHDOCUMENTUPDATE, lang); - if (EXPECT_TRUE(obj.get() != NULL)) { - BatchDocumentUpdateReply &ref = dynamic_cast<BatchDocumentUpdateReply&>(*obj); - EXPECT_EQUAL(30u, ref.getHighestModificationTimestamp()); - { - const std::vector<bool>& notFound = ref.getDocumentsNotFound(); - EXPECT_TRUE(notFound[0] == false); - EXPECT_TRUE(notFound[1] == true); - EXPECT_TRUE(notFound[2] == true); - } - } - } - return true; -} - -bool Messages50Test::testQueryResultMessage() { QueryResultMessage srm; diff --git a/documentapi/src/tests/messages/messages50test.h b/documentapi/src/tests/messages/messages50test.h index c764f814a45..96c1be78c27 100644 --- a/documentapi/src/tests/messages/messages50test.h +++ b/documentapi/src/tests/messages/messages50test.h @@ -13,8 +13,6 @@ protected: public: Messages50Test(); - bool testBatchDocumentUpdateMessage(); - bool testBatchDocumentUpdateReply(); bool testCreateVisitorMessage(); bool testCreateVisitorReply(); bool testDestroyVisitorMessage(); diff --git a/documentapi/src/vespa/documentapi/documentapi.h b/documentapi/src/vespa/documentapi/documentapi.h index dff4125e624..a905163265d 100644 --- a/documentapi/src/vespa/documentapi/documentapi.h +++ b/documentapi/src/vespa/documentapi/documentapi.h @@ -1,8 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/documentapi/messagebus/messages/batchdocumentupdatemessage.h> -#include <vespa/documentapi/messagebus/messages/batchdocumentupdatereply.h> +#include <vespa/document/update/documentupdate.h> #include <vespa/documentapi/messagebus/messages/getbucketstatemessage.h> #include <vespa/documentapi/messagebus/messages/getbucketstatereply.h> #include <vespa/documentapi/messagebus/messages/getdocumentmessage.h> diff --git a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp index d2661d0fe6c..1a1d1d96ab6 100644 --- a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp @@ -57,7 +57,6 @@ DocumentProtocol::DocumentProtocol(const LoadTypeSet& loadTypes, std::vector<vespalib::VersionSpecification> from6 = { version6 }; // Add 5.0 serialization - putRoutableFactory(MESSAGE_BATCHDOCUMENTUPDATE, IRoutableFactory::SP(new RoutableFactories50::BatchDocumentUpdateMessageFactory(*_repo)), from50); putRoutableFactory(MESSAGE_CREATEVISITOR, IRoutableFactory::SP(new RoutableFactories50::CreateVisitorMessageFactory(*_repo)), from50); putRoutableFactory(MESSAGE_DESTROYVISITOR, IRoutableFactory::SP(new RoutableFactories50::DestroyVisitorMessageFactory()), from50); putRoutableFactory(MESSAGE_DOCUMENTLIST, IRoutableFactory::SP(new RoutableFactories50::DocumentListMessageFactory(*_repo)), from50); @@ -75,7 +74,6 @@ DocumentProtocol::DocumentProtocol(const LoadTypeSet& loadTypes, putRoutableFactory(MESSAGE_STATBUCKET, IRoutableFactory::SP(new RoutableFactories50::StatBucketMessageFactory()), from50); putRoutableFactory(MESSAGE_UPDATEDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::UpdateDocumentMessageFactory(*_repo)), from50); putRoutableFactory(MESSAGE_VISITORINFO, IRoutableFactory::SP(new RoutableFactories50::VisitorInfoMessageFactory()), from50); - putRoutableFactory(REPLY_BATCHDOCUMENTUPDATE, IRoutableFactory::SP(new RoutableFactories50::BatchDocumentUpdateReplyFactory()), from50); putRoutableFactory(REPLY_CREATEVISITOR, IRoutableFactory::SP(new RoutableFactories50::CreateVisitorReplyFactory()), from50); putRoutableFactory(REPLY_DESTROYVISITOR, IRoutableFactory::SP(new RoutableFactories50::DestroyVisitorReplyFactory()), from50); putRoutableFactory(REPLY_DOCUMENTLIST, IRoutableFactory::SP(new RoutableFactories50::DocumentListReplyFactory()), from50); diff --git a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.h b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.h index 32e6dc1d95e..79f7d7c0ccc 100644 --- a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.h +++ b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.h @@ -68,7 +68,6 @@ public: MESSAGE_EMPTYBUCKETS = DOCUMENT_MESSAGE + 23, MESSAGE_REMOVELOCATION = DOCUMENT_MESSAGE + 24, MESSAGE_QUERYRESULT = DOCUMENT_MESSAGE + 25, - MESSAGE_BATCHDOCUMENTUPDATE = DOCUMENT_MESSAGE + 26, // MESSAGE_GARBAGECOLLECT = DOCUMENT_MESSAGE + 27, DOCUMENT_REPLY = 200000, @@ -92,7 +91,6 @@ public: REPLY_EMPTYBUCKETS = DOCUMENT_REPLY + 23, REPLY_REMOVELOCATION = DOCUMENT_REPLY + 24, REPLY_QUERYRESULT = DOCUMENT_REPLY + 25, - REPLY_BATCHDOCUMENTUPDATE = DOCUMENT_REPLY + 26, // REPLY_GARBAGECOLLECT = DOCUMENT_REPLY + 27, REPLY_WRONGDISTRIBUTION = DOCUMENT_REPLY + 1000, REPLY_DOCUMENTIGNORED = DOCUMENT_REPLY + 1001 diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/CMakeLists.txt b/documentapi/src/vespa/documentapi/messagebus/messages/CMakeLists.txt index 3fa7e6086e9..7bd18a14719 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/CMakeLists.txt +++ b/documentapi/src/vespa/documentapi/messagebus/messages/CMakeLists.txt @@ -1,8 +1,6 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_add_library(documentapi_documentapimessages OBJECT SOURCES - batchdocumentupdatemessage.cpp - batchdocumentupdatereply.cpp documentignoredreply.cpp documentmessage.cpp documentreply.cpp diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatemessage.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatemessage.cpp deleted file mode 100644 index 2b38f9b24ae..00000000000 --- a/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatemessage.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "batchdocumentupdatemessage.h" -#include "batchdocumentupdatereply.h" -#include <vespa/documentapi/messagebus/documentprotocol.h> -#include <vespa/document/bucket/bucketidfactory.h> -#include <vespa/vespalib/util/exceptions.h> - -namespace documentapi { - -BatchDocumentUpdateMessage::BatchDocumentUpdateMessage(uint64_t userId) - : _userId(userId) -{ - setBucketId(document::UserDocIdString(vespalib::make_string("userdoc:foo:%lu:bar", _userId))); -} - -BatchDocumentUpdateMessage::BatchDocumentUpdateMessage(const string& group) - : _userId(0), - _group(group) -{ - setBucketId(document::GroupDocIdString("groupdoc:foo:" + _group + ":bar")); -} - -BatchDocumentUpdateMessage::~BatchDocumentUpdateMessage() {} - -void -BatchDocumentUpdateMessage::setBucketId(const document::IdString& idString) -{ - document::BucketIdFactory factory; - _bucketId = factory.getBucketId(document::DocumentId(idString)); -} - -void -BatchDocumentUpdateMessage::addUpdate(document::DocumentUpdate::SP update) -{ - verifyUpdate(*update); - _updates.push_back(update); -} - -void -BatchDocumentUpdateMessage::verifyUpdate(const document::DocumentUpdate& update) { - const document::IdString& idString = update.getId().getScheme(); - - if (_group.length()) { - string group; - - if (idString.hasGroup()) { - group = idString.getGroup(); - } else { - throw vespalib::IllegalArgumentException("Batch update message can only contain groupdoc or orderdoc items"); - } - - if (group != _group) { - throw vespalib::IllegalArgumentException(vespalib::make_string("Batch update message can not contain messages from group %s, only group %s", group.c_str(), _group.c_str())); - } - } else { - uint64_t userId; - - if (idString.hasNumber()) { - userId = idString.getNumber(); - } else { - throw vespalib::IllegalArgumentException("Batch update message can only contain userdoc or orderdoc items"); - } - - if (userId != _userId) { - throw vespalib::IllegalArgumentException(vespalib::make_string("Batch update message can not contain messages from user %llu, only user %llu", (long long unsigned)userId, (long long unsigned)_userId)); - } - } -} - -DocumentReply::UP -BatchDocumentUpdateMessage::doCreateReply() const -{ - return DocumentReply::UP(new BatchDocumentUpdateReply()); -} - -uint32_t -BatchDocumentUpdateMessage::getType() const { - return DocumentProtocol::MESSAGE_BATCHDOCUMENTUPDATE; -} - -} diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatemessage.h b/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatemessage.h deleted file mode 100644 index 54599c2627b..00000000000 --- a/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatemessage.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -#include "documentmessage.h" -#include "writedocumentreply.h" -#include <vespa/document/update/documentupdate.h> -#include <vespa/document/bucket/bucketid.h> -#include <vespa/document/base/idstring.h> - -namespace documentapi { - -/** - Message to use to send multiple updates for documents - belonging to the same user or group to Vespa. Using this - message improves performance in VDS mainly. -*/ -class BatchDocumentUpdateMessage : public DocumentMessage -{ -public: - typedef std::vector<document::DocumentUpdate::SP > UpdateList; - - /** - Creates a batch update message that can contain only updates - for documents belonging to the given user. - */ - BatchDocumentUpdateMessage(uint64_t userId); - - /** - Creates a batch update message that can contain only updates - for documents belonging to the given group. - */ - BatchDocumentUpdateMessage(const string& group); - ~BatchDocumentUpdateMessage(); - - /** - @return Returns a list of the updates to be performed. - */ - const UpdateList& getUpdates() const { return _updates; }; - - /** - Adds an update to be performed. - */ - void addUpdate(document::DocumentUpdate::SP update); - - /** - Returns the user id that this batch can contain. - Only valid if this object was created with the first constructor. - */ - uint64_t getUserId() const { return _userId; }; - - /** - Returns the grouo that this batch can contain. - Only valid if this object was created with the second constructor. - */ - const string& getGroup() const { return _group; } - - uint32_t getType() const override; - - /** - Returns a bucket id suitable for routing this message. - */ - const document::BucketId& getBucketId() const { return _bucketId; } - - string toString() const override { return "batchdocumentupdatemessage"; } - -protected: - DocumentReply::UP doCreateReply() const override; - -private: - uint64_t _userId; - string _group; - - UpdateList _updates; - document::BucketId _bucketId; - - void verifyUpdate(const document::DocumentUpdate& update); - void setBucketId(const document::IdString& idString); -}; - -} - diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatereply.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatereply.cpp deleted file mode 100644 index 483740233c0..00000000000 --- a/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatereply.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "batchdocumentupdatereply.h" -#include <vespa/documentapi/messagebus/documentprotocol.h> - -namespace documentapi { - -BatchDocumentUpdateReply::BatchDocumentUpdateReply() - : WriteDocumentReply(DocumentProtocol::REPLY_BATCHDOCUMENTUPDATE) -{ } - -BatchDocumentUpdateReply::~BatchDocumentUpdateReply() {} - -} diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatereply.h b/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatereply.h deleted file mode 100644 index be1f5bc75d5..00000000000 --- a/documentapi/src/vespa/documentapi/messagebus/messages/batchdocumentupdatereply.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -#include "writedocumentreply.h" - -namespace documentapi { - -class BatchDocumentUpdateReply : public WriteDocumentReply -{ - /** - * If all documents to update are found, this vector will be empty. If - * one or more documents are not found, this vector will have the size of - * the initial number of updates, with entries set to true where the - * corresponding update was not found. - */ - std::vector<bool> _documentsNotFound; -public: - typedef std::unique_ptr<BatchDocumentUpdateReply> UP; - typedef std::shared_ptr<BatchDocumentUpdateReply> SP; - - BatchDocumentUpdateReply(); - ~BatchDocumentUpdateReply(); - - const std::vector<bool>& getDocumentsNotFound() const { return _documentsNotFound; } - std::vector<bool>& getDocumentsNotFound() { return _documentsNotFound; } - - string toString() const override { return "batchdocumentupdatereply"; } -}; - -} diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/documentrouteselectorpolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/documentrouteselectorpolicy.cpp index 42120b8052a..62135150d98 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/documentrouteselectorpolicy.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/policies/documentrouteselectorpolicy.cpp @@ -4,7 +4,6 @@ #include <vespa/document/bucket/bucketidfactory.h> #include <vespa/document/select/parser.h> #include <vespa/documentapi/messagebus/documentprotocol.h> -#include <vespa/documentapi/messagebus/messages/batchdocumentupdatemessage.h> #include <vespa/documentapi/messagebus/messages/putdocumentmessage.h> #include <vespa/documentapi/messagebus/messages/updatedocumentmessage.h> #include <vespa/documentapi/messagebus/messages/documentignoredreply.h> @@ -138,17 +137,6 @@ DocumentRouteSelectorPolicy::select(mbus::RoutingContext &context, const vespali return true; } } - - case DocumentProtocol::MESSAGE_BATCHDOCUMENTUPDATE: - { - const BatchDocumentUpdateMessage& mom = static_cast<const BatchDocumentUpdateMessage&>(msg); - for (uint32_t i = 0; i < mom.getUpdates().size(); i++) { - if (it->second->contains(*mom.getUpdates()[i]) == Result::False) { - return false; - } - } - return true; - } default: return true; } diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/storagepolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/storagepolicy.cpp index 723c6fc836a..86138a27b20 100644 --- a/documentapi/src/vespa/documentapi/messagebus/policies/storagepolicy.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/policies/storagepolicy.cpp @@ -150,10 +150,6 @@ StoragePolicy::doSelect(mbus::RoutingContext &context) id = static_cast<const RemoveLocationMessage&>(msg).getBucketId(); break; - case DocumentProtocol::MESSAGE_BATCHDOCUMENTUPDATE: - id = static_cast<const BatchDocumentUpdateMessage&>(msg).getBucketId(); - break; - default: LOG(error, "Message type '%d' not supported.", msg.getType()); return; diff --git a/documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp b/documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp index 26d85b57522..7823257843d 100644 --- a/documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/routablefactories50.cpp @@ -67,69 +67,6 @@ RoutableFactories50::DocumentReplyFactory::decode(document::ByteBuffer &in, cons //////////////////////////////////////////////////////////////////////////////// DocumentMessage::UP -RoutableFactories50::BatchDocumentUpdateMessageFactory::doDecode(document::ByteBuffer &buf) const -{ - uint64_t userId = (uint64_t)decodeLong(buf); - string group = decodeString(buf); - - auto msg = (group.length()) - ? std::make_unique<BatchDocumentUpdateMessage>(group) - : std::make_unique<BatchDocumentUpdateMessage>(userId); - - uint32_t len = decodeInt(buf); - for (uint32_t i = 0; i < len; i++) { - document::DocumentUpdate::SP upd = document::DocumentUpdate::createHEAD(_repo, buf); - msg->addUpdate(upd); - } - - return msg; -} - -bool -RoutableFactories50::BatchDocumentUpdateMessageFactory::doEncode(const DocumentMessage &obj, vespalib::GrowableByteBuffer &buf) const -{ - const BatchDocumentUpdateMessage &msg = static_cast<const BatchDocumentUpdateMessage&>(obj); - - buf.putLong(msg.getUserId()); - buf.putString(msg.getGroup()); - buf.putInt(msg.getUpdates().size()); - - vespalib::nbostream stream; - for (const auto & update : msg.getUpdates()) { - update->serializeHEAD(stream); - } - buf.putBytes(stream.c_str(), stream.size()); - - return true; -} - -DocumentReply::UP -RoutableFactories50::BatchDocumentUpdateReplyFactory::doDecode(document::ByteBuffer &buf) const -{ - auto reply = std::make_unique<BatchDocumentUpdateReply>(); - reply->setHighestModificationTimestamp(decodeLong(buf)); - std::vector<bool>& notFound = reply->getDocumentsNotFound(); - notFound.resize(decodeInt(buf)); - for (std::size_t i = 0; i < notFound.size(); ++i) { - notFound[i] = decodeBoolean(buf); - } - return reply; -} - -bool -RoutableFactories50::BatchDocumentUpdateReplyFactory::doEncode(const DocumentReply &obj, vespalib::GrowableByteBuffer &buf) const -{ - const BatchDocumentUpdateReply& reply = static_cast<const BatchDocumentUpdateReply&>(obj); - buf.putLong(reply.getHighestModificationTimestamp()); - const std::vector<bool>& notFoundV = reply.getDocumentsNotFound(); - buf.putInt(notFoundV.size()); - for (bool notFound : notFoundV) { - buf.putBoolean(notFound); - } - return true; -} - -DocumentMessage::UP RoutableFactories50::CreateVisitorMessageFactory::doDecode(document::ByteBuffer &buf) const { auto msg = std::make_unique<CreateVisitorMessage>(); diff --git a/documentapi/src/vespa/documentapi/messagebus/routablefactories50.h b/documentapi/src/vespa/documentapi/messagebus/routablefactories50.h index 12d5c560786..f96b9641800 100644 --- a/documentapi/src/vespa/documentapi/messagebus/routablefactories50.h +++ b/documentapi/src/vespa/documentapi/messagebus/routablefactories50.h @@ -157,19 +157,6 @@ public: // Factories // //////////////////////////////////////////////////////////////////////////////// - - class BatchDocumentUpdateMessageFactory : public DocumentMessageFactory { - const document::DocumentTypeRepo &_repo; - DocumentMessage::UP doDecode(document::ByteBuffer &buf) const override; - bool doEncode(const DocumentMessage &msg, vespalib::GrowableByteBuffer &buf) const override; - public: - BatchDocumentUpdateMessageFactory(const document::DocumentTypeRepo &r) : _repo(r) {} - }; - class BatchDocumentUpdateReplyFactory : public DocumentReplyFactory { - protected: - DocumentReply::UP doDecode(document::ByteBuffer &buf) const override; - bool doEncode(const DocumentReply &reply, vespalib::GrowableByteBuffer &buf) const override; - }; class CreateVisitorMessageFactory : public DocumentMessageFactory { const document::DocumentTypeRepo &_repo; protected: diff --git a/documentapi/test/crosslanguagefiles/5-cpp-BatchDocumentUpdateMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-BatchDocumentUpdateMessage.dat Binary files differdeleted file mode 100644 index 95e663088c3..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-BatchDocumentUpdateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-BatchDocumentUpdateReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-BatchDocumentUpdateReply.dat Binary files differdeleted file mode 100644 index 216db17f80e..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-BatchDocumentUpdateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-BatchDocumentUpdateMessage.dat b/documentapi/test/crosslanguagefiles/5-java-BatchDocumentUpdateMessage.dat Binary files differdeleted file mode 100644 index 95e663088c3..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-BatchDocumentUpdateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-BatchDocumentUpdateReply.dat b/documentapi/test/crosslanguagefiles/5-java-BatchDocumentUpdateReply.dat Binary files differdeleted file mode 100644 index 216db17f80e..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-BatchDocumentUpdateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-BatchDocumentUpdateMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-BatchDocumentUpdateMessage.dat Binary files differdeleted file mode 100644 index 95e663088c3..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-BatchDocumentUpdateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-BatchDocumentUpdateReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-BatchDocumentUpdateReply.dat Binary files differdeleted file mode 100644 index 216db17f80e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-BatchDocumentUpdateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-BatchDocumentUpdateMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-BatchDocumentUpdateMessage.dat Binary files differdeleted file mode 100644 index 95e663088c3..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-BatchDocumentUpdateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-BatchDocumentUpdateReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-BatchDocumentUpdateReply.dat Binary files differdeleted file mode 100644 index 216db17f80e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-BatchDocumentUpdateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.115-cpp-BatchDocumentUpdateMessage.dat b/documentapi/test/crosslanguagefiles/5.115-cpp-BatchDocumentUpdateMessage.dat Binary files differdeleted file mode 100644 index 95e663088c3..00000000000 --- a/documentapi/test/crosslanguagefiles/5.115-cpp-BatchDocumentUpdateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.115-cpp-BatchDocumentUpdateReply.dat b/documentapi/test/crosslanguagefiles/5.115-cpp-BatchDocumentUpdateReply.dat Binary files differdeleted file mode 100644 index 216db17f80e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.115-cpp-BatchDocumentUpdateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.115-java-BatchDocumentUpdateMessage.dat b/documentapi/test/crosslanguagefiles/5.115-java-BatchDocumentUpdateMessage.dat Binary files differdeleted file mode 100644 index 95e663088c3..00000000000 --- a/documentapi/test/crosslanguagefiles/5.115-java-BatchDocumentUpdateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.115-java-BatchDocumentUpdateReply.dat b/documentapi/test/crosslanguagefiles/5.115-java-BatchDocumentUpdateReply.dat Binary files differdeleted file mode 100644 index 216db17f80e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.115-java-BatchDocumentUpdateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/6.221-cpp-BatchDocumentUpdateMessage.dat b/documentapi/test/crosslanguagefiles/6.221-cpp-BatchDocumentUpdateMessage.dat Binary files differdeleted file mode 100644 index 95e663088c3..00000000000 --- a/documentapi/test/crosslanguagefiles/6.221-cpp-BatchDocumentUpdateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/6.221-cpp-BatchDocumentUpdateReply.dat b/documentapi/test/crosslanguagefiles/6.221-cpp-BatchDocumentUpdateReply.dat Binary files differdeleted file mode 100644 index 216db17f80e..00000000000 --- a/documentapi/test/crosslanguagefiles/6.221-cpp-BatchDocumentUpdateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/6.221-java-BatchDocumentUpdateMessage.dat b/documentapi/test/crosslanguagefiles/6.221-java-BatchDocumentUpdateMessage.dat Binary files differdeleted file mode 100644 index 95e663088c3..00000000000 --- a/documentapi/test/crosslanguagefiles/6.221-java-BatchDocumentUpdateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/6.221-java-BatchDocumentUpdateReply.dat b/documentapi/test/crosslanguagefiles/6.221-java-BatchDocumentUpdateReply.dat Binary files differdeleted file mode 100644 index 216db17f80e..00000000000 --- a/documentapi/test/crosslanguagefiles/6.221-java-BatchDocumentUpdateReply.dat +++ /dev/null |