use of org.neo4j.internal.batchimport.Configuration.DEFAULT in project neo4j by neo4j.
the class ReadEntityIdsStepUsingTokenIndexTest method shouldSeeRecentUpdatesRightInFrontOfExternalUpdatesPoint.
@Test
void shouldSeeRecentUpdatesRightInFrontOfExternalUpdatesPoint() throws Exception {
// given
long entityCount = 1_000 + random.nextInt(100);
BitSet expectedEntityIds = new BitSet();
BitSet seenEntityIds = new BitSet();
try (var indexAccessor = indexAccessor()) {
populateTokenIndex(indexAccessor, expectedEntityIds, entityCount);
Configuration configuration = withBatchSize(DEFAULT, 100);
Stage stage = new Stage("Test", null, configuration, 0) {
{
add(new ReadEntityIdsStep(control(), configuration, cursorContext -> new TokenIndexScanIdIterator(indexAccessor.newTokenReader(), new int[] { TOKEN_ID }, CursorContext.NULL), NULL, new ControlledUpdatesCheck(indexAccessor, expectedEntityIds), new AtomicBoolean(true)));
add(new CollectEntityIdsStep(control(), configuration, seenEntityIds));
}
};
// when
stage.execute().awaitCompletion();
// then
assertThat(seenEntityIds).isEqualTo(expectedEntityIds);
}
}
Aggregations