aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/apps
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/apps')
-rw-r--r--searchlib/src/apps/docstore/benchmarkdatastore.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/searchlib/src/apps/docstore/benchmarkdatastore.cpp b/searchlib/src/apps/docstore/benchmarkdatastore.cpp
index 2393a82b44c..8aa2156743d 100644
--- a/searchlib/src/apps/docstore/benchmarkdatastore.cpp
+++ b/searchlib/src/apps/docstore/benchmarkdatastore.cpp
@@ -68,15 +68,15 @@ void BenchmarkDataStoreApp::read(size_t numReads, size_t perChunk, const IDataSt
char state[8];
memset(state, 0, sizeof(state));
memset(&rstate, 0, sizeof(rstate));
- const size_t numDocs(dataStore->nextId());
- assert(numDocs > 0);
+ const size_t docIdLimit(dataStore->getDocIdLimit());
+ assert(docIdLimit > 0);
initstate_r(getpid(), state, sizeof(state), &rstate);
assert(srandom_r(getpid(), &rstate) == 0);
int32_t rnd(0);
for ( size_t i(0); i < numReads; i++) {
random_r(&rstate, &rnd);
- uint32_t lid(rnd%numDocs);
- for (uint32_t j(lid); j < std::min(numDocs, lid+perChunk); j++) {
+ uint32_t lid(rnd%docIdLimit);
+ for (uint32_t j(lid); j < std::min(docIdLimit, lid+perChunk); j++) {
dataStore->read(j, buf);
buf.clear();
}