use of org.neo4j.kernel.api.index.IndexSample in project neo4j by neo4j.
the class NativeUniqueIndexPopulatorTest method shouldSampleUpdates.
@Test
void shouldSampleUpdates() throws Exception {
// GIVEN
populator.create();
IndexEntryUpdate<IndexDescriptor>[] updates = valueCreatorUtil.someUpdates(random);
// WHEN
populator.add(asList(updates), NULL);
for (IndexEntryUpdate<IndexDescriptor> update : updates) {
populator.includeSample(update);
}
populator.scanCompleted(nullInstance, populationWorkScheduler, NULL);
IndexSample sample = populator.sample(NULL);
// THEN
assertEquals(updates.length, sample.sampleSize());
assertEquals(updates.length, sample.uniqueValues());
assertEquals(updates.length, sample.indexSize());
populator.close(true, NULL);
}
Aggregations