aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/index
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-02-27 16:43:55 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-02-27 16:49:17 +0000
commit752ced912014457c04d2c3670fd7d8b9eda49fa7 (patch)
tree404a21f60b4df37a1d4e718096eed971bf7522bc /searchcore/src/tests/proton/index
parentdda41637e506d6f0fdf88f875350adab2743bd1d (diff)
Add getStats and setTaskLimit to interface to make it easy to swap implementation.
Also make do with ISequenceHandlerInterface.
Diffstat (limited to 'searchcore/src/tests/proton/index')
-rw-r--r--searchcore/src/tests/proton/index/indexmanager_test.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp
index 7542ef24c52..264cf6d8cfa 100644
--- a/searchcore/src/tests/proton/index/indexmanager_test.cpp
+++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp
@@ -379,10 +379,9 @@ TEST_F(IndexManagerTest, require_that_flush_stats_are_calculated)
{
Schema schema(getSchema());
FieldIndexCollection fic(schema, MockFieldLengthInspector());
- SequencedTaskExecutor invertThreads(2);
- SequencedTaskExecutor pushThreads(2);
- search::memoryindex::DocumentInverter inverter(schema, invertThreads,
- pushThreads, fic);
+ auto invertThreads = SequencedTaskExecutor::create(2);
+ auto pushThreads = SequencedTaskExecutor::create(2);
+ search::memoryindex::DocumentInverter inverter(schema, *invertThreads, *pushThreads, fic);
uint64_t fixed_index_size = fic.getMemoryUsage().allocatedBytes();
uint64_t index_size = fic.getMemoryUsage().allocatedBytes() - fixed_index_size;
@@ -395,9 +394,9 @@ TEST_F(IndexManagerTest, require_that_flush_stats_are_calculated)
Document::UP doc = addDocument(docid);
inverter.invertDocument(docid, *doc);
- invertThreads.sync();
+ invertThreads->sync();
inverter.pushDocuments(std::shared_ptr<search::IDestructorCallback>());
- pushThreads.sync();
+ pushThreads->sync();
index_size = fic.getMemoryUsage().allocatedBytes() - fixed_index_size;
/// Must account for both docid 0 being reserved and the extra after.
@@ -414,9 +413,9 @@ TEST_F(IndexManagerTest, require_that_flush_stats_are_calculated)
inverter.invertDocument(docid + 10, *doc);
doc = addDocument(docid + 100);
inverter.invertDocument(docid + 100, *doc);
- invertThreads.sync();
+ invertThreads->sync();
inverter.pushDocuments(std::shared_ptr<search::IDestructorCallback>());
- pushThreads.sync();
+ pushThreads->sync();
index_size = fic.getMemoryUsage().allocatedBytes() - fixed_index_size;
/// Must account for both docid 0 being reserved and the extra after.
selector_size = (docid + 100 + 1) * sizeof(Source);