diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-09-30 18:23:29 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-09-30 18:23:29 +0200 |
commit | 0b557c51c7e06a4786366b3e97c24dd19df10221 (patch) | |
tree | 36619987d17ec1a2ee6f601c3542598b60cc5e39 /searchcore/src/tests/proton | |
parent | 7a74c1caf57ca0ac1801e91580acd35bea52d970 (diff) |
Update so that the tls direct writer is not optional.
Diffstat (limited to 'searchcore/src/tests/proton')
3 files changed, 16 insertions, 43 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index f492dc44fc6..97a96c4bac6 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -201,38 +201,20 @@ public: _sa() { assert(_mkdirOk); - auto b = std::make_shared<BootstrapConfig>(1, - _documenttypesConfig, - _repo, + auto b = std::make_shared<BootstrapConfig>(1, _documenttypesConfig, _repo, std::make_shared<ProtonConfig>(), std::make_shared<FiledistributorrpcConfig>(), _tuneFileDocumentDB); _configMgr.forwardConfig(b); _configMgr.nextGeneration(0); if (! FastOS_File::MakeDirectory((std::string("tmpdb/") + docTypeName).c_str())) { abort(); } - _ddb.reset(new DocumentDB("tmpdb", - _configMgr.getConfig(), - "tcp/localhost:9013", - _queryLimiter, - _clock, - DocTypeName(docTypeName), - ProtonConfig(), - *this, - _summaryExecutor, - _summaryExecutor, - NULL, - _dummy, - _fileHeaderContext, - ConfigStore::UP(new MemoryConfigStore), - std::make_shared<vespalib:: - ThreadStackExecutor> - (16, 128 * 1024), - _hwInfo)), + _ddb.reset(new DocumentDB("tmpdb", _configMgr.getConfig(), "tcp/localhost:9013", _queryLimiter, _clock, + DocTypeName(docTypeName), ProtonConfig(), *this, _summaryExecutor, _summaryExecutor, + _tls, _dummy, _fileHeaderContext, ConfigStore::UP(new MemoryConfigStore), + std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo)), _ddb->start(); _ddb->waitForOnlineState(); - _aw = AttributeWriter::UP(new AttributeWriter(_ddb-> - getReadySubDB()-> - getAttributeManager())); + _aw = AttributeWriter::UP(new AttributeWriter(_ddb->getReadySubDB()->getAttributeManager())); _sa = _ddb->getReadySubDB()->getSummaryAdapter(); } ~DBContext() diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp index b9a04acb8da..157e964ad83 100644 --- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp @@ -107,22 +107,16 @@ Fixture::Fixture() config::DirSpec spec(TEST_PATH("cfg")); DocumentDBConfigHelper mgr(spec, "typea"); BootstrapConfig::SP - b(new BootstrapConfig(1, - documenttypesConfig, - repo, + b(new BootstrapConfig(1, documenttypesConfig, repo, std::make_shared<ProtonConfig>(), std::make_shared<FiledistributorrpcConfig>(), tuneFileDocumentDB)); mgr.forwardConfig(b); mgr.nextGeneration(0); - _db.reset(new DocumentDB(".", mgr.getConfig(), "tcp/localhost:9014", - _queryLimiter, _clock, DocTypeName("typea"), - ProtonConfig(), - _myDBOwner, _summaryExecutor, _summaryExecutor, NULL, _dummy, _fileHeaderContext, - ConfigStore::UP(new MemoryConfigStore), - std::make_shared<vespalib::ThreadStackExecutor> - (16, 128 * 1024), - _hwInfo)); + _db.reset(new DocumentDB(".", mgr.getConfig(), "tcp/localhost:9014", _queryLimiter, _clock, DocTypeName("typea"), + ProtonConfig(), _myDBOwner, _summaryExecutor, _summaryExecutor, _tls, _dummy, + _fileHeaderContext, ConfigStore::UP(new MemoryConfigStore), + std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo)); _db->start(); _db->waitForOnlineState(); } diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp index 1ccbff6e6cf..39a588f804d 100644 --- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp @@ -411,12 +411,10 @@ struct MyTlsWriter : TlsWriter { bool erase_return; MyTlsWriter() : store_count(0), erase_count(0), erase_return(true) {} - virtual void storeOperation(const FeedOperation &) override { ++store_count; } - virtual bool erase(SerialNum) override { ++erase_count; return erase_return; } + void storeOperation(const FeedOperation &) override { ++store_count; } + bool erase(SerialNum) override { ++erase_count; return erase_return; } - virtual SerialNum - sync(SerialNum syncTo) override - { + SerialNum sync(SerialNum syncTo) override { return syncTo; } }; @@ -452,7 +450,7 @@ struct FeedHandlerFixture _bucketDB(), _bucketDBHandler(_bucketDB), handler(writeService, tlsSpec, schema.getDocType(), - feedMetrics._feed, _state, owner, writeFilter, replayConfig, NULL, &tls_writer) + feedMetrics._feed, _state, owner, writeFilter, replayConfig, tls, &tls_writer) { _state.enterLoadState(); _state.enterReplayTransactionLogState(); @@ -544,8 +542,7 @@ addLidToRemove(RemoveDocumentsOperation &op) TEST_F("require that handleMove calls FeedView", FeedHandlerFixture) { DocumentContext doc_context("doc:test:foo", *f.schema.builder); - MoveOperation op(doc_context.bucketId, Timestamp(2), doc_context.doc, - DbDocumentId(0, 2), 1); + MoveOperation op(doc_context.bucketId, Timestamp(2), doc_context.doc, DbDocumentId(0, 2), 1); op.setDbDocumentId(DbDocumentId(1, 2)); f.runAsMaster([&]() { f.handler.handleMove(op, IDestructorCallback::SP()); }); EXPECT_EQUAL(1, f.feedView.move_count); |