Search in sources :

Example 11 with KernelAPI

use of org.neo4j.kernel.api.KernelAPI in project neo4j by neo4j.

the class EnterpriseCypherEngineProvider 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 inner = new CommunityCompatibilityFactory(queryService, kernelAPI, monitors, logProvider);
    EnterpriseCompatibilityFactory compatibilityFactory = new EnterpriseCompatibilityFactory(inner, queryService, kernelAPI, monitors, logProvider);
    deps.satisfyDependency(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) EnterpriseCompatibilityFactory(org.neo4j.cypher.internal.EnterpriseCompatibilityFactory) LogService(org.neo4j.kernel.impl.logging.LogService) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Example 12 with KernelAPI

use of org.neo4j.kernel.api.KernelAPI in project neo4j by neo4j.

the class TestMigrateToDenseNodeSupport method verifyDenseRepresentation.

private void verifyDenseRepresentation(GraphDatabaseService db, Node node, boolean dense) {
    KernelAPI kernelAPI = ((GraphDatabaseAPI) db).getDependencyResolver().resolveDependency(KernelAPI.class);
    try (KernelTransaction tx = kernelAPI.newTransaction(KernelTransaction.Type.implicit, AnonymousContext.read());
        Statement statement = tx.acquireStatement()) {
        Cursor<NodeItem> nodeCursor = statement.readOperations().nodeCursorById(node.getId());
        assertEquals(dense, nodeCursor.get().isDense());
    } catch (TransactionFailureException | IllegalArgumentException | EntityNotFoundException e) {
        throw new RuntimeException(e);
    }
}
Also used : KernelTransaction(org.neo4j.kernel.api.KernelTransaction) TransactionFailureException(org.neo4j.kernel.api.exceptions.TransactionFailureException) NodeItem(org.neo4j.storageengine.api.NodeItem) Statement(org.neo4j.kernel.api.Statement) EntityNotFoundException(org.neo4j.kernel.api.exceptions.EntityNotFoundException) KernelAPI(org.neo4j.kernel.api.KernelAPI)

Aggregations

KernelAPI (org.neo4j.kernel.api.KernelAPI)12 KernelTransaction (org.neo4j.kernel.api.KernelTransaction)8 Statement (org.neo4j.kernel.api.Statement)8 CommunityCompatibilityFactory (org.neo4j.cypher.internal.CommunityCompatibilityFactory)3 GraphDatabaseCypherService (org.neo4j.cypher.javacompat.internal.GraphDatabaseCypherService)3 DependencyResolver (org.neo4j.graphdb.DependencyResolver)3 Monitors (org.neo4j.kernel.monitoring.Monitors)3 List (java.util.List)2 Test (org.junit.Test)2 NewIndexDescriptor (org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor)2 LogService (org.neo4j.kernel.impl.logging.LogService)2 QueryExecutionEngine (org.neo4j.kernel.impl.query.QueryExecutionEngine)2 LogProvider (org.neo4j.logging.LogProvider)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 ConsistencyCheckService (org.neo4j.consistency.ConsistencyCheckService)1 EnterpriseCompatibilityFactory (org.neo4j.cypher.internal.EnterpriseCompatibilityFactory)1 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)1