Search in sources :

Example 1 with PopulationProgress

use of org.neo4j.storageengine.api.schema.PopulationProgress in project neo4j by neo4j.

the class IndexingServiceIntegrationTest method testManualIndexPopulation.

@Test
public void testManualIndexPopulation() throws IOException, IndexNotFoundKernelException, InterruptedException {
    IndexingService indexingService = getIndexingService(database);
    SchemaStore schemaStore = getSchemaStore(database);
    LabelTokenHolder labelTokenHolder = getLabelTokenHolder(database);
    PropertyKeyTokenHolder propertyKeyTokenHolder = getPropertyKeyTokenHolder(database);
    int foodId = labelTokenHolder.getIdByName(FOOD_LABEL);
    int propertyId = propertyKeyTokenHolder.getIdByName(PROPERTY_NAME);
    IndexRule rule = IndexRule.indexRule(schemaStore.nextId(), NewIndexDescriptorFactory.forLabel(foodId, propertyId), indexDescriptor);
    indexingService.createIndexes(rule);
    IndexProxy indexProxy = indexingService.getIndexProxy(rule.getId());
    waitIndexOnline(indexProxy);
    assertEquals(InternalIndexState.ONLINE, indexProxy.getState());
    PopulationProgress progress = indexProxy.getIndexPopulationProgress();
    assertEquals(progress.getCompleted(), progress.getTotal());
}
Also used : IndexRule(org.neo4j.kernel.impl.store.record.IndexRule) PopulationProgress(org.neo4j.storageengine.api.schema.PopulationProgress) SchemaStore(org.neo4j.kernel.impl.store.SchemaStore) PropertyKeyTokenHolder(org.neo4j.kernel.impl.core.PropertyKeyTokenHolder) LabelTokenHolder(org.neo4j.kernel.impl.core.LabelTokenHolder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 LabelTokenHolder (org.neo4j.kernel.impl.core.LabelTokenHolder)1 PropertyKeyTokenHolder (org.neo4j.kernel.impl.core.PropertyKeyTokenHolder)1 SchemaStore (org.neo4j.kernel.impl.store.SchemaStore)1 IndexRule (org.neo4j.kernel.impl.store.record.IndexRule)1 PopulationProgress (org.neo4j.storageengine.api.schema.PopulationProgress)1