summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_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/attribute/attribute_populator/attribute_populator_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/attribute/attribute_populator/attribute_populator_test.cpp')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
index 36e50249b89..1f69d9136cf 100644
--- a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
@@ -11,6 +11,7 @@ LOG_SETUP("attribute_populator_test");
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/vespalib/util/mock_hw_info.h>
#include <vespa/searchlib/common/foregroundtaskexecutor.h>
using namespace document;
@@ -55,6 +56,7 @@ struct Fixture
test::DirectoryHandler _testDir;
DummyFileHeaderContext _fileHeader;
ForegroundTaskExecutor _attributeFieldWriter;
+ std::shared_ptr<vespalib::IHwInfo> _hwInfo;
AttributeManager::SP _mgr;
AttributePopulator _pop;
DocContext _ctx;
@@ -62,9 +64,10 @@ struct Fixture
: _testDir(TEST_DIR),
_fileHeader(),
_attributeFieldWriter(),
+ _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
_mgr(new AttributeManager(TEST_DIR, "test.subdb",
TuneFileAttributes(),
- _fileHeader, _attributeFieldWriter)),
+ _fileHeader, _attributeFieldWriter, _hwInfo)),
_pop(_mgr, 1, "test"),
_ctx()
{