use of org.neo4j.kernel.impl.transaction.state.storeview.DynamicIndexStoreView in project neo4j by neo4j.
the class MultiIndexPopulationConcurrentUpdatesIT method launchCustomIndexPopulation.
private void launchCustomIndexPopulation(Map<String, Integer> labelNameIdMap, int propertyId, List<NodeUpdates> updates) throws Exception {
NeoStores neoStores = getNeoStores();
LabelScanStore labelScanStore = getLabelScanStore();
ThreadToStatementContextBridge transactionStatementContextBridge = getTransactionStatementContextBridge();
try (Transaction transaction = embeddedDatabase.beginTx()) {
Statement statement = transactionStatementContextBridge.get();
DynamicIndexStoreView storeView = new DynamicIndexStoreViewWrapper(labelScanStore, LockService.NO_LOCK_SERVICE, neoStores, updates);
SchemaIndexProviderMap providerMap = new DefaultSchemaIndexProviderMap(getSchemaIndexProvider());
JobScheduler scheduler = getJobScheduler();
StatementTokenNameLookup tokenNameLookup = new StatementTokenNameLookup(statement.readOperations());
indexService = IndexingServiceFactory.createIndexingService(Config.empty(), scheduler, providerMap, storeView, tokenNameLookup, getIndexRules(neoStores), NullLogProvider.getInstance(), IndexingService.NO_MONITOR, () -> {
});
indexService.start();
IndexRule[] rules = createIndexRules(labelNameIdMap, propertyId);
indexService.createIndexes(rules);
transaction.success();
}
}
Aggregations