use of org.neo4j.kernel.impl.coreapi.IndexProviderImpl in project neo4j by neo4j.
the class GraphDatabaseFacade method init.
/**
* Create a new Core API facade, backed by the given SPI and using pre-resolved dependencies
*/
public void init(SPI spi, Guard guard, ThreadToStatementContextBridge txBridge, Config config) {
this.spi = spi;
this.defaultTransactionTimeout = config.get(GraphDatabaseSettings.transaction_timeout);
Supplier<Statement> statementSupplier = spi::currentStatement;
Supplier<KernelTransaction> transactionSupplier = spi::currentTransaction;
ThrowingAction<RuntimeException> assertTransactionOpen = this::assertTransactionOpen;
this.schema = new SchemaImpl(statementSupplier);
this.relActions = new StandardRelationshipActions(statementSupplier, transactionSupplier, assertTransactionOpen, (id) -> new NodeProxy(nodeActions, id), this);
this.nodeActions = new StandardNodeActions(statementSupplier, transactionSupplier, assertTransactionOpen, relActions, this);
this.indexManager = Suppliers.lazySingleton(() -> {
IndexProviderImpl idxProvider = new IndexProviderImpl(this, statementSupplier);
AutoIndexerFacade<Node> nodeAutoIndexer = new AutoIndexerFacade<>(() -> new ReadOnlyIndexFacade<>(idxProvider.getOrCreateNodeIndex(NODE_AUTO_INDEX, null)), spi.autoIndexing().nodes());
RelationshipAutoIndexerFacade relAutoIndexer = new RelationshipAutoIndexerFacade(() -> new ReadOnlyRelationshipIndexFacade(idxProvider.getOrCreateRelationshipIndex(RELATIONSHIP_AUTO_INDEX, null)), spi.autoIndexing().relationships());
return new IndexManagerImpl(statementSupplier, idxProvider, nodeAutoIndexer, relAutoIndexer);
});
this.contextFactory = Neo4jTransactionalContextFactory.create(spi, guard, txBridge, locker);
}
Aggregations