}
}
IndexStatisticsVisitor<Key,byte[]> visitor = new IndexStatisticsVisitor<>(session, index, indexRowCount, expectedSampleCount, this);
int bucketCount = indexStatisticsService.bucketCount();
visitor.init(bucketCount);
FDBStoreData storeData = getStore().createStoreData(session, index);
// Whole index, snapshot
getStore().indexIterator(session, storeData, false, false, false, true);
while(storeData.next()) {
if (++skippedSamples < sampleRate)
continue; // This value not sampled.
skippedSamples = 0;
FDBStoreDataHelper.unpackKey(storeData);
// TODO: Does anything look at rawValue?
visitor.visit(storeData.persistitKey, storeData.rawValue);
if ((scanTimeLimit >= 0) &&
(System.currentTimeMillis() >= nextCommitTime)) {
storeData.closeIterator();
txn.commitAndReset(session);
if (sleepTime > 0) {
try {
Thread.sleep(sleepTime);
}