Search in sources :

Example 1 with CypherConfiguration

use of org.neo4j.cypher.internal.config.CypherConfiguration in project neo4j by neo4j.

the class ExecutionEngine method makeExecutionEngine.

protected static org.neo4j.cypher.internal.ExecutionEngine makeExecutionEngine(GraphDatabaseQueryService queryService, CaffeineCacheFactory cacheFactory, LogProvider logProvider, CompilerLibrary compilerLibrary) {
    DependencyResolver resolver = queryService.getDependencyResolver();
    Monitors monitors = resolver.resolveDependency(Monitors.class);
    MonitoringCacheTracer cacheTracer = new MonitoringCacheTracer(monitors.newMonitor(ExecutionEngineQueryCacheMonitor.class));
    Config config = resolver.resolveDependency(Config.class);
    CypherConfiguration cypherConfiguration = CypherConfiguration.fromConfig(config);
    CompilationTracer tracer = new TimingCompilationTracer(monitors.newMonitor(TimingCompilationTracer.EventListener.class));
    return new org.neo4j.cypher.internal.ExecutionEngine(queryService, monitors, tracer, cacheTracer, cypherConfiguration, compilerLibrary, cacheFactory, logProvider, Clock.systemUTC());
}
Also used : TimingCompilationTracer(org.neo4j.cypher.internal.tracing.TimingCompilationTracer) CompilationTracer(org.neo4j.cypher.internal.tracing.CompilationTracer) QueryExecutionEngine(org.neo4j.kernel.impl.query.QueryExecutionEngine) ExecutionEngineQueryCacheMonitor(org.neo4j.cypher.internal.ExecutionEngineQueryCacheMonitor) Config(org.neo4j.configuration.Config) Monitors(org.neo4j.monitoring.Monitors) TimingCompilationTracer(org.neo4j.cypher.internal.tracing.TimingCompilationTracer) CypherConfiguration(org.neo4j.cypher.internal.config.CypherConfiguration) DependencyResolver(org.neo4j.common.DependencyResolver)

Example 2 with CypherConfiguration

use of org.neo4j.cypher.internal.config.CypherConfiguration in project neo4j by neo4j.

the class CommunityCypherEngineProvider method createEngine.

@Override
protected QueryExecutionEngine createEngine(Dependencies deps, GraphDatabaseAPI graphAPI, boolean isSystemDatabase, SPI spi) {
    GraphDatabaseCypherService queryService = new GraphDatabaseCypherService(graphAPI);
    deps.satisfyDependency(queryService);
    CypherConfiguration cypherConfig = CypherConfiguration.fromConfig(spi.config());
    CypherPlannerConfiguration plannerConfig = CypherPlannerConfiguration.fromCypherConfiguration(cypherConfig, spi.config(), isSystemDatabase);
    CypherRuntimeConfiguration runtimeConfig = CypherRuntimeConfiguration.fromCypherConfiguration(cypherConfig);
    CompilerFactory compilerFactory = makeCompilerFactory(queryService, spi, plannerConfig, runtimeConfig);
    CaffeineCacheFactory cacheFactory = makeCacheFactory(spi);
    if (isSystemDatabase) {
        CypherPlannerConfiguration innerPlannerConfig = CypherPlannerConfiguration.fromCypherConfiguration(cypherConfig, spi.config(), false);
        CompilerFactory innerCompilerFactory = makeCompilerFactory(queryService, spi, innerPlannerConfig, runtimeConfig);
        return new SystemExecutionEngine(queryService, cacheFactory, spi.logProvider(), compilerFactory, innerCompilerFactory);
    } else if (spi.config().get(GraphDatabaseInternalSettings.snapshot_query)) {
        return new SnapshotExecutionEngine(queryService, spi.config(), cacheFactory, spi.logProvider(), compilerFactory);
    } else {
        return new ExecutionEngine(queryService, cacheFactory, spi.logProvider(), compilerFactory);
    }
}
Also used : CompilerFactory(org.neo4j.cypher.internal.CompilerFactory) CommunityCompilerFactory(org.neo4j.cypher.internal.CommunityCompilerFactory) CypherRuntimeConfiguration(org.neo4j.cypher.internal.CypherRuntimeConfiguration) QueryExecutionEngine(org.neo4j.kernel.impl.query.QueryExecutionEngine) ExecutorBasedCaffeineCacheFactory(org.neo4j.cypher.internal.cache.ExecutorBasedCaffeineCacheFactory) CaffeineCacheFactory(org.neo4j.cypher.internal.cache.CaffeineCacheFactory) CypherPlannerConfiguration(org.neo4j.cypher.internal.compiler.CypherPlannerConfiguration) CypherConfiguration(org.neo4j.cypher.internal.config.CypherConfiguration)

Aggregations

CypherConfiguration (org.neo4j.cypher.internal.config.CypherConfiguration)2 QueryExecutionEngine (org.neo4j.kernel.impl.query.QueryExecutionEngine)2 DependencyResolver (org.neo4j.common.DependencyResolver)1 Config (org.neo4j.configuration.Config)1 CommunityCompilerFactory (org.neo4j.cypher.internal.CommunityCompilerFactory)1 CompilerFactory (org.neo4j.cypher.internal.CompilerFactory)1 CypherRuntimeConfiguration (org.neo4j.cypher.internal.CypherRuntimeConfiguration)1 ExecutionEngineQueryCacheMonitor (org.neo4j.cypher.internal.ExecutionEngineQueryCacheMonitor)1 CaffeineCacheFactory (org.neo4j.cypher.internal.cache.CaffeineCacheFactory)1 ExecutorBasedCaffeineCacheFactory (org.neo4j.cypher.internal.cache.ExecutorBasedCaffeineCacheFactory)1 CypherPlannerConfiguration (org.neo4j.cypher.internal.compiler.CypherPlannerConfiguration)1 CompilationTracer (org.neo4j.cypher.internal.tracing.CompilationTracer)1 TimingCompilationTracer (org.neo4j.cypher.internal.tracing.TimingCompilationTracer)1 Monitors (org.neo4j.monitoring.Monitors)1