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);
}
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);
}
}
Aggregations