use of org.neo4j.kernel.impl.store.SchemaStore in project neo4j by neo4j.
the class FullCheckIntegrationTest method createNodePropertyExistenceConstraint.
private void createNodePropertyExistenceConstraint(int labelId, int propertyKeyId) {
SchemaStore schemaStore = (SchemaStore) fixture.directStoreAccess().nativeStores().getSchemaStore();
ConstraintRule rule = nodePropertyExistenceConstraintRule(schemaStore.nextId(), labelId, propertyKeyId);
Collection<DynamicRecord> records = schemaStore.allocateFrom(rule);
for (DynamicRecord record : records) {
schemaStore.updateRecord(record);
}
}
use of org.neo4j.kernel.impl.store.SchemaStore 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());
}
Aggregations