aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahoo-inc.com>2016-11-02 12:46:11 +0000
committerTor Egge <Tor.Egge@yahoo-inc.com>2016-11-03 11:32:28 +0000
commitc19ca31b961511a5ddf3261658ba83dfc8c1e1ad (patch)
tree22c5290c8e5cde44338e0665da01f4b4ecbff1ae /searchcore/src/tests/proton/documentdb/documentdb_test.cpp
parent872727070b589f776b7a24d5a33581dc8114ae31 (diff)
Flush attribute to memory first if attribute saver has a
read guard and we are using a spinning disk. This reduces the time the read guard is held (and corresponding extra long term memory usage due to large hold lists) at the cost of a temporary memory usage spike while flushing attribute.
Diffstat (limited to 'searchcore/src/tests/proton/documentdb/documentdb_test.cpp')
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index e95e8adc4c8..125127d5af9 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -21,6 +21,7 @@ LOG_SETUP("documentdb_test");
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <tests/proton/common/dummydbowner.h>
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/util/mock_hw_info.h>
using document::DocumentType;
using document::DocumentTypeRepo;
@@ -56,6 +57,7 @@ struct Fixture {
DummyWireService _dummy;
DummyDBOwner _dummyDBOwner;
vespalib::ThreadStackExecutor _summaryExecutor;
+ std::shared_ptr<vespalib::IHwInfo> _hwInfo;
DocumentDB::SP _db;
DummyFileHeaderContext _fileHeaderContext;
TransLogServer _tls;
@@ -66,9 +68,16 @@ struct Fixture {
};
Fixture::Fixture()
- : _summaryExecutor(8, 128*1024),
- _tls("tmp", 9014, ".", _fileHeaderContext) {
-
+ : _dummy(),
+ _dummyDBOwner(),
+ _summaryExecutor(8, 128*1024),
+ _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _db(),
+ _fileHeaderContext(),
+ _tls("tmp", 9014, ".", _fileHeaderContext),
+ _queryLimiter(),
+ _clock()
+{
DocumentDBConfig::DocumenttypesConfigSP documenttypesConfig(new DocumenttypesConfig());
DocumentType docType("typea", 0);
DocumentTypeRepo::SP repo(new DocumentTypeRepo(docType));
@@ -90,7 +99,8 @@ Fixture::Fixture()
_dummyDBOwner, _summaryExecutor, _summaryExecutor, NULL, _dummy, _fileHeaderContext,
ConfigStore::UP(new MemoryConfigStore),
std::make_shared<vespalib::ThreadStackExecutor>
- (16, 128 * 1024)));
+ (16, 128 * 1024),
+ _hwInfo));
_db->start();
_db->waitForOnlineState();
}