use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method testMultiplePopulatorUpdater.
@Test
public void testMultiplePopulatorUpdater() throws IOException, IndexEntryConflictException {
IndexUpdater indexUpdater1 = mock(IndexUpdater.class);
IndexPopulator indexPopulator1 = createIndexPopulator(indexUpdater1);
IndexPopulator indexPopulator2 = createIndexPopulator();
addPopulator(indexPopulator1, 1);
addPopulator(indexPopulator2, 2);
doThrow(getPopulatorException()).when(indexPopulator2).newPopulatingUpdater(any(PropertyAccessor.class));
IndexUpdater multipleIndexUpdater = multipleIndexPopulator.newPopulatingUpdater(mock(PropertyAccessor.class));
IndexEntryUpdate propertyUpdate = createIndexEntryUpdate(index1);
multipleIndexUpdater.process(propertyUpdate);
checkPopulatorFailure(indexPopulator2);
verify(indexUpdater1).process(propertyUpdate);
}
use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method testIndexAllNodes.
@Test
public void testIndexAllNodes() {
IndexPopulator indexPopulator1 = createIndexPopulator();
IndexPopulator indexPopulator2 = createIndexPopulator();
addPopulator(indexPopulator1, 1);
addPopulator(indexPopulator2, 2);
multipleIndexPopulator.create();
multipleIndexPopulator.indexAllNodes();
verify(indexStoreView).visitNodes(any(int[].class), any(IntPredicate.class), any(Visitor.class), any(Visitor.class), anyBoolean());
}
use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method testFailPopulator.
@Test
public void testFailPopulator() throws IOException {
IndexPopulator indexPopulator1 = createIndexPopulator();
IndexPopulator indexPopulator2 = createIndexPopulator();
addPopulator(indexPopulator1, 1);
addPopulator(indexPopulator2, 2);
multipleIndexPopulator.fail(getPopulatorException());
checkPopulatorFailure(indexPopulator1);
checkPopulatorFailure(indexPopulator2);
}
use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method createIndexPopulator.
private IndexPopulator createIndexPopulator(IndexUpdater indexUpdater) throws IOException {
IndexPopulator indexPopulator = createIndexPopulator();
when(indexPopulator.newPopulatingUpdater(any(PropertyAccessor.class))).thenReturn(indexUpdater);
return indexPopulator;
}
use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.
the class MultipleIndexPopulatorTest method createIndexPopulator.
private IndexPopulator createIndexPopulator() {
IndexPopulator populator = mock(IndexPopulator.class);
when(populator.sampleResult()).thenReturn(new IndexSample());
return populator;
}
Aggregations