diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2018-09-25 20:36:27 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2018-09-26 10:56:21 +0200 |
commit | 71d2c3bbc23fa48028bebb2c117de596baee6cd2 (patch) | |
tree | 96645dabf9e43227739f05c6cad3f8d4a57e030f /storageapi | |
parent | f5f85f535e6117d3d38011ce4196e64a7f8bfe24 (diff) |
Remove BatchPutRemove command from storageapi.
Diffstat (limited to 'storageapi')
11 files changed, 0 insertions, 460 deletions
diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp index cfc69bcde45..da7e8cb743e 100644 --- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp +++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp @@ -5,7 +5,6 @@ #include <vespa/storageapi/message/bucketsplitting.h> #include <vespa/storageapi/message/internal.h> #include <vespa/storageapi/message/removelocation.h> -#include <vespa/storageapi/message/batch.h> #include <vespa/storageapi/mbusprot/storageprotocol.h> #include <vespa/storageapi/mbusprot/storagecommand.h> #include <vespa/storageapi/mbusprot/storagereply.h> @@ -89,7 +88,6 @@ struct StorageProtocolTest : public CppUnit::TestFixture { void testSplitBucket51(); void testSplitBucketChain51(); void testJoinBuckets51(); - void testBatchPutRemove51(); void testCreateVisitor51(); void testDestroyVisitor51(); void testRemoveLocation51(); @@ -133,7 +131,6 @@ struct StorageProtocolTest : public CppUnit::TestFixture { CPPUNIT_TEST(testCreateVisitor51); CPPUNIT_TEST(testDestroyVisitor51); CPPUNIT_TEST(testRemoveLocation51); - CPPUNIT_TEST(testBatchPutRemove51); CPPUNIT_TEST(testInternalMessage); CPPUNIT_TEST(testSetBucketState51); @@ -782,55 +779,6 @@ StorageProtocolTest::testApplyBucketDiff51() recordSerialization50(); } -void -StorageProtocolTest::testBatchPutRemove51() -{ - ScopedName test("testBatchPutRemove51"); - - document::BucketId bucketId(20, 0xf1f1f1f1f1ull); - document::Bucket bucket(makeDocumentBucket(bucketId)); - BatchPutRemoveCommand::SP cmd(new BatchPutRemoveCommand(bucket)); - cmd->addPut(_testDoc, 100); - cmd->addHeaderUpdate(_testDoc, 101, 1234); - cmd->addRemove(_testDoc->getId(), 102); - cmd->forceMsgId(556677); - BatchPutRemoveCommand::SP cmd2(copyCommand(cmd, _version5_1)); - CPPUNIT_ASSERT_EQUAL(bucketId, cmd2->getBucketId()); - CPPUNIT_ASSERT_EQUAL(3, (int)cmd2->getOperationCount()); - CPPUNIT_ASSERT_EQUAL(*_testDoc, *(dynamic_cast<const BatchPutRemoveCommand::PutOperation&>(cmd2->getOperation(0)).document)); - CPPUNIT_ASSERT_EQUAL((uint64_t)100, cmd2->getOperation(0).timestamp); - { - vespalib::nbostream header; - _testDoc->serializeHeader(header); - document::Document headerDoc(_docMan.getTypeRepo(), header); - CPPUNIT_ASSERT_EQUAL( - headerDoc, - *(dynamic_cast<const BatchPutRemoveCommand::HeaderUpdateOperation&>( - cmd2->getOperation(1)).document)); - } - CPPUNIT_ASSERT_EQUAL((uint64_t)101, cmd2->getOperation(1).timestamp); - CPPUNIT_ASSERT_EQUAL(1234, (int)dynamic_cast<const BatchPutRemoveCommand::HeaderUpdateOperation&>(cmd2->getOperation(1)).timestampToUpdate); - CPPUNIT_ASSERT_EQUAL(_testDoc->getId(), dynamic_cast<const BatchPutRemoveCommand::RemoveOperation&>(cmd2->getOperation(2)).documentId); - CPPUNIT_ASSERT_EQUAL((uint64_t)102, cmd2->getOperation(2).timestamp); - CPPUNIT_ASSERT_EQUAL(uint64_t(556677), cmd2->getMsgId()); - - BatchPutRemoveReply::SP reply(new BatchPutRemoveReply(*cmd2)); - reply->getDocumentsNotFound().push_back(document::DocumentId("userdoc:footype:1234:foo1")); - reply->getDocumentsNotFound().push_back(document::DocumentId("userdoc:footype:1234:foo2")); - reply->getDocumentsNotFound().push_back(document::DocumentId("userdoc:footype:1234:foo3")); - - BatchPutRemoveReply::SP reply2(copyReply(reply)); - - CPPUNIT_ASSERT_EQUAL(3, (int)reply2->getDocumentsNotFound().size()); - CPPUNIT_ASSERT_EQUAL(document::DocumentId("userdoc:footype:1234:foo1"), reply2->getDocumentsNotFound()[0]); - CPPUNIT_ASSERT_EQUAL(document::DocumentId("userdoc:footype:1234:foo2"), reply2->getDocumentsNotFound()[1]); - CPPUNIT_ASSERT_EQUAL(document::DocumentId("userdoc:footype:1234:foo3"), reply2->getDocumentsNotFound()[2]); - - recordOutput(*cmd2); - recordOutput(*reply2); - recordSerialization50(); -} - namespace { struct MyCommand : public api::InternalCommand { MyCommand() : InternalCommand(101) {} diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.cpp index d08464da715..172cd6c8de5 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.cpp @@ -7,7 +7,6 @@ #include <vespa/storageapi/message/bucketsplitting.h> #include <vespa/storageapi/message/visitor.h> #include <vespa/storageapi/message/removelocation.h> -#include <vespa/storageapi/message/batch.h> #include <vespa/vespalib/util/exceptions.h> @@ -132,12 +131,6 @@ ProtocolSerialization::encode(const api::StorageMessage& msg) const case api::MessageType::REMOVELOCATION_REPLY_ID: onEncode(buf, static_cast<const api::RemoveLocationReply&>(msg)); break; - case api::MessageType::BATCHPUTREMOVE_ID: - onEncode(buf, static_cast<const api::BatchPutRemoveCommand&>(msg)); - break; - case api::MessageType::BATCHPUTREMOVE_REPLY_ID: - onEncode(buf, static_cast<const api::BatchPutRemoveReply&>(msg)); - break; case api::MessageType::SETBUCKETSTATE_ID: onEncode(buf, static_cast<const api::SetBucketStateCommand&>(msg)); break; @@ -205,8 +198,6 @@ ProtocolSerialization::decodeCommand(mbus::BlobRef data) const cmd = onDecodeDestroyVisitorCommand(buf); break; case api::MessageType::REMOVELOCATION_ID: cmd = onDecodeRemoveLocationCommand(buf); break; - case api::MessageType::BATCHPUTREMOVE_ID: - cmd = onDecodeBatchPutRemoveCommand(buf); break; case api::MessageType::SETBUCKETSTATE_ID: cmd = onDecodeSetBucketStateCommand(buf); break; default: @@ -269,8 +260,6 @@ ProtocolSerialization::decodeReply(mbus::BlobRef data, const api::StorageCommand reply = onDecodeDestroyVisitorReply(cmd, buf); break; case api::MessageType::REMOVELOCATION_REPLY_ID: reply = onDecodeRemoveLocationReply(cmd, buf); break; - case api::MessageType::BATCHPUTREMOVE_REPLY_ID: - reply = onDecodeBatchPutRemoveReply(cmd, buf); break; case api::MessageType::SETBUCKETSTATE_REPLY_ID: reply = onDecodeSetBucketStateReply(cmd, buf); break; default: diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h index c3b54cd9e46..9c3ddb88bdf 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h @@ -50,8 +50,6 @@ class SetBucketStateReply; class CreateVisitorCommand; class RemoveLocationCommand; class RemoveLocationReply; -class BatchPutRemoveCommand; -class BatchPutRemoveReply; } namespace storage::mbusprot { @@ -123,8 +121,6 @@ protected: virtual void onEncode(GBBuf&, const api::DestroyVisitorReply&) const = 0; virtual void onEncode(GBBuf&, const api::RemoveLocationCommand&) const = 0; virtual void onEncode(GBBuf&, const api::RemoveLocationReply&) const = 0; - virtual void onEncode(GBBuf&, const api::BatchPutRemoveCommand&) const = 0; - virtual void onEncode(GBBuf&, const api::BatchPutRemoveReply&) const = 0; virtual SCmd::UP onDecodePutCommand(BBuf&) const = 0; virtual SRep::UP onDecodePutReply(const SCmd&, BBuf&) const = 0; @@ -164,8 +160,6 @@ protected: virtual SRep::UP onDecodeDestroyVisitorReply(const SCmd&, BBuf&) const = 0; virtual SCmd::UP onDecodeRemoveLocationCommand(BBuf&) const = 0; virtual SRep::UP onDecodeRemoveLocationReply(const SCmd&, BBuf&) const = 0; - virtual SCmd::UP onDecodeBatchPutRemoveCommand(BBuf&) const = 0; - virtual SRep::UP onDecodeBatchPutRemoveReply(const SCmd&, BBuf&) const = 0; virtual document::Bucket getBucket(document::ByteBuffer& buf) const = 0; virtual void putBucket(const document::Bucket& bucket, vespalib::GrowableByteBuffer& buf) const = 0; diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp index 2532f76f3a0..74a0c964d19 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp @@ -7,7 +7,6 @@ #include "storagereply.h" #include <vespa/storageapi/message/bucketsplitting.h> -#include <vespa/storageapi/message/batch.h> #include <vespa/storageapi/message/visitor.h> #include <vespa/storageapi/message/removelocation.h> #include <vespa/vespalib/util/exceptions.h> @@ -25,104 +24,6 @@ ProtocolSerialization4_2::ProtocolSerialization4_2( { } -void -ProtocolSerialization4_2::onEncode( - GBBuf& buf, const api::BatchPutRemoveCommand& msg) const -{ - // Serialization format - allow different types of serialization depending on source. - buf.putByte(0); - putBucket(msg.getBucket(), buf); - buf.putInt(msg.getOperationCount()); - - for (uint32_t i = 0; i < msg.getOperationCount(); i++) { - const api::BatchPutRemoveCommand::Operation& op = msg.getOperation(i); - buf.putByte((uint8_t)op.type); - buf.putLong(op.timestamp); - - switch (op.type) { - case api::BatchPutRemoveCommand::Operation::REMOVE: - buf.putString(static_cast<const api::BatchPutRemoveCommand::RemoveOperation&>(op).documentId.toString()); - break; - case api::BatchPutRemoveCommand::Operation::HEADERUPDATE: - { - buf.putLong(static_cast<const api::BatchPutRemoveCommand::HeaderUpdateOperation&>(op).timestampToUpdate); - - vespalib::nbostream stream; - static_cast<const api::BatchPutRemoveCommand::HeaderUpdateOperation&>(op).document->serializeHeader(stream); - buf.putInt(stream.size()); - buf.putBytes(stream.peek(), stream.size()); - break; - } - case api::BatchPutRemoveCommand::Operation::PUT: - SH::putDocument(static_cast<const api::BatchPutRemoveCommand::PutOperation&>(op).document.get(), buf); - break; - } - } - onEncodeBucketInfoCommand(buf, msg); -} - -api::StorageCommand::UP -ProtocolSerialization4_2::onDecodeBatchPutRemoveCommand(BBuf& buf) const -{ - SH::getByte(buf); - document::Bucket bucket = getBucket(buf); - std::unique_ptr<api::BatchPutRemoveCommand> cmd(new api::BatchPutRemoveCommand(bucket)); - int length = SH::getInt(buf); - - for (int i = 0; i < length; i++) { - int type = SH::getByte(buf); - long timestamp = SH::getLong(buf); - - switch (type) { - case api::BatchPutRemoveCommand::Operation::REMOVE: - cmd->addRemove(document::DocumentId(SH::getString(buf)), timestamp); - break; - case api::BatchPutRemoveCommand::Operation::HEADERUPDATE: - { - long newTimestamp = SH::getLong(buf); - cmd->addHeaderUpdate(document::Document::SP( - SH::getDocument(buf, getTypeRepo())), - timestamp, newTimestamp); - break; - } - case api::BatchPutRemoveCommand::Operation::PUT: - cmd->addPut(document::Document::SP(SH::getDocument( - buf, getTypeRepo())), timestamp); - break; - } - } - - onDecodeBucketInfoCommand(buf, *cmd); - - return api::StorageCommand::UP(cmd.release()); -} - -void ProtocolSerialization4_2::onEncode( - GBBuf& buf, const api::BatchPutRemoveReply& msg) const -{ - buf.putInt(msg.getDocumentsNotFound().size()); - for (uint32_t i = 0; i < msg.getDocumentsNotFound().size(); i++) { - buf.putString(msg.getDocumentsNotFound()[i].toString()); - } - - onEncodeBucketInfoReply(buf, msg); -} - -api::StorageReply::UP -ProtocolSerialization4_2::onDecodeBatchPutRemoveReply(const SCmd& cmd, - BBuf& buf) const -{ - api::BatchPutRemoveReply::UP msg(new api::BatchPutRemoveReply( - static_cast<const api::BatchPutRemoveCommand&>(cmd))); - uint32_t count = SH::getInt(buf); - for (uint32_t i = 0; i < count; i++) { - msg->getDocumentsNotFound().push_back(document::DocumentId(SH::getString(buf))); - } - - onDecodeBucketInfoReply(buf, *msg); - return api::StorageReply::UP(msg.release()); -} - void ProtocolSerialization4_2::onEncode( GBBuf& buf, const api::GetCommand& msg) const { diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h index 3a6f77e46a3..56aa3d4ed30 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h @@ -28,8 +28,6 @@ protected: void onEncode(GBBuf&, const api::RemoveLocationReply&) const override; // Not supported on 4.2, but implemented here for simplicity. - void onEncode(GBBuf&, const api::BatchPutRemoveCommand&) const override; - void onEncode(GBBuf&, const api::BatchPutRemoveReply&) const override; void onEncode(GBBuf&, const api::SetBucketStateCommand&) const override; void onEncode(GBBuf&, const api::SetBucketStateReply&) const override; @@ -59,10 +57,6 @@ protected: SCmd::UP onDecodeRemoveLocationCommand(BBuf&) const override; SRep::UP onDecodeRemoveLocationReply(const SCmd&, BBuf&) const override; - // Not supported on 4.2, but implemented here for simplicity. - SCmd::UP onDecodeBatchPutRemoveCommand(BBuf&) const override; - SRep::UP onDecodeBatchPutRemoveReply(const SCmd&, BBuf&) const override; - virtual void onDecodeBucketInfoCommand(BBuf&, api::BucketInfoCommand&) const; virtual void onDecodeBucketInfoReply(BBuf&, api::BucketInfoReply&) const = 0; virtual void onDecodeCommand(BBuf& buf, api::StorageCommand& msg) const = 0; diff --git a/storageapi/src/vespa/storageapi/message/CMakeLists.txt b/storageapi/src/vespa/storageapi/message/CMakeLists.txt index dbbaad8eed1..cde9183482f 100644 --- a/storageapi/src/vespa/storageapi/message/CMakeLists.txt +++ b/storageapi/src/vespa/storageapi/message/CMakeLists.txt @@ -12,7 +12,6 @@ vespa_add_library(storageapi_message OBJECT stat.cpp removelocation.cpp queryresult.cpp - batch.cpp internal.cpp DEPENDS ) diff --git a/storageapi/src/vespa/storageapi/message/batch.cpp b/storageapi/src/vespa/storageapi/message/batch.cpp deleted file mode 100644 index ad90a622491..00000000000 --- a/storageapi/src/vespa/storageapi/message/batch.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// -#include "batch.h" -#include <vespa/document/bucket/bucketidfactory.h> -#include <ostream> - -using namespace storage::api; -using document::BucketSpace; - -IMPLEMENT_COMMAND(BatchPutRemoveCommand, BatchPutRemoveReply) -IMPLEMENT_REPLY(BatchPutRemoveReply) - - -BatchPutRemoveCommand::Operation::Operation(uint64_t ts, Type tp) - : timestamp(ts), - type(tp) -{ -} - -BatchPutRemoveCommand::PutOperation::PutOperation(document::Document::SP doc, uint64_t ts) - : Operation(ts, PUT), - document(doc) -{ -} - -BatchPutRemoveCommand::HeaderUpdateOperation::HeaderUpdateOperation(document::Document::SP doc, uint64_t newTimestamp, uint64_t timestampToUpdate_) - : Operation(newTimestamp, HEADERUPDATE), - document(doc), - timestampToUpdate(timestampToUpdate_) -{ -} - -BatchPutRemoveCommand::RemoveOperation::RemoveOperation(const document::DocumentId& docId, uint64_t ts) - : Operation(ts, REMOVE), - documentId(docId) -{ -} - -BatchPutRemoveCommand::BatchPutRemoveCommand(const document::Bucket &bucket) - : BucketInfoCommand(MessageType::BATCHPUTREMOVE, bucket), - _approxSize(0) -{ -} - -void -BatchPutRemoveCommand::addPut(document::Document::SP document, uint64_t ts) -{ - _operations.push_back(std::unique_ptr<Operation>(new PutOperation(document, ts))); - _approxSize += document->serialize()->getLength(); -} - -void -BatchPutRemoveCommand::addHeaderUpdate(document::Document::SP document, uint64_t ts, uint64_t timestampToUpdate) -{ - _operations.push_back(std::unique_ptr<Operation>(new HeaderUpdateOperation(document, ts, timestampToUpdate))); - _approxSize += document->serialize()->getLength(); -} - -void -BatchPutRemoveCommand::addRemove(const document::DocumentId& docId, uint64_t ts) -{ - _operations.push_back(std::unique_ptr<Operation>(new RemoveOperation(docId, ts))); - _approxSize += docId.toString().length(); -} - -void -BatchPutRemoveCommand::addOperation(const Operation& op, bool cloneDocument) -{ - switch (op.type) { - case Operation::PUT: - { - document::Document::SP doc; - if (!cloneDocument) { - doc = static_cast<const PutOperation&>(op).document; - } else { - doc.reset(static_cast<const PutOperation&>(op).document->clone()); - } - addPut(doc, op.timestamp); - break; - } - case Operation::REMOVE: - addRemove(static_cast<const RemoveOperation&>(op).documentId, op.timestamp); - break; - case Operation::HEADERUPDATE: - { - const HeaderUpdateOperation& hup = static_cast<const HeaderUpdateOperation&>(op); - document::Document::SP doc; - if (!cloneDocument) { - doc = hup.document; - } else { - doc.reset(hup.document->clone()); - } - addHeaderUpdate(doc, op.timestamp, hup.timestampToUpdate); - break; - } - } -} - -void -BatchPutRemoveCommand::print(std::ostream& out, bool verbose, - const std::string& indent) const { - out << "BatchPutRemove(" << getBucketId() << ", " << _operations.size() << " operations)"; - - if (verbose) { - out << " : "; - BucketInfoCommand::print(out, verbose, indent); - } -} - -BatchPutRemoveReply::BatchPutRemoveReply(const BatchPutRemoveCommand& cmd) - : BucketInfoReply(cmd) -{ -} - -void -BatchPutRemoveReply::print(std::ostream& out, bool verbose, - const std::string& indent) const { - out << "BatchPutRemoveReply("; - out << _documentsNotFound.size() << " documents not found)"; - - if (verbose) { - out << " {"; - for (std::vector<document::DocumentId>::const_iterator it = - _documentsNotFound.begin(); - it != _documentsNotFound.end(); ++it) - { - out << "\n" << indent << " " << (*it); - } - out << "\n" << indent << "} : "; - BucketInfoReply::print(out, verbose, indent); - } -} diff --git a/storageapi/src/vespa/storageapi/message/batch.h b/storageapi/src/vespa/storageapi/message/batch.h deleted file mode 100644 index f265bbca6fb..00000000000 --- a/storageapi/src/vespa/storageapi/message/batch.h +++ /dev/null @@ -1,139 +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 <vespa/document/fieldvalue/document.h> -#include <vespa/document/update/documentupdate.h> -#include <vespa/storageapi/messageapi/bucketinfocommand.h> -#include <vespa/storageapi/messageapi/bucketinforeply.h> - -namespace storage::api { - -/** - * @class BatchPutRemoveCommand - * @ingroup message - * - * @brief Sends a batch of puts and removes - */ -class BatchPutRemoveCommand : public BucketInfoCommand { -public: - class Operation { - public: - enum Type { - REMOVE, // Removes a document - HEADERUPDATE, // Updates the header of a document, if it already exists. - PUT // Inserts a new document. - }; - - Operation(uint64_t ts, Type type); - virtual ~Operation() {}; - - uint64_t timestamp; - Type type; - - virtual const document::DocumentId& getDocumentId() const = 0; - }; - - explicit BatchPutRemoveCommand(const document::Bucket &bucket); - - class PutOperation : public Operation { - public: - PutOperation(document::Document::SP document, uint64_t timestamp); - - document::Document::SP document; - - const document::DocumentId& getDocumentId() const override { - return document->getId(); - } - }; - - class HeaderUpdateOperation : public Operation { - public: - HeaderUpdateOperation(document::Document::SP document, uint64_t newTimestamp, uint64_t timestampToUpdate); - - document::Document::SP document; - uint64_t timestampToUpdate; - - const document::DocumentId& getDocumentId() const override { - return document->getId(); - } - }; - - class RemoveOperation : public Operation { - public: - RemoveOperation(const document::DocumentId& docId, uint64_t timestamp); - - document::DocumentId documentId; - - const document::DocumentId& getDocumentId() const override { - return documentId; - } - }; - - /** - Adds a PUT operation to be performed. - */ - void addPut(document::Document::SP document, uint64_t timestamp); - - /** - Adds a PUT operation to be performed. - */ - void addHeaderUpdate(document::Document::SP document, uint64_t newTimestamp, uint64_t timestampToUpdate); - - /** - Adds a REMOVE operation to be performed. - */ - void addRemove(const document::DocumentId& docId, uint64_t timestamp); - - /** - * Adds an operation to be performed. Optionally deep-clones the - * operation's document. - */ - void addOperation(const Operation& op, bool cloneDocument = false); - - /** - Returns the number of operations in this batch. - */ - uint32_t getOperationCount() const { return _operations.size(); } - - /** - Returns the nth operation in this batch. - */ - const Operation& getOperation(uint32_t index) const { return *_operations[index]; } - - /** - Returns the nth operation in this batch. - */ - Operation& getOperation(uint32_t index) { return *_operations[index]; } - - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - DECLARE_STORAGECOMMAND(BatchPutRemoveCommand, onBatchPutRemove) - -private: - std::vector<std::unique_ptr<Operation> > _operations; - uint32_t _approxSize; -}; - -/** - * @class BatchPutRemoveReply - * @ingroup message - * - * @brief Confirm that a given docoperations have been received. - */ -class BatchPutRemoveReply : public BucketInfoReply { -private: - std::vector<document::DocumentId> _documentsNotFound; - -public: - explicit BatchPutRemoveReply(const BatchPutRemoveCommand&); - - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - const std::vector<document::DocumentId>& getDocumentsNotFound() const { return _documentsNotFound; } - std::vector<document::DocumentId>& getDocumentsNotFound() { return _documentsNotFound; } - - DECLARE_STORAGEREPLY(BatchPutRemoveReply, onBatchPutRemoveReply) -}; - -} diff --git a/storageapi/src/vespa/storageapi/messageapi/messagehandler.h b/storageapi/src/vespa/storageapi/messageapi/messagehandler.h index 4eae26d0442..a9c1dfb8f26 100644 --- a/storageapi/src/vespa/storageapi/messageapi/messagehandler.h +++ b/storageapi/src/vespa/storageapi/messageapi/messagehandler.h @@ -25,7 +25,6 @@ class PutCommand; // Add document class UpdateCommand; // Update document class RemoveCommand; // Remove document class RevertCommand; // Revert put/remove operation -class BatchPutRemoveCommand; class CreateVisitorCommand; // Create a new visitor class DestroyVisitorCommand; // Destroy a running visitor @@ -63,7 +62,6 @@ class PutReply; class UpdateReply; class RemoveReply; class RevertReply; -class BatchPutRemoveReply; class CreateVisitorReply; class DestroyVisitorReply; @@ -141,12 +139,6 @@ public: { return false; } virtual bool onRevertReply(const std::shared_ptr<api::RevertReply>&) { return false; } - virtual bool onBatchPutRemove( - const std::shared_ptr<api::BatchPutRemoveCommand>&) - { return false; } - virtual bool onBatchPutRemoveReply( - const std::shared_ptr<api::BatchPutRemoveReply>&) - { return false; } // Visiting virtual bool onCreateVisitor( diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp index 649e672babb..bab475eea32 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp +++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp @@ -105,8 +105,6 @@ const MessageType MessageType::REMOVELOCATION("Removelocation", REMOVELOCATION_I const MessageType MessageType::REMOVELOCATION_REPLY("Removelocation Reply", REMOVELOCATION_REPLY_ID, &MessageType::REMOVELOCATION); const MessageType MessageType::QUERYRESULT("QueryResult", QUERYRESULT_ID); const MessageType MessageType::QUERYRESULT_REPLY("QueryResult reply", QUERYRESULT_REPLY_ID, &MessageType::QUERYRESULT); -const MessageType MessageType::BATCHPUTREMOVE("BatchPutRemove", BATCHPUTREMOVE_ID); -const MessageType MessageType::BATCHPUTREMOVE_REPLY("BatchPutRemove reply", BATCHPUTREMOVE_REPLY_ID, &MessageType::BATCHPUTREMOVE); const MessageType MessageType::SETBUCKETSTATE("SetBucketState", SETBUCKETSTATE_ID); const MessageType MessageType::SETBUCKETSTATE_REPLY("SetBucketStateReply", SETBUCKETSTATE_REPLY_ID, &MessageType::SETBUCKETSTATE); diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h index cd3753bcf09..c9f6e737a47 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h +++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h @@ -147,8 +147,6 @@ public: REMOVELOCATION_REPLY_ID = 87, QUERYRESULT_ID = 88, QUERYRESULT_REPLY_ID = 89, - BATCHPUTREMOVE_ID = 90, - BATCHPUTREMOVE_REPLY_ID = 91, SETBUCKETSTATE_ID = 94, SETBUCKETSTATE_REPLY_ID = 95, MESSAGETYPE_MAX_ID @@ -231,8 +229,6 @@ public: static const MessageType REMOVELOCATION_REPLY; static const MessageType QUERYRESULT; static const MessageType QUERYRESULT_REPLY; - static const MessageType BATCHPUTREMOVE; - static const MessageType BATCHPUTREMOVE_REPLY; static const MessageType SETBUCKETSTATE; static const MessageType SETBUCKETSTATE_REPLY; |