use of org.neo4j.kernel.api.index.IndexUpdater in project neo4j by neo4j.
the class TokenIndexPopulatorTest method updaterMustThrowIfProcessAfterClose.
@Test
void updaterMustThrowIfProcessAfterClose() throws Exception {
// given
populator.create();
IndexUpdater updater = populator.newPopulatingUpdater(null_property_accessor, NULL);
// when
updater.close();
IllegalStateException e = assertThrows(IllegalStateException.class, () -> updater.process(IndexEntryUpdate.change(random.nextInt(), null, EMPTY_LONG_ARRAY, TokenIndexUtility.generateRandomTokens(random))));
assertThat(e).hasMessageContaining("Updater has been closed");
populator.close(true, NULL);
}
use of org.neo4j.kernel.api.index.IndexUpdater in project neo4j by neo4j.
the class FusionIndexUpdaterTest method verifyAddWithCorrectUpdater.
private void verifyAddWithCorrectUpdater(IndexUpdater correctPopulator, Value... numberValues) throws IndexEntryConflictException {
IndexEntryUpdate<LabelSchemaDescriptor> update = add(numberValues);
fusionIndexUpdater.process(update);
verify(correctPopulator).process(update);
for (IndexUpdater populator : aliveUpdaters) {
if (populator != correctPopulator) {
verify(populator, never()).process(update);
}
}
}
use of org.neo4j.kernel.api.index.IndexUpdater in project neo4j by neo4j.
the class FusionIndexUpdaterTest method verifyChangeWithCorrectUpdaterNotMixed.
private void verifyChangeWithCorrectUpdaterNotMixed(IndexUpdater correctPopulator, Value before, Value after) throws IndexEntryConflictException {
IndexEntryUpdate<LabelSchemaDescriptor> update = FusionIndexTestHelp.change(before, after);
fusionIndexUpdater.process(update);
verify(correctPopulator).process(update);
for (IndexUpdater populator : aliveUpdaters) {
if (populator != correctPopulator) {
verify(populator, never()).process(update);
}
}
}
use of org.neo4j.kernel.api.index.IndexUpdater in project neo4j by neo4j.
the class FusionIndexUpdaterTest method verifyRemoveWithCorrectUpdater.
private void verifyRemoveWithCorrectUpdater(IndexUpdater correctPopulator, Value... numberValues) throws IndexEntryConflictException {
IndexEntryUpdate<LabelSchemaDescriptor> update = FusionIndexTestHelp.remove(numberValues);
fusionIndexUpdater.process(update);
verify(correctPopulator).process(update);
for (IndexUpdater populator : aliveUpdaters) {
if (populator != correctPopulator) {
verify(populator, never()).process(update);
}
}
}
Aggregations