use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method testFailByPopulationRemovesPopulator.
@Test
public void testFailByPopulationRemovesPopulator() throws IOException {
IndexPopulator populator1 = createIndexPopulator();
IndexPopulator populator2 = createIndexPopulator();
IndexPopulation population1 = addPopulator(populator1, 1);
IndexPopulation population2 = addPopulator(populator2, 2);
multipleIndexPopulator.fail(population1, getPopulatorException());
multipleIndexPopulator.fail(population2, getPopulatorException());
checkPopulatorFailure(populator1);
checkPopulatorFailure(populator2);
assertFalse(multipleIndexPopulator.hasPopulators());
}
use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method testMultiplePopulatorCreationFailure.
@Test
public void testMultiplePopulatorCreationFailure() throws IOException {
IndexPopulator indexPopulator1 = createIndexPopulator();
IndexPopulator indexPopulator2 = createIndexPopulator();
IndexPopulator indexPopulator3 = createIndexPopulator();
doThrow(getPopulatorException()).when(indexPopulator1).create();
doThrow(getPopulatorException()).when(indexPopulator3).create();
addPopulator(indexPopulator1, 1);
addPopulator(indexPopulator2, 2);
addPopulator(indexPopulator3, 3);
multipleIndexPopulator.create();
checkPopulatorFailure(indexPopulator1);
checkPopulatorFailure(indexPopulator3);
verify(indexPopulator2).create();
}
use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method testMultiplePopulatorsCreation.
@Test
public void testMultiplePopulatorsCreation() throws Exception {
IndexPopulator indexPopulator1 = createIndexPopulator();
IndexPopulator indexPopulator2 = createIndexPopulator();
addPopulator(indexPopulator1, 1);
addPopulator(indexPopulator2, 2);
multipleIndexPopulator.create();
verify(indexPopulator1).create();
verify(indexPopulator2).create();
}
use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method testCancelPopulation.
@Test
public void testCancelPopulation() throws IOException {
IndexPopulator indexPopulator1 = createIndexPopulator();
IndexPopulator indexPopulator2 = createIndexPopulator();
addPopulator(indexPopulator1, 1);
addPopulator(indexPopulator2, 2);
multipleIndexPopulator.cancel();
verify(indexStoreView, times(2)).replaceIndexCounts(anyLong(), eq(0L), eq(0L), eq(0L));
verify(indexPopulator1).close(false);
verify(indexPopulator2).close(false);
}
use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method closeMultipleIndexPopulator.
@Test
public void closeMultipleIndexPopulator() throws IOException, IndexEntryConflictException {
IndexPopulator indexPopulator1 = createIndexPopulator();
IndexPopulator indexPopulator2 = createIndexPopulator();
addPopulator(indexPopulator1, 1);
addPopulator(indexPopulator2, 2);
doThrow(getPopulatorException()).when(indexPopulator2).close(true);
multipleIndexPopulator.close(true);
verify(indexPopulator1).close(true);
checkPopulatorFailure(indexPopulator2);
}
Aggregations