use of org.neo4j.common.DependencyResolver 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());
}
use of org.neo4j.common.DependencyResolver in project neo4j by neo4j.
the class UniqueConstraintCompatibility method resolveInternalDependency.
private <T> T resolveInternalDependency(Class<T> type) {
GraphDatabaseAPI api = (GraphDatabaseAPI) db;
DependencyResolver resolver = api.getDependencyResolver();
return resolver.resolveDependency(type);
}
use of org.neo4j.common.DependencyResolver in project neo4j by neo4j.
the class DatabaseManagementServiceBuilderIT method startSystemAndDefaultDatabase.
@Test
void startSystemAndDefaultDatabase() {
DatabaseManagementService managementService = getDbmsBuilderWithLimitedTxLogSize(testDirectory.homePath()).build();
GraphDatabaseAPI database = (GraphDatabaseAPI) managementService.database(DEFAULT_DATABASE_NAME);
try {
DependencyResolver dependencyResolver = database.getDependencyResolver();
DatabaseManager<?> databaseManager = dependencyResolver.resolveDependency(DatabaseManager.class);
assertThat(databaseManager.getDatabaseContext(DEFAULT_DATABASE_NAME)).isNotEmpty();
assertThat(databaseManager.getDatabaseContext(NAMED_SYSTEM_DATABASE_ID)).isNotEmpty();
} finally {
managementService.shutdown();
}
}
use of org.neo4j.common.DependencyResolver in project neo4j by neo4j.
the class GraphStoreFixture method startDatabaseAndExtractComponents.
private void startDatabaseAndExtractComponents() {
managementService = new TestDatabaseManagementServiceBuilder(testDirectory.homePath()).setFileSystem(testDirectory.getFileSystem()).setConfig(GraphDatabaseSettings.record_format, formatName).setConfig(GraphDatabaseInternalSettings.label_block_size, 60).setConfig(GraphDatabaseInternalSettings.consistency_check_on_apply, false).setConfig(getConfig()).build();
database = (GraphDatabaseAPI) managementService.database(DEFAULT_DATABASE_NAME);
DependencyResolver dependencyResolver = database.getDependencyResolver();
commitProcess = new InternalTransactionCommitProcess(dependencyResolver.resolveDependency(TransactionAppender.class), dependencyResolver.resolveDependency(StorageEngine.class));
transactionIdStore = database.getDependencyResolver().resolveDependency(TransactionIdStore.class);
storageEngine = dependencyResolver.resolveDependency(RecordStorageEngine.class);
neoStores = storageEngine.testAccessNeoStores();
indexingService = dependencyResolver.resolveDependency(IndexingService.class);
directStoreAccess = new DirectStoreAccess(neoStores, dependencyResolver.resolveDependency(IndexProviderMap.class), dependencyResolver.resolveDependency(TokenHolders.class), dependencyResolver.resolveDependency(IndexStatisticsStore.class), dependencyResolver.resolveDependency(IdGeneratorFactory.class));
countsStore = storageEngine.countsAccessor();
groupDegreesStore = storageEngine.relationshipGroupDegreesStore();
pageCache = dependencyResolver.resolveDependency(PageCache.class);
}
use of org.neo4j.common.DependencyResolver in project neo4j by neo4j.
the class DenseNodeConcurrencyIT method consistencyCheck.
@AfterAll
void consistencyCheck() throws ConsistencyCheckIncompleteException, IOException {
try {
DependencyResolver deps = database.getDependencyResolver();
Config config = deps.resolveDependency(Config.class);
DatabaseLayout databaseLayout = database.databaseLayout();
dbms.shutdown();
ConsistencyCheckService.Result result = new ConsistencyCheckService().runFullConsistencyCheck(databaseLayout, config, NONE, nullLogProvider(), deps.resolveDependency(FileSystemAbstraction.class), false, ConsistencyFlags.DEFAULT);
assertThat(result.isSuccessful()).as(new Description() {
@Override
public String value() {
return consistencyCheckReportAsString(result);
}
}).isTrue();
} finally {
fs.close();
}
}
Aggregations