diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-08 18:48:00 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-16 23:48:46 +0000 |
commit | 6b4486254e67b61e7dbe7dab30ae50d3b0bf01bb (patch) | |
tree | 96a19e31f9a24ea42469668088bf6f011a003bb4 /searchcore | |
parent | cea9cbdd71940cf7b40d6da6e93253c01f9c7564 (diff) |
WipeHistory has not been used for a very long time.
Diffstat (limited to 'searchcore')
10 files changed, 33 insertions, 120 deletions
diff --git a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp index 5775c31b205..ca8274aab00 100644 --- a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp +++ b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp @@ -177,11 +177,11 @@ public: _counter(0) { } - virtual void replay(const PutOperation &op) override { print(op); } - virtual void replay(const RemoveOperation &op) override { print(op); } - virtual void replay(const UpdateOperation &op) override { print(op); } - virtual void replay(const NoopOperation &op) override { print(op); } - virtual void replay(const NewConfigOperation &op) override + void replay(const PutOperation &op) override { print(op); } + void replay(const RemoveOperation &op) override { print(op); } + void replay(const UpdateOperation &op) override { print(op); } + void replay(const NoopOperation &op) override { print(op); } + void replay(const NewConfigOperation &op) override { print(op); typedef std::map<std::string, ConfigFile>::const_iterator I; @@ -191,18 +191,17 @@ public: } } - virtual void replay(const WipeHistoryOperation &op) override { print(op); } - virtual void replay(const DeleteBucketOperation &op) override { print(op); } - virtual void replay(const SplitBucketOperation &op) override { print(op); } - virtual void replay(const JoinBucketsOperation &op) override { print(op); } - virtual void replay(const PruneRemovedDocumentsOperation &op) override { print(op); } - virtual void replay(const MoveOperation &op) override { print(op); } - virtual void replay(const CreateBucketOperation &op) override { print(op); } - virtual void replay(const CompactLidSpaceOperation &op) override { print(op); } - virtual NewConfigOperation::IStreamHandler &getNewConfigStreamHandler() override { + void replay(const DeleteBucketOperation &op) override { print(op); } + void replay(const SplitBucketOperation &op) override { print(op); } + void replay(const JoinBucketsOperation &op) override { print(op); } + void replay(const PruneRemovedDocumentsOperation &op) override { print(op); } + void replay(const MoveOperation &op) override { print(op); } + void replay(const CreateBucketOperation &op) override { print(op); } + void replay(const CompactLidSpaceOperation &op) override { print(op); } + NewConfigOperation::IStreamHandler &getNewConfigStreamHandler() override { return _streamHandler; } - virtual document::DocumentTypeRepo &getDeserializeRepo() override { + document::DocumentTypeRepo &getDeserializeRepo() override { return _repo; } }; @@ -272,7 +271,6 @@ public: } virtual void replay(const NoopOperation &) override { } virtual void replay(const NewConfigOperation &) override { } - virtual void replay(const WipeHistoryOperation &) override { } virtual void replay(const DeleteBucketOperation &) override { } virtual void replay(const SplitBucketOperation &) override { } virtual void replay(const JoinBucketsOperation &) override { } diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp index f99668a13f8..30fed6fa49e 100644 --- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/persistence/spi/result.h> -#include <vespa/document/base/exceptions.h> #include <vespa/document/datatype/tensor_data_type.h> #include <vespa/document/update/assignvalueupdate.h> #include <vespa/document/repo/documenttyperepo.h> @@ -16,7 +15,6 @@ #include <vespa/searchcore/proton/feedoperation/putoperation.h> #include <vespa/searchcore/proton/feedoperation/removeoperation.h> #include <vespa/searchcore/proton/feedoperation/updateoperation.h> -#include <vespa/searchcore/proton/feedoperation/wipehistoryoperation.h> #include <vespa/searchcore/proton/persistenceengine/i_resource_write_filter.h> #include <vespa/searchcore/proton/server/configstore.h> #include <vespa/searchcore/proton/server/ddbstate.h> @@ -28,10 +26,8 @@ #include <vespa/searchlib/common/idestructorcallback.h> #include <vespa/searchlib/index/docbuilder.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> -#include <vespa/searchlib/transactionlog/translogclient.h> #include <vespa/searchlib/transactionlog/translogserver.h> #include <vespa/vespalib/testkit/testapp.h> -#include <vespa/vespalib/util/closuretask.h> #include <vespa/vespalib/util/lambdatask.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/io/fileutil.h> @@ -63,7 +59,6 @@ using vespalib::BlockingThreadStackExecutor; using vespalib::ThreadStackExecutor; using vespalib::ThreadStackExecutorBase; using vespalib::makeClosure; -using vespalib::makeTask; using vespalib::eval::TensorSpec; using vespalib::eval::ValueType; using vespalib::tensor::test::makeTensor; diff --git a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp index 20cfb7c6dcb..c59e95a79eb 100644 --- a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp +++ b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp @@ -13,7 +13,6 @@ #include <vespa/searchcore/proton/feedoperation/removeoperation.h> #include <vespa/searchcore/proton/feedoperation/splitbucketoperation.h> #include <vespa/searchcore/proton/feedoperation/updateoperation.h> -#include <vespa/searchcore/proton/feedoperation/wipehistoryoperation.h> #include <vespa/searchlib/query/base.h> #include <persistence/spi/types.h> #include <vespa/document/base/documentid.h> @@ -218,10 +217,6 @@ TEST("require that toString() on derived classes are meaningful") "prevDbdId=(subDbId=0, lid=0), prevMarkedAsRemoved=false, prevTimestamp=0, serialNum=0)", UpdateOperation(bucket_id1, timestamp, update).toString()); - EXPECT_EQUAL("WipeHistory(wipeTimeLimit=0, serialNum=0)", - WipeHistoryOperation().toString()); - EXPECT_EQUAL("WipeHistory(wipeTimeLimit=20, serialNum=10)", - WipeHistoryOperation(10, 20).toString()); EXPECT_EQUAL("CompactLidSpace(subDbId=2, lidLimit=99, serialNum=0)", CompactLidSpaceOperation(2, 99).toString()); } diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/feedoperation/CMakeLists.txt index f5e09b81313..4f384d1894c 100644 --- a/searchcore/src/vespa/searchcore/proton/feedoperation/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/feedoperation/CMakeLists.txt @@ -17,6 +17,5 @@ vespa_add_library(searchcore_feedoperation STATIC removeoperation.cpp splitbucketoperation.cpp updateoperation.cpp - wipehistoryoperation.cpp DEPENDS ) diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/operations.h b/searchcore/src/vespa/searchcore/proton/feedoperation/operations.h index df9f22b2462..8250ddd8b0e 100644 --- a/searchcore/src/vespa/searchcore/proton/feedoperation/operations.h +++ b/searchcore/src/vespa/searchcore/proton/feedoperation/operations.h @@ -16,5 +16,4 @@ #include "removeoperation.h" #include "splitbucketoperation.h" #include "updateoperation.h" -#include "wipehistoryoperation.h" diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.cpp deleted file mode 100644 index 03c97ace048..00000000000 --- a/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "wipehistoryoperation.h" -#include <vespa/vespalib/objects/nbostream.h> -#include <vespa/vespalib/util/stringfmt.h> - -using vespalib::make_string; - -namespace proton { - -WipeHistoryOperation::WipeHistoryOperation() - : FeedOperation(FeedOperation::WIPE_HISTORY), - _wipeTimeLimit(0) -{ -} - -WipeHistoryOperation::WipeHistoryOperation(SerialNum serialNum, - int64_t wipeTimeLimit) - : FeedOperation(FeedOperation::WIPE_HISTORY), - _wipeTimeLimit(wipeTimeLimit) -{ - setSerialNum(serialNum); -} - -void WipeHistoryOperation::serialize(vespalib::nbostream &str) const { - str << _wipeTimeLimit; -} -void WipeHistoryOperation::deserialize(vespalib::nbostream &str, const document::DocumentTypeRepo &) { - str >> _wipeTimeLimit; -} - -vespalib::string WipeHistoryOperation::toString() const { - return make_string("WipeHistory(wipeTimeLimit=%" PRIu64 ", serialNum=%" PRIu64 ")", - _wipeTimeLimit, getSerialNum()); -} - -} // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.h b/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.h deleted file mode 100644 index d036fee033a..00000000000 --- a/searchcore/src/vespa/searchcore/proton/feedoperation/wipehistoryoperation.h +++ /dev/null @@ -1,22 +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 "feedoperation.h" - -namespace proton { - -class WipeHistoryOperation : public FeedOperation { - int64_t _wipeTimeLimit; - -public: - WipeHistoryOperation(); - WipeHistoryOperation(SerialNum serialNum, int64_t wipeTimeLimit); - ~WipeHistoryOperation() override {} - - void serialize(vespalib::nbostream &str) const override; - void deserialize(vespalib::nbostream &str, const document::DocumentTypeRepo &) override; - vespalib::string toString() const override; -}; - -} // namespace proton - diff --git a/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp b/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp index e45e3d7e423..5a6a990df9b 100644 --- a/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp @@ -10,7 +10,6 @@ #include <vespa/searchcore/proton/common/eventlogger.h> #include <vespa/searchlib/common/idestructorcallback.h> #include <vespa/vespalib/util/closuretask.h> -#include <vespa/vespalib/util/exceptions.h> #include <vespa/log/log.h> @@ -20,7 +19,6 @@ using search::transactionlog::Packet; using search::transactionlog::RPC; using search::SerialNum; using vespalib::Executor; -using vespalib::IllegalStateException; using vespalib::makeClosure; using vespalib::makeTask; using vespalib::make_string; @@ -56,7 +54,7 @@ handlePacket(PacketWrapper::SP wrap, EntryHandler entryHandler) Packet::Entry entry; entry.deserialize(handle); entryHandler->call(entry); - if (wrap->progress != NULL) { + if (wrap->progress != nullptr) { handleProgress(*wrap->progress, entry.serial()); } } @@ -70,8 +68,6 @@ class TransactionLogReplayPacketHandler : public IReplayPacketHandler { IReplayConfig &_replay_config; FeedConfigStore &_config_store; - void handleTransactionLogEntry(const Packet::Entry &entry); - public: TransactionLogReplayPacketHandler(IFeedView *& feed_view_ptr, IBucketDBHandler &bucketDBHandler, @@ -83,53 +79,51 @@ public: _config_store(config_store) { } - virtual void replay(const PutOperation &op) override { + void replay(const PutOperation &op) override { _feed_view_ptr->handlePut(FeedToken(), op); } - virtual void replay(const RemoveOperation &op) override { + void replay(const RemoveOperation &op) override { _feed_view_ptr->handleRemove(FeedToken(), op); } - virtual void replay(const UpdateOperation &op) override { + void replay(const UpdateOperation &op) override { _feed_view_ptr->handleUpdate(FeedToken(), op); } - virtual void replay(const NoopOperation &) override {} // ignored - virtual void replay(const NewConfigOperation &op) override { + void replay(const NoopOperation &) override {} // ignored + void replay(const NewConfigOperation &op) override { _replay_config.replayConfig(op.getSerialNum()); } - virtual void replay(const WipeHistoryOperation &) override { - } - virtual void replay(const DeleteBucketOperation &op) override { + + void replay(const DeleteBucketOperation &op) override { _feed_view_ptr->handleDeleteBucket(op); } - virtual void replay(const SplitBucketOperation &op) override { + void replay(const SplitBucketOperation &op) override { _bucketDBHandler.handleSplit(op.getSerialNum(), op.getSource(), op.getTarget1(), op.getTarget2()); } - virtual void replay(const JoinBucketsOperation &op) override { + void replay(const JoinBucketsOperation &op) override { _bucketDBHandler.handleJoin(op.getSerialNum(), op.getSource1(), op.getSource2(), op.getTarget()); } - virtual void replay(const PruneRemovedDocumentsOperation &op) override { + void replay(const PruneRemovedDocumentsOperation &op) override { _feed_view_ptr->handlePruneRemovedDocuments(op); } - virtual void replay(const MoveOperation &op) override { + void replay(const MoveOperation &op) override { _feed_view_ptr->handleMove(op, search::IDestructorCallback::SP()); } - virtual void replay(const CreateBucketOperation &) override { + void replay(const CreateBucketOperation &) override { } - virtual void replay(const CompactLidSpaceOperation &op) override { + void replay(const CompactLidSpaceOperation &op) override { _feed_view_ptr->handleCompactLidSpace(op); } - virtual NewConfigOperation::IStreamHandler &getNewConfigStreamHandler() override { + NewConfigOperation::IStreamHandler &getNewConfigStreamHandler() override { return _config_store; } - virtual const document::DocumentTypeRepo &getDeserializeRepo() override { + const document::DocumentTypeRepo &getDeserializeRepo() override { return *_feed_view_ptr->getDocumentTypeRepo(); } }; -void startDispatch(IReplayPacketHandler *packet_handler, - const Packet::Entry &entry) { +void startDispatch(IReplayPacketHandler *packet_handler, const Packet::Entry &entry) { // Called by handlePacket() in executor thread. LOG(spam, "replay packet entry: entrySerial(%" PRIu64 "), entryType(%u)", @@ -154,8 +148,7 @@ ReplayTransactionLogState::ReplayTransactionLogState( replay_config, config_store)) { } -void ReplayTransactionLogState::receive(const PacketWrapper::SP &wrap, - Executor &executor) { +void ReplayTransactionLogState::receive(const PacketWrapper::SP &wrap, Executor &executor) { EntryHandler closure = makeClosure(&startDispatch, _packet_handler.get()); executor.execute(makeTask(makeClosure(&handlePacket, wrap, std::move(closure)))); } diff --git a/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h b/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h index 8df51780c9f..6de61e5eeb7 100644 --- a/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h +++ b/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h @@ -11,7 +11,6 @@ class RemoveOperation; class UpdateOperation; struct NoopOperation; class NewConfigOperation; -class WipeHistoryOperation; class DeleteBucketOperation; class SplitBucketOperation; class JoinBucketsOperation; @@ -34,7 +33,6 @@ struct IReplayPacketHandler virtual void replay(const UpdateOperation &op) = 0; virtual void replay(const NoopOperation &op) = 0; virtual void replay(const NewConfigOperation &op) = 0; - virtual void replay(const WipeHistoryOperation &op) = 0; virtual void replay(const DeleteBucketOperation &op) = 0; virtual void replay(const SplitBucketOperation &op) = 0; virtual void replay(const JoinBucketsOperation &op) = 0; diff --git a/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp b/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp index f78f7703d21..fcf1cf2a58c 100644 --- a/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/replaypacketdispatcher.cpp @@ -52,10 +52,6 @@ ReplayPacketDispatcher::replayEntry(const Packet::Entry &entry) op.deserialize(is, _handler.getDeserializeRepo()); _handler.replay(op); break; - } case FeedOperation::WIPE_HISTORY: { - WipeHistoryOperation op; - replay(op, is, entry); - break; } case FeedOperation::DELETE_BUCKET: { DeleteBucketOperation op; replay(op, is, entry); @@ -86,8 +82,7 @@ ReplayPacketDispatcher::replayEntry(const Packet::Entry &entry) break; } default: throw IllegalStateException - (make_string("Got packet entry with unknown type id '%u' from TLS", - entry.type())); + (make_string("Got packet entry with unknown type id '%u' from TLS", entry.type())); } if (is.size() > 0) { throw document::DeserializeException |