diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-17 22:48:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-17 22:48:12 +0200 |
commit | ba3d1e4de167511767b70e63a91ef6c740b76add (patch) | |
tree | fd9cec2ae699630d24ee27980a40347e0d53b25e | |
parent | 2e60b8217b93fc9222ec00422de9ff909b775b42 (diff) |
Revert "Introduce async write interface in the TLS."
20 files changed, 99 insertions, 134 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index bce3fb7267c..3b199d266a8 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -21,8 +21,9 @@ #include <vespa/searchcore/proton/server/memoryconfigstore.h> #include <vespa/searchcore/proton/server/searchview.h> #include <vespa/searchcore/proton/server/summaryadapter.h> -#include <vespa/searchlib/common/gatecallback.h> +#include <vespa/searchlib/common/idestructorcallback.h> #include <vespa/searchlib/common/transport.h> +#include <vespa/searchlib/docstore/logdocumentstore.h> #include <vespa/searchlib/engine/docsumapi.h> #include <vespa/searchlib/index/docbuilder.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> @@ -253,7 +254,7 @@ public: op.setSerialNum(serialNum); op.setDbDocumentId(dbdId); op.setPrevDbDocumentId(prevDbdId); - _ddb->getFeedHandler().storeOperation(op, std::make_shared<search::IgnoreCallback>()); + _ddb->getFeedHandler().storeOperation(op); SearchView *sv(dynamic_cast<SearchView *>(_ddb->getReadySubDB()->getSearchView().get())); if (sv != NULL) { // cf. FeedView::putAttributes() diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp index b8ffc41d3cd..823c31dd1c2 100644 --- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp @@ -370,7 +370,7 @@ struct MyTlsWriter : TlsWriter { bool erase_return; MyTlsWriter() : store_count(0), erase_count(0), erase_return(true) {} - void storeOperation(const FeedOperation &, DoneCallback) override { ++store_count; } + void storeOperation(const FeedOperation &) override { ++store_count; } bool erase(SerialNum) override { ++erase_count; return erase_return; } SerialNum sync(SerialNum syncTo) override { diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp index 56bd99c90f6..55f71da9687 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp @@ -138,7 +138,7 @@ struct MyStorer : public IOperationStorer : _moveCnt(0), _compactCnt(0) {} - void storeOperation(const FeedOperation &op, DoneCallback) override { + virtual void storeOperation(FeedOperation &op) override { if (op.getType() == FeedOperation::MOVE) { ++ _moveCnt; } else if (op.getType() == FeedOperation::COMPACT_LID_SPACE) { diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp index f20ad01bcf6..559dbb240a8 100644 --- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp +++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp @@ -26,7 +26,7 @@ #include <vespa/searchcore/proton/test/test.h> #include <vespa/searchlib/attribute/attributecontext.h> #include <vespa/searchlib/attribute/attributeguard.h> -#include <vespa/searchlib/common/gatecallback.h> +#include <vespa/searchlib/common/idestructorcallback.h> #include <vespa/searchlib/common/idocumentmetastore.h> #include <vespa/searchlib/index/docbuilder.h> #include <vespa/vespalib/data/slime/slime.h> @@ -232,7 +232,7 @@ public: } // Implements IOperationStorer - virtual void storeOperation(const FeedOperation &op, DoneCallback) override; + virtual void storeOperation(FeedOperation &op) override; uint32_t getHeartBeats() { return _heartBeats; @@ -781,6 +781,7 @@ MyFeedHandler::isExecutorThread() void MyFeedHandler::handleMove(MoveOperation &op, IDestructorCallback::SP moveDoneCtx) { + (void) moveDoneCtx; assert(isExecutorThread()); assert(op.getValidPrevDbdId()); _subDBs[op.getSubDbId()]->prepareMove(op); @@ -791,7 +792,7 @@ MyFeedHandler::handleMove(MoveOperation &op, IDestructorCallback::SP moveDoneCtx assert(op.getPrevSubDbId() != 1u); assert(op.getSubDbId() < _subDBs.size()); assert(op.getPrevSubDbId() < _subDBs.size()); - storeOperation(op, std::move(moveDoneCtx)); + storeOperation(op); _subDBs[op.getSubDbId()]->handleMove(op); _subDBs[op.getPrevSubDbId()]->handleMove(op); } @@ -802,7 +803,7 @@ MyFeedHandler::performPruneRemovedDocuments(PruneRemovedDocumentsOperation &op) { assert(isExecutorThread()); if (op.getLidsToRemove()->getNumLids() != 0u) { - storeOperation(op, std::make_shared<search::IgnoreCallback>()); + storeOperation(op); // magic number. _subDBs[1u]->handlePruneRemovedDocuments(op); } @@ -825,9 +826,9 @@ MyFeedHandler::setSubDBs(const std::vector<MyDocumentSubDB *> &subDBs) void -MyFeedHandler::storeOperation(const FeedOperation &op, DoneCallback) +MyFeedHandler::storeOperation(FeedOperation &op) { - const_cast<FeedOperation &>(op).setSerialNum(incSerialNum()); + op.setSerialNum(incSerialNum()); } @@ -1010,16 +1011,22 @@ MaintenanceControllerFixture::performForwardMaintenanceConfig() void -MaintenanceControllerFixture::insertDocs(const test::UserDocuments &docs, MyDocumentSubDB &subDb) +MaintenanceControllerFixture::insertDocs(const test::UserDocuments &docs, + MyDocumentSubDB &subDb) { - for (auto itr = docs.begin(); itr != docs.end(); ++itr) { + for (test::UserDocuments::Iterator itr = docs.begin(); + itr != docs.end(); + ++itr) { const test::BucketDocuments &bucketDocs = itr->second; for (size_t i = 0; i < bucketDocs.getDocs().size(); ++i) { const test::Document &testDoc = bucketDocs.getDocs()[i]; - PutOperation op(testDoc.getBucket(), testDoc.getTimestamp(), testDoc.getDoc()); - op.setDbDocumentId(DbDocumentId(subDb.getSubDBId(), testDoc.getLid())); - _fh.storeOperation(op, std::make_shared<search::IgnoreCallback>()); + PutOperation op(testDoc.getBucket(), + testDoc.getTimestamp(), + testDoc.getDoc()); + op.setDbDocumentId(DbDocumentId(subDb.getSubDBId(), + testDoc.getLid())); + _fh.storeOperation(op); subDb.handlePut(op); } } @@ -1031,13 +1038,18 @@ MaintenanceControllerFixture::removeDocs(const test::UserDocuments &docs, Timestamp timestamp) { - for (auto itr = docs.begin(); itr != docs.end(); ++itr) { + for (test::UserDocuments::Iterator itr = docs.begin(); + itr != docs.end(); + ++itr) { const test::BucketDocuments &bucketDocs = itr->second; for (size_t i = 0; i < bucketDocs.getDocs().size(); ++i) { const test::Document &testDoc = bucketDocs.getDocs()[i]; - RemoveOperation op(testDoc.getBucket(), timestamp, testDoc.getDoc()->getId()); - op.setDbDocumentId(DbDocumentId(_removed.getSubDBId(), testDoc.getLid())); - _fh.storeOperation(op, std::make_shared<search::IgnoreCallback>()); + RemoveOperation op(testDoc.getBucket(), + timestamp, + testDoc.getDoc()->getId()); + op.setDbDocumentId(DbDocumentId(_removed.getSubDBId(), + testDoc.getLid())); + _fh.storeOperation(op); _removed.handleRemove(op); } } diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index 5babacfc4b6..4198803d1fe 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -307,7 +307,7 @@ DocumentDB::enterReprocessState() if (!runner.empty()) { runner.run(); NoopOperation op; - _feedHandler.storeOperationSync(op); + _feedHandler.storeOperation(op); sync(op.getSerialNum()); _subDBs.pruneRemovedFields(op.getSerialNum()); } @@ -397,14 +397,15 @@ DocumentDB::applyConfig(DocumentDBConfig::SP configSnapshot, SerialNum serialNum _config_store->saveConfig(*configSnapshot, serialNum); // save entry in transaction log NewConfigOperation op(serialNum, *_config_store); - _feedHandler.storeOperationSync(op); + _feedHandler.storeOperation(op); sync(op.getSerialNum()); } bool hasVisibilityDelayChanged = false; { bool elidedConfigSave = equalReplayConfig && tlsReplayDone; // Flush changes to attributes and memory index, cf. visibilityDelay - _feedView.get()->forceCommit(elidedConfigSave ? serialNum : serialNum - 1); + _feedView.get()->forceCommit(elidedConfigSave ? serialNum : + serialNum - 1); _writeService.sync(); fastos::TimeStamp visibilityDelay = configSnapshot->getMaintenanceConfigSP()->getVisibilityDelay(); hasVisibilityDelayChanged = (visibilityDelay != _visibility.getVisibilityDelay()); @@ -584,7 +585,7 @@ DocumentDB::saveInitialConfig(const DocumentDBConfig &configSnapshot) // pruned at once anyway. // save noop entry in transaction log NoopOperation op; - _feedHandler.storeOperationSync(op); + _feedHandler.storeOperation(op); sync(op.getSerialNum()); // Wipe everything in transaction log before initial config. try { @@ -608,7 +609,7 @@ DocumentDB::resumeSaveConfig() SerialNum confSerial = _feedHandler.incSerialNum(); // resume operation, i.e. save config entry in transaction log NewConfigOperation op(confSerial, *_config_store); - _feedHandler.storeOperationSync(op); + _feedHandler.storeOperation(op); sync(op.getSerialNum()); } @@ -775,7 +776,7 @@ DocumentDB::enterRedoReprocessState() runner.run(); _subDBs.onReprocessDone(_feedHandler.getSerialNum()); NoopOperation op; - _feedHandler.storeOperationSync(op); + _feedHandler.storeOperation(op); sync(op.getSerialNum()); _subDBs.pruneRemovedFields(op.getSerialNum()); } diff --git a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp index 5890489415e..b01ba43cb49 100644 --- a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp @@ -12,7 +12,7 @@ #include <vespa/searchcore/proton/persistenceengine/i_resource_write_filter.h> #include <vespa/searchcore/proton/persistenceengine/transport_latch.h> #include <vespa/searchcorespi/index/ithreadingservice.h> -#include <vespa/searchlib/common/gatecallback.h> +#include <vespa/searchlib/common/idestructorcallback.h> #include <vespa/vespalib/util/exceptions.h> #include <unistd.h> @@ -46,8 +46,8 @@ ignoreOperation(const DocumentOperation &op) { } // namespace -void FeedHandler::TlsMgrWriter::storeOperation(const FeedOperation &op, DoneCallback onDone) { - TlcProxy(_tls_mgr.getDomainName(), *_tlsDirectWriter).storeOperation(op, std::move(onDone)); +void FeedHandler::TlsMgrWriter::storeOperation(const FeedOperation &op) { + TlcProxy(_tls_mgr.getDomainName(), *_tlsDirectWriter).storeOperation(op); } bool FeedHandler::TlsMgrWriter::erase(SerialNum oldest_to_keep) { return _tls_mgr.getSession()->erase(oldest_to_keep); @@ -72,6 +72,7 @@ FeedHandler::TlsMgrWriter::sync(SerialNum syncTo) LOG(spam, "Tls sync incomplete, reached %" PRIu64 ", retrying", syncedTo); } throw IllegalStateException(make_string("Failed to sync TLS to token %" PRIu64 ".", syncTo)); + return 0; } void @@ -93,7 +94,7 @@ void FeedHandler::performPut(FeedToken token, PutOperation &op) { } return; } - storeOperation(op, token); + storeOperation(op); if (token) { token->setResult(std::make_unique<Result>(), false); } @@ -120,7 +121,7 @@ FeedHandler::performUpdate(FeedToken token, UpdateOperation &op) void FeedHandler::performInternalUpdate(FeedToken token, UpdateOperation &op) { - storeOperation(op, token); + storeOperation(op); if (token) { token->setResult(ResultUP(new UpdateResult(op.getPrevTimestamp())), true); } @@ -136,7 +137,7 @@ FeedHandler::createNonExistingDocument(FeedToken token, const UpdateOperation &o op.getUpdate()->applyTo(*doc); PutOperation putOp(op.getBucketId(), op.getTimestamp(), doc); _activeFeedView->preparePut(putOp); - storeOperation(putOp, token); + storeOperation(putOp); if (token) { token->setResult(ResultUP(new UpdateResult(putOp.getTimestamp())), true); } @@ -159,7 +160,7 @@ void FeedHandler::performRemove(FeedToken token, RemoveOperation &op) { if (op.getPrevDbDocumentId().valid()) { assert(op.getValidNewOrPrevDbdId()); assert(op.notMovingLidInSameSubDb()); - storeOperation(op, token); + storeOperation(op); if (token) { bool documentWasFound = !op.getPrevMarkedAsRemoved(); token->setResult(ResultUP(new RemoveResult(documentWasFound)), documentWasFound); @@ -167,7 +168,7 @@ void FeedHandler::performRemove(FeedToken token, RemoveOperation &op) { _activeFeedView->handleRemove(std::move(token), op); } else if (op.hasDocType()) { assert(op.getDocType() == _docTypeName.getName()); - storeOperation(op, token); + storeOperation(op); if (token) { token->setResult(ResultUP(new RemoveResult(false)), false); } @@ -185,16 +186,20 @@ FeedHandler::performGarbageCollect(FeedToken token) (void) token; } + void FeedHandler::performCreateBucket(FeedToken token, CreateBucketOperation &op) { - storeOperation(op, std::move(token)); + (void) token; + storeOperation(op); _bucketDBHandler->handleCreateBucket(op.getBucketId()); } + void FeedHandler::performDeleteBucket(FeedToken token, DeleteBucketOperation &op) { + (void) token; _activeFeedView->prepareDeleteBucket(op); - storeOperation(op, std::move(token)); + storeOperation(op); // Delete documents in bucket _activeFeedView->handleDeleteBucket(op); // Delete bucket itself, should no longer have documents. @@ -202,16 +207,21 @@ void FeedHandler::performDeleteBucket(FeedToken token, DeleteBucketOperation &op } + void FeedHandler::performSplit(FeedToken token, SplitBucketOperation &op) { - storeOperation(op, std::move(token)); + (void) token; + storeOperation(op); _bucketDBHandler->handleSplit(op.getSerialNum(), op.getSource(), op.getTarget1(), op.getTarget2()); } + void FeedHandler::performJoin(FeedToken token, JoinBucketsOperation &op) { - storeOperation(op, std::move(token)); + (void) token; + storeOperation(op); _bucketDBHandler->handleJoin(op.getSerialNum(), op.getSource1(), op.getSource2(), op.getTarget()); } + void FeedHandler::performSync() { @@ -402,28 +412,18 @@ FeedHandler::isDoingReplay() const { return _tlsMgr.isDoingReplay(); } -bool -FeedHandler::getTransactionLogReplayDone() const { +bool FeedHandler::getTransactionLogReplayDone() const { return _tlsMgr.getReplayDone(); } -void -FeedHandler::storeOperation(const FeedOperation &op, TlsWriter::DoneCallback onDone) { +void FeedHandler::storeOperation(FeedOperation &op) { if (!op.getSerialNum()) { - const_cast<FeedOperation &>(op).setSerialNum(incSerialNum()); + op.setSerialNum(incSerialNum()); } - _tlsWriter.storeOperation(op, std::move(onDone)); + _tlsWriter.storeOperation(op); } -void -FeedHandler::storeOperationSync(const FeedOperation &op) { - vespalib::Gate gate; - storeOperation(op, std::make_shared<search::GateCallback>(gate)); - gate.await(); -} - -void -FeedHandler::tlsPrune(SerialNum oldest_to_keep) { +void FeedHandler::tlsPrune(SerialNum oldest_to_keep) { if (!_tlsWriter.erase(oldest_to_keep)) { throw IllegalStateException(make_string("Failed to prune TLS to token %" PRIu64 ".", oldest_to_keep)); } @@ -533,7 +533,7 @@ FeedHandler::handleMove(MoveOperation &op, std::shared_ptr<search::IDestructorCa assert(op.getValidDbdId()); assert(op.getValidPrevDbdId()); assert(op.getSubDbId() != op.getPrevSubDbId()); - storeOperation(op, moveDoneCtx); + storeOperation(op); _activeFeedView->handleMove(op, std::move(moveDoneCtx)); } @@ -577,9 +577,7 @@ performPruneRemovedDocuments(PruneRemovedDocumentsOperation &pruneOp) { const LidVectorContext::SP lids_to_remove = pruneOp.getLidsToRemove(); if (lids_to_remove && lids_to_remove->getNumLids() != 0) { - vespalib::Gate gate; - storeOperation(pruneOp, std::make_shared<search::GateCallback>(gate)); - gate.await(); + storeOperation(pruneOp); _activeFeedView->handlePruneRemovedDocuments(pruneOp); } } diff --git a/searchcore/src/vespa/searchcore/proton/server/feedhandler.h b/searchcore/src/vespa/searchcore/proton/server/feedhandler.h index 8c28fcdc1ea..d717346883a 100644 --- a/searchcore/src/vespa/searchcore/proton/server/feedhandler.h +++ b/searchcore/src/vespa/searchcore/proton/server/feedhandler.h @@ -65,7 +65,7 @@ private: _tls_mgr(tls_mgr), _tlsDirectWriter(tlsDirectWriter) { } - void storeOperation(const FeedOperation &op, DoneCallback onDone) override; + void storeOperation(const FeedOperation &op) override; bool erase(SerialNum oldest_to_keep) override; SerialNum sync(SerialNum syncTo) override; }; @@ -234,8 +234,7 @@ public: void eof() override; void performPruneRemovedDocuments(PruneRemovedDocumentsOperation &pruneOp) override; void syncTls(SerialNum syncTo); - void storeOperation(const FeedOperation &op, DoneCallback onDone) override; - void storeOperationSync(const FeedOperation & op); + void storeOperation(FeedOperation &op) override; void considerDelayedPrune(); }; diff --git a/searchcore/src/vespa/searchcore/proton/server/i_operation_storer.h b/searchcore/src/vespa/searchcore/proton/server/i_operation_storer.h index 760250844a8..4e5958cd9e2 100644 --- a/searchcore/src/vespa/searchcore/proton/server/i_operation_storer.h +++ b/searchcore/src/vespa/searchcore/proton/server/i_operation_storer.h @@ -2,8 +2,6 @@ #pragma once -#include <vespa/searchlib/transactionlog/common.h> - namespace proton { class FeedOperation; @@ -13,13 +11,12 @@ class FeedOperation; */ struct IOperationStorer { - using DoneCallback = search::transactionlog::Writer::DoneCallback; - virtual ~IOperationStorer() = default; + virtual ~IOperationStorer() {} /** * Assign serial number to (if not set) and store the given operation. */ - virtual void storeOperation(const FeedOperation &op, DoneCallback onDone) = 0; + virtual void storeOperation(FeedOperation &op) = 0; }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp index 2ae8d826ebc..d6c1a032cea 100644 --- a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp @@ -5,8 +5,7 @@ #include "imaintenancejobrunner.h" #include "lid_space_compaction_job.h" #include <vespa/searchcore/proton/common/eventlogger.h> -#include <vespa/searchlib/common/gatecallback.h> -#include <vespa/vespalib/util/sync.h> +#include <vespa/searchlib/common/idestructorcallback.h> #include <cassert> #include <vespa/log/log.h> @@ -56,9 +55,8 @@ LidSpaceCompactionJob::scanDocuments(const LidUsageStats &stats) return true; } else { MoveOperation::UP op = _handler.createMoveOperation(document, stats.getLowestFreeLid()); - search::IDestructorCallback::SP context = _moveOpsLimiter->beginOperation(); - _opStorer.storeOperation(*op, context); - _handler.handleMove(*op, std::move(context)); + _opStorer.storeOperation(*op); + _handler.handleMove(*op, _moveOpsLimiter->beginOperation()); if (isBlocked(BlockedReason::OUTSTANDING_OPS)) { return true; } @@ -81,9 +79,7 @@ LidSpaceCompactionJob::compactLidSpace(const LidUsageStats &stats) { uint32_t wantedLidLimit = stats.getHighestUsedLid() + 1; CompactLidSpaceOperation op(_handler.getSubDbId(), wantedLidLimit); - vespalib::Gate gate; - _opStorer.storeOperation(op, std::make_shared<search::GateCallback>(gate)); - gate.await(); + _opStorer.storeOperation(op); _handler.handleCompactLidSpace(op); EventLogger::lidSpaceCompactionComplete(_handler.getName(), wantedLidLimit); _shouldCompactLidSpace = false; diff --git a/searchcore/src/vespa/searchcore/proton/server/tlcproxy.cpp b/searchcore/src/vespa/searchcore/proton/server/tlcproxy.cpp index bfc59dee35e..215650b6664 100644 --- a/searchcore/src/vespa/searchcore/proton/server/tlcproxy.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/tlcproxy.cpp @@ -11,24 +11,24 @@ using search::transactionlog::Packet; namespace proton { -void TlcProxy::commit(search::SerialNum serialNum, search::transactionlog::Type type, - const vespalib::nbostream &buf, DoneCallback onDone) +void TlcProxy::commit(search::SerialNum serialNum, search::transactionlog::Type type, const vespalib::nbostream &buf) { Packet::Entry entry(serialNum, type, vespalib::ConstBufferRef(buf.c_str(), buf.size())); Packet packet; packet.add(entry); packet.close(); - _tlsDirectWriter.commit(_domain, packet, std::move(onDone)); + _tlsDirectWriter.commit(_domain, packet); + } void -TlcProxy::storeOperation(const FeedOperation &op, DoneCallback onDone) +TlcProxy::storeOperation(const FeedOperation &op) { nbostream stream; op.serialize(stream); LOG(debug, "storeOperation(): serialNum(%" PRIu64 "), type(%u), size(%zu)", op.getSerialNum(), (uint32_t)op.getType(), stream.size()); - commit(op.getSerialNum(), (uint32_t)op.getType(), stream, std::move(onDone)); + commit(op.getSerialNum(), (uint32_t)op.getType(), stream); } } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/tlcproxy.h b/searchcore/src/vespa/searchcore/proton/server/tlcproxy.h index 2dc6501731e..8e4feb2f354 100644 --- a/searchcore/src/vespa/searchcore/proton/server/tlcproxy.h +++ b/searchcore/src/vespa/searchcore/proton/server/tlcproxy.h @@ -8,20 +8,18 @@ namespace proton { class FeedOperation; class TlcProxy { - using DoneCallback = search::transactionlog::Writer::DoneCallback; - using Writer = search::transactionlog::Writer; - vespalib::string _domain; - Writer & _tlsDirectWriter; + vespalib::string _domain; + search::transactionlog::Writer & _tlsDirectWriter; - void commit(search::SerialNum serialNum, search::transactionlog::Type type, - const vespalib::nbostream &buf, DoneCallback onDone); + void commit(search::SerialNum serialNum, search::transactionlog::Type type, const vespalib::nbostream &buf); public: typedef std::unique_ptr<TlcProxy> UP; - TlcProxy(const vespalib::string & domain, Writer & writer) + TlcProxy(const vespalib::string & domain, search::transactionlog::Writer & writer) : _domain(domain), _tlsDirectWriter(writer) {} - void storeOperation(const FeedOperation &op, DoneCallback onDone); + void storeOperation(const FeedOperation &op); }; } // namespace proton + diff --git a/searchcore/src/vespa/searchcore/proton/server/tlswriter.h b/searchcore/src/vespa/searchcore/proton/server/tlswriter.h index 5d51580c0ad..0956c0ae011 100644 --- a/searchcore/src/vespa/searchcore/proton/server/tlswriter.h +++ b/searchcore/src/vespa/searchcore/proton/server/tlswriter.h @@ -2,17 +2,19 @@ #pragma once -#include "i_operation_storer.h" #include <vespa/searchlib/common/serialnum.h> namespace proton { +class FeedOperation; + /** * Interface for writing to the TransactionLogServer. */ -struct TlsWriter : public IOperationStorer { - virtual ~TlsWriter() = default; +struct TlsWriter { + virtual ~TlsWriter() {} + virtual void storeOperation(const FeedOperation &op) = 0; virtual bool erase(search::SerialNum oldest_to_keep) = 0; virtual search::SerialNum sync(search::SerialNum syncTo) = 0; }; diff --git a/searchlib/src/vespa/searchlib/common/CMakeLists.txt b/searchlib/src/vespa/searchlib/common/CMakeLists.txt index f9db738528c..b1f71303449 100644 --- a/searchlib/src/vespa/searchlib/common/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/common/CMakeLists.txt @@ -13,7 +13,6 @@ vespa_add_library(searchlib_common OBJECT featureset.cpp fileheadercontext.cpp foregroundtaskexecutor.cpp - gatecallback.cpp growablebitvector.cpp indexmetainfo.cpp location.cpp diff --git a/searchlib/src/vespa/searchlib/common/gatecallback.cpp b/searchlib/src/vespa/searchlib/common/gatecallback.cpp deleted file mode 100644 index a853909be71..00000000000 --- a/searchlib/src/vespa/searchlib/common/gatecallback.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "gatecallback.h" -#include <vespa/vespalib/util/sync.h> - -namespace search { - -GateCallback::~GateCallback() { - _gate.countDown(); -} - -} diff --git a/searchlib/src/vespa/searchlib/common/gatecallback.h b/searchlib/src/vespa/searchlib/common/gatecallback.h deleted file mode 100644 index 1e85d796089..00000000000 --- a/searchlib/src/vespa/searchlib/common/gatecallback.h +++ /dev/null @@ -1,24 +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 "idestructorcallback.h" - -namespace vespalib { class Gate; } - -namespace search { - -class GateCallback : public IDestructorCallback { -public: - GateCallback(vespalib::Gate & gate) : _gate(gate) {} - ~GateCallback() override; -private: - vespalib::Gate & _gate; -}; - -class IgnoreCallback : public IDestructorCallback { -public: - IgnoreCallback() { } - ~IgnoreCallback() override = default; -}; - -} // namespace search diff --git a/searchlib/src/vespa/searchlib/common/idestructorcallback.h b/searchlib/src/vespa/searchlib/common/idestructorcallback.h index 77adba7a4cc..4c42f68f0e4 100644 --- a/searchlib/src/vespa/searchlib/common/idestructorcallback.h +++ b/searchlib/src/vespa/searchlib/common/idestructorcallback.h @@ -3,7 +3,8 @@ #include <memory> -namespace search { +namespace search +{ /** * Interface for class that performs a callback when instance is @@ -16,7 +17,7 @@ class IDestructorCallback { public: using SP = std::shared_ptr<IDestructorCallback>; - virtual ~IDestructorCallback() = default; + virtual ~IDestructorCallback() { } }; } // namespace search diff --git a/searchlib/src/vespa/searchlib/transactionlog/common.h b/searchlib/src/vespa/searchlib/transactionlog/common.h index db8b9727daa..65ef8f363c0 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/common.h +++ b/searchlib/src/vespa/searchlib/transactionlog/common.h @@ -2,7 +2,6 @@ #pragma once #include <vespa/searchlib/common/serialnum.h> -#include <vespa/searchlib/common/idestructorcallback.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/util/buffer.h> @@ -91,9 +90,8 @@ int makeDirectory(const char * dir); class Writer { public: - using DoneCallback = std::shared_ptr<IDestructorCallback>; virtual ~Writer() { } - virtual void commit(const vespalib::string & domainName, const Packet & packet, DoneCallback done) = 0; + virtual void commit(const vespalib::string & domainName, const Packet & packet) = 0; }; } diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogserver.cpp b/searchlib/src/vespa/searchlib/transactionlog/translogserver.cpp index e793aafd38f..ca17457bdb9 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogserver.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/translogserver.cpp @@ -453,9 +453,8 @@ void TransLogServer::domainStatus(FRT_RPCRequest *req) } } -void TransLogServer::commit(const vespalib::string & domainName, const Packet & packet, DoneCallback done) +void TransLogServer::commit(const vespalib::string & domainName, const Packet & packet) { - (void) done; Domain::SP domain(findDomain(domainName)); if (domain) { domain->commit(packet); diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogserver.h b/searchlib/src/vespa/searchlib/transactionlog/translogserver.h index c12e37dd1c8..92832786059 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogserver.h +++ b/searchlib/src/vespa/searchlib/transactionlog/translogserver.h @@ -31,7 +31,7 @@ public: virtual ~TransLogServer(); DomainStats getDomainStats() const; - void commit(const vespalib::string & domainName, const Packet & packet, DoneCallback done) override; + void commit(const vespalib::string & domainName, const Packet & packet) override; class Session diff --git a/vespalib/src/vespa/vespalib/util/sync.h b/vespalib/src/vespa/vespalib/util/sync.h index 86e0a227c72..f961c280174 100644 --- a/vespalib/src/vespa/vespalib/util/sync.h +++ b/vespalib/src/vespa/vespalib/util/sync.h @@ -710,7 +710,7 @@ public: /** * Empty. Needs to be virtual to reduce compiler warnings. **/ - virtual ~CountDownLatch() = default; + virtual ~CountDownLatch() {} }; |