Search in sources :

Example 11 with IndexPopulator

use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.

the class MultipleIndexPopulatorTest method testFailByNonExistingPopulation.

@Test
public void testFailByNonExistingPopulation() throws IOException {
    IndexPopulation nonExistingPopulation = mock(IndexPopulation.class);
    IndexPopulator populator = createIndexPopulator();
    addPopulator(populator, 1);
    multipleIndexPopulator.fail(nonExistingPopulation, getPopulatorException());
    verify(populator, never()).markAsFailed(anyString());
}
Also used : IndexPopulator(org.neo4j.kernel.api.index.IndexPopulator) IndexPopulation(org.neo4j.kernel.impl.api.index.MultipleIndexPopulator.IndexPopulation) Test(org.junit.Test)

Example 12 with IndexPopulator

use of org.neo4j.kernel.api.index.IndexPopulator in project neo4j by neo4j.

the class MultipleIndexPopulatorTest method testFailByPopulation.

@Test
public void testFailByPopulation() throws IOException {
    IndexPopulator populator1 = createIndexPopulator();
    IndexPopulator populator2 = createIndexPopulator();
    addPopulator(populator1, 1);
    IndexPopulation population2 = addPopulator(populator2, 2);
    multipleIndexPopulator.fail(population2, getPopulatorException());
    verify(populator1, never()).markAsFailed(anyString());
    checkPopulatorFailure(populator2);
}
Also used : IndexPopulator(org.neo4j.kernel.api.index.IndexPopulator) IndexPopulation(org.neo4j.kernel.impl.api.index.MultipleIndexPopulator.IndexPopulation) Test(org.junit.Test)

Example 13 with IndexPopulator

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());
}
Also used : IndexPopulator(org.neo4j.kernel.api.index.IndexPopulator) IndexPopulation(org.neo4j.kernel.impl.api.index.MultipleIndexPopulator.IndexPopulation) Test(org.junit.Test)

Example 14 with IndexPopulator

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();
}
Also used : IndexPopulator(org.neo4j.kernel.api.index.IndexPopulator) Test(org.junit.Test)

Example 15 with IndexPopulator

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();
}
Also used : IndexPopulator(org.neo4j.kernel.api.index.IndexPopulator) Test(org.junit.Test)

Aggregations

IndexPopulator (org.neo4j.kernel.api.index.IndexPopulator)45 Test (org.junit.Test)37 IndexEntryUpdate (org.neo4j.kernel.api.index.IndexEntryUpdate)11 PropertyAccessor (org.neo4j.kernel.api.index.PropertyAccessor)8 IndexUpdater (org.neo4j.kernel.api.index.IndexUpdater)7 IndexSamplingConfig (org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig)7 NeoStoreIndexStoreView (org.neo4j.kernel.impl.transaction.state.storeview.NeoStoreIndexStoreView)7 NodeUpdates (org.neo4j.kernel.api.index.NodeUpdates)6 SchemaIndexProvider (org.neo4j.kernel.api.index.SchemaIndexProvider)6 NewIndexDescriptor (org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor)6 BatchInserter (org.neo4j.unsafe.batchinsert.BatchInserter)5 ExecutorService (java.util.concurrent.ExecutorService)3 LabelSchemaDescriptor (org.neo4j.kernel.api.schema_new.LabelSchemaDescriptor)3 IndexPopulation (org.neo4j.kernel.impl.api.index.MultipleIndexPopulator.IndexPopulation)3 NeoStores (org.neo4j.kernel.impl.store.NeoStores)3 NodeStore (org.neo4j.kernel.impl.store.NodeStore)3 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)3 AssertableLogProvider (org.neo4j.logging.AssertableLogProvider)3 IntPredicate (java.util.function.IntPredicate)2 NodeLabelUpdate (org.neo4j.kernel.api.labelscan.NodeLabelUpdate)2