Search in sources :

Example 16 with DependencyResolver

use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.

the class Start method createTransactionContext.

private TransactionalContext createTransactionContext(String queryText, Map<String, Object> queryParameters, Session session) {
    DependencyResolver dependencyResolver = getDependencyResolver();
    GraphDatabaseQueryService graph = dependencyResolver.resolveDependency(GraphDatabaseQueryService.class);
    TransactionalContextFactory contextFactory = Neo4jTransactionalContextFactory.create(graph, new PropertyContainerLocker());
    InternalTransaction transaction = graph.beginTransaction(KernelTransaction.Type.implicit, SecurityContext.AUTH_DISABLED);
    return contextFactory.newContext(new ShellConnectionInfo(session.getId()), transaction, queryText, queryParameters);
}
Also used : PropertyContainerLocker(org.neo4j.kernel.impl.coreapi.PropertyContainerLocker) ShellConnectionInfo(org.neo4j.kernel.impl.query.clientconnection.ShellConnectionInfo) GraphDatabaseQueryService(org.neo4j.kernel.GraphDatabaseQueryService) InternalTransaction(org.neo4j.kernel.impl.coreapi.InternalTransaction) TransactionalContextFactory(org.neo4j.kernel.impl.query.TransactionalContextFactory) Neo4jTransactionalContextFactory(org.neo4j.kernel.impl.query.Neo4jTransactionalContextFactory) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Example 17 with DependencyResolver

use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.

the class CommunityCypherEngineProvider method createEngine.

@Override
protected QueryExecutionEngine createEngine(Dependencies deps, GraphDatabaseAPI graphAPI) {
    GraphDatabaseCypherService queryService = new GraphDatabaseCypherService(graphAPI);
    deps.satisfyDependency(queryService);
    DependencyResolver resolver = graphAPI.getDependencyResolver();
    LogService logService = resolver.resolveDependency(LogService.class);
    KernelAPI kernelAPI = resolver.resolveDependency(KernelAPI.class);
    Monitors monitors = resolver.resolveDependency(Monitors.class);
    LogProvider logProvider = logService.getInternalLogProvider();
    CommunityCompatibilityFactory compatibilityFactory = new CommunityCompatibilityFactory(queryService, kernelAPI, monitors, logProvider);
    deps.satisfyDependencies(compatibilityFactory);
    return new ExecutionEngine(queryService, logProvider, compatibilityFactory);
}
Also used : LogProvider(org.neo4j.logging.LogProvider) QueryExecutionEngine(org.neo4j.kernel.impl.query.QueryExecutionEngine) Monitors(org.neo4j.kernel.monitoring.Monitors) CommunityCompatibilityFactory(org.neo4j.cypher.internal.CommunityCompatibilityFactory) GraphDatabaseCypherService(org.neo4j.cypher.javacompat.internal.GraphDatabaseCypherService) KernelAPI(org.neo4j.kernel.api.KernelAPI) LogService(org.neo4j.kernel.impl.logging.LogService) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Example 18 with DependencyResolver

use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.

the class IndexStatisticsTest method before.

@Before
public void before() {
    GraphDatabaseAPI graphDatabaseAPI = dbRule.getGraphDatabaseAPI();
    this.db = graphDatabaseAPI;
    DependencyResolver dependencyResolver = graphDatabaseAPI.getDependencyResolver();
    this.bridge = dependencyResolver.resolveDependency(ThreadToStatementContextBridge.class);
    graphDatabaseAPI.getDependencyResolver().resolveDependency(Monitors.class).addMonitorListener(indexOnlineMonitor);
}
Also used : GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) Monitors(org.neo4j.kernel.monitoring.Monitors) ThreadToStatementContextBridge(org.neo4j.kernel.impl.core.ThreadToStatementContextBridge) DependencyResolver(org.neo4j.graphdb.DependencyResolver) Before(org.junit.Before)

Example 19 with DependencyResolver

use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.

the class StorageLayerRelTypesAndDegreeTest method resolveNeoStores.

private NeoStores resolveNeoStores() {
    DependencyResolver resolver = db.getDependencyResolver();
    RecordStorageEngine storageEngine = resolver.resolveDependency(RecordStorageEngine.class);
    return storageEngine.testAccessNeoStores();
}
Also used : RecordStorageEngine(org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Example 20 with DependencyResolver

use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.

the class StorageLayerTest method before.

@SuppressWarnings("deprecation")
@Before
public void before() {
    db = (GraphDatabaseAPI) createGraphDatabase();
    DependencyResolver resolver = db.getDependencyResolver();
    this.disk = resolver.resolveDependency(StorageEngine.class).storeReadLayer();
    this.state = new KernelStatement(null, null, disk.newStatement(), new Procedures(), new CanWrite(), LockTracer.NONE);
}
Also used : CanWrite(org.neo4j.kernel.impl.factory.CanWrite) KernelStatement(org.neo4j.kernel.impl.api.KernelStatement) Procedures(org.neo4j.kernel.impl.proc.Procedures) DependencyResolver(org.neo4j.graphdb.DependencyResolver) Before(org.junit.Before)

Aggregations

DependencyResolver (org.neo4j.graphdb.DependencyResolver)51 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)18 Test (org.junit.Test)15 Transaction (org.neo4j.graphdb.Transaction)10 ThreadToStatementContextBridge (org.neo4j.kernel.impl.core.ThreadToStatementContextBridge)9 Before (org.junit.Before)8 RecordStorageEngine (org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine)8 GraphDatabaseQueryService (org.neo4j.kernel.GraphDatabaseQueryService)7 NeoStores (org.neo4j.kernel.impl.store.NeoStores)7 Monitors (org.neo4j.kernel.monitoring.Monitors)7 Node (org.neo4j.graphdb.Node)6 TestGraphDatabaseFactory (org.neo4j.test.TestGraphDatabaseFactory)6 NeoStoreDataSource (org.neo4j.kernel.NeoStoreDataSource)5 Statement (org.neo4j.kernel.api.Statement)5 File (java.io.File)4 IOException (java.io.IOException)4 Label (org.neo4j.graphdb.Label)4 PageCache (org.neo4j.io.pagecache.PageCache)4 Guard (org.neo4j.kernel.guard.Guard)4 QueryExecutionEngine (org.neo4j.kernel.impl.query.QueryExecutionEngine)4