diff options
author | Tor Egge <Tor.Egge@yahoo-inc.com> | 2016-11-02 12:46:11 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@yahoo-inc.com> | 2016-11-03 11:32:28 +0000 |
commit | c19ca31b961511a5ddf3261658ba83dfc8c1e1ad (patch) | |
tree | 22c5290c8e5cde44338e0665da01f4b4ecbff1ae /searchcore/src/tests/proton/attribute/attribute_test.cpp | |
parent | 872727070b589f776b7a24d5a33581dc8114ae31 (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_test.cpp')
-rw-r--r-- | searchcore/src/tests/proton/attribute/attribute_test.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp index c8cce9fb2a0..c8676efd551 100644 --- a/searchcore/src/tests/proton/attribute/attribute_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp @@ -19,6 +19,7 @@ LOG_SETUP("attribute_test"); #include <vespa/searchlib/index/docbuilder.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/util/filekit.h> +#include <vespa/vespalib/util/mock_hw_info.h> #include <vespa/vespalib/io/fileutil.h> #include <vespa/document/predicate/predicate_slime_builder.h> @@ -102,6 +103,7 @@ struct Fixture test::DirectoryHandler _dirHandler; DummyFileHeaderContext _fileHeaderContext; ForegroundTaskExecutor _attributeFieldWriter; + std::shared_ptr<vespalib::IHwInfo> _hwInfo; proton::AttributeManager::SP _m; AttributeWriter aw; @@ -109,9 +111,10 @@ struct Fixture : _dirHandler(test_dir), _fileHeaderContext(), _attributeFieldWriter(), + _hwInfo(std::make_shared<vespalib::MockHwInfo>()), _m(std::make_shared<proton::AttributeManager> (test_dir, "test.subdb", TuneFileAttributes(), - _fileHeaderContext, _attributeFieldWriter)), + _fileHeaderContext, _attributeFieldWriter, _hwInfo)), aw(_m) { } @@ -527,16 +530,20 @@ struct FilterFixture test::DirectoryHandler _dirHandler; DummyFileHeaderContext _fileHeaderContext; ForegroundTaskExecutor _attributeFieldWriter; + std::shared_ptr<vespalib::IHwInfo> _hwInfo; + proton::AttributeManager::SP _baseMgr; FilterAttributeManager _filterMgr; FilterFixture() : _dirHandler(test_dir), _fileHeaderContext(), _attributeFieldWriter(), + _hwInfo(std::make_shared<vespalib::MockHwInfo>()), _baseMgr(new proton::AttributeManager(test_dir, "test.subdb", TuneFileAttributes(), _fileHeaderContext, - _attributeFieldWriter)), + _attributeFieldWriter, + _hwInfo)), _filterMgr(ACCEPTED_ATTRIBUTES, _baseMgr) { _baseMgr->addAttribute("a1", INT32_SINGLE, createSerialNum); |