From 7d61a960839ea0400cd2e345997425419ab697f4 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Tue, 25 Sep 2018 14:43:55 +0200 Subject: Remove BatchDocumentUpdateMessage and BatchDocumentUpdateReply from C++ portion of documentapi. Remove corresponding document api cross language files. Remove corresponding storageapi messages. --- .../storageapi/mbusprot/protocolserialization.h | 2 - storageapi/src/vespa/storageapi/message/batch.cpp | 41 ------------------- storageapi/src/vespa/storageapi/message/batch.h | 47 ---------------------- .../vespa/storageapi/messageapi/messagehandler.h | 8 ---- .../vespa/storageapi/messageapi/storagemessage.cpp | 2 - .../vespa/storageapi/messageapi/storagemessage.h | 4 -- 6 files changed, 104 deletions(-) (limited to 'storageapi') diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h index e7d80a0614f..c3b54cd9e46 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h @@ -52,8 +52,6 @@ class RemoveLocationCommand; class RemoveLocationReply; class BatchPutRemoveCommand; class BatchPutRemoveReply; -class BatchDocumentUpdateCommand; -class BatchDocumentUpdateReply; } namespace storage::mbusprot { diff --git a/storageapi/src/vespa/storageapi/message/batch.cpp b/storageapi/src/vespa/storageapi/message/batch.cpp index de8ac849dee..ad90a622491 100644 --- a/storageapi/src/vespa/storageapi/message/batch.cpp +++ b/storageapi/src/vespa/storageapi/message/batch.cpp @@ -9,8 +9,6 @@ using document::BucketSpace; IMPLEMENT_COMMAND(BatchPutRemoveCommand, BatchPutRemoveReply) IMPLEMENT_REPLY(BatchPutRemoveReply) -IMPLEMENT_COMMAND(BatchDocumentUpdateCommand, BatchDocumentUpdateReply) -IMPLEMENT_REPLY(BatchDocumentUpdateReply) BatchPutRemoveCommand::Operation::Operation(uint64_t ts, Type tp) @@ -132,42 +130,3 @@ BatchPutRemoveReply::print(std::ostream& out, bool verbose, BucketInfoReply::print(out, verbose, indent); } } - -BatchDocumentUpdateCommand::BatchDocumentUpdateCommand(const UpdateList& updates) - : StorageCommand(MessageType::BATCHDOCUMENTUPDATE), - _updates(updates), - _bucket(BucketSpace::placeHolder(), document::BucketId()) -{ - document::BucketIdFactory factory; - _bucket = document::Bucket(BucketSpace::placeHolder(), factory.getBucketId(updates[0]->getId())); -} - -void -BatchDocumentUpdateCommand::print(std::ostream& out, bool verbose, - const std::string& indent) const { - out << "BatchDocumentUpdate(" << _updates.size() << " operations)"; - - if (verbose) { - out << " : "; - StorageCommand::print(out, verbose, indent); - } -} - -BatchDocumentUpdateReply::BatchDocumentUpdateReply(const BatchDocumentUpdateCommand& cmd) - : StorageReply(cmd), - _documentsNotFound() -{ -} - -void -BatchDocumentUpdateReply::print(std::ostream& out, bool verbose, - const std::string& indent) const { - out << "BatchDocumentUpdateReply(" - << std::count(_documentsNotFound.begin(), _documentsNotFound.end(), true) - << " not found)"; - - if (verbose) { - out << " : "; - StorageReply::print(out, verbose, indent); - } -} diff --git a/storageapi/src/vespa/storageapi/message/batch.h b/storageapi/src/vespa/storageapi/message/batch.h index 56cca3cfe38..f265bbca6fb 100644 --- a/storageapi/src/vespa/storageapi/message/batch.h +++ b/storageapi/src/vespa/storageapi/message/batch.h @@ -136,51 +136,4 @@ public: DECLARE_STORAGEREPLY(BatchPutRemoveReply, onBatchPutRemoveReply) }; -class BatchDocumentUpdateCommand : public StorageCommand -{ -public: - typedef std::vector UpdateList; - - /** - Creates a batch update message containing the given updates. - */ - BatchDocumentUpdateCommand(const UpdateList& updates); - - /** - @return Returns a list of the updates to be performed. - */ - const UpdateList& getUpdates() const { return _updates; }; - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - - /** - Returns a bucket suitable for routing this message. - */ - document::Bucket getBucket() const override { return _bucket; } - bool hasSingleBucketId() const override { return true; } - - DECLARE_STORAGECOMMAND(BatchDocumentUpdateCommand, onBatchDocumentUpdate) - -private: - UpdateList _updates; - document::Bucket _bucket; -}; - -/** - * @class BatchDocumentUpdateReply - * @ingroup message - * - * @brief Confirm that a given docoperations have been received. - */ -class BatchDocumentUpdateReply : public StorageReply { - // 1-1 mapping of found/not found state for documents - std::vector _documentsNotFound; -public: - explicit BatchDocumentUpdateReply(const BatchDocumentUpdateCommand&); - void print(std::ostream& out, bool verbose, const std::string& indent) const override; - const std::vector& getDocumentsNotFound() const { return _documentsNotFound; } - std::vector& getDocumentsNotFound() { return _documentsNotFound; } - - DECLARE_STORAGEREPLY(BatchDocumentUpdateReply, onBatchDocumentUpdateReply) -}; - } diff --git a/storageapi/src/vespa/storageapi/messageapi/messagehandler.h b/storageapi/src/vespa/storageapi/messageapi/messagehandler.h index e7bd2b5bf27..4eae26d0442 100644 --- a/storageapi/src/vespa/storageapi/messageapi/messagehandler.h +++ b/storageapi/src/vespa/storageapi/messageapi/messagehandler.h @@ -26,7 +26,6 @@ class UpdateCommand; // Update document class RemoveCommand; // Remove document class RevertCommand; // Revert put/remove operation class BatchPutRemoveCommand; -class BatchDocumentUpdateCommand; class CreateVisitorCommand; // Create a new visitor class DestroyVisitorCommand; // Destroy a running visitor @@ -65,7 +64,6 @@ class UpdateReply; class RemoveReply; class RevertReply; class BatchPutRemoveReply; -class BatchDocumentUpdateReply; class CreateVisitorReply; class DestroyVisitorReply; @@ -149,12 +147,6 @@ public: virtual bool onBatchPutRemoveReply( const std::shared_ptr&) { return false; } - virtual bool onBatchDocumentUpdate( - const std::shared_ptr&) - { return false; } - virtual bool onBatchDocumentUpdateReply( - const std::shared_ptr&) - { 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 563a2aab7c1..649e672babb 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp +++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp @@ -107,8 +107,6 @@ 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::BATCHDOCUMENTUPDATE("BatchDocumentUpdate", BATCHDOCUMENTUPDATE_ID); -const MessageType MessageType::BATCHDOCUMENTUPDATE_REPLY("BatchDocumentUpdate reply", BATCHDOCUMENTUPDATE_REPLY_ID, &MessageType::BATCHDOCUMENTUPDATE); 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 c81ee51ae22..cd3753bcf09 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.h +++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.h @@ -149,8 +149,6 @@ public: QUERYRESULT_REPLY_ID = 89, BATCHPUTREMOVE_ID = 90, BATCHPUTREMOVE_REPLY_ID = 91, - BATCHDOCUMENTUPDATE_ID = 92, - BATCHDOCUMENTUPDATE_REPLY_ID = 93, SETBUCKETSTATE_ID = 94, SETBUCKETSTATE_REPLY_ID = 95, MESSAGETYPE_MAX_ID @@ -235,8 +233,6 @@ public: static const MessageType QUERYRESULT_REPLY; static const MessageType BATCHPUTREMOVE; static const MessageType BATCHPUTREMOVE_REPLY; - static const MessageType BATCHDOCUMENTUPDATE; - static const MessageType BATCHDOCUMENTUPDATE_REPLY; static const MessageType SETBUCKETSTATE; static const MessageType SETBUCKETSTATE_REPLY; -- cgit v1.2.3