use of org.neo4j.io.fs.watcher.DatabaseLayoutWatcher in project neo4j by neo4j.
the class Database method init.
/**
* Initialize the database, and bring it to a state where its version can be examined, and it can be
* upgraded if necessary.
*/
@Override
public synchronized void init() {
if (initialized) {
return;
}
try {
databaseDependencies = new Dependencies(globalDependencies);
ioController = ioControllerService.createIOController(databaseConfig, clock);
databasePageCache = new DatabasePageCache(globalPageCache, ioController);
databaseMonitors = new Monitors(parentMonitors, internalLogProvider);
life = new LifeSupport();
life.add(new LockerLifecycleAdapter(fileLockerService.createDatabaseLocker(fs, databaseLayout)));
life.add(databaseConfig);
databaseHealth = databaseHealthFactory.newInstance();
databaseAvailability = new DatabaseAvailability(databaseAvailabilityGuard, transactionStats, clock, getAwaitActiveTransactionDeadlineMillis());
databaseDependencies.satisfyDependency(this);
databaseDependencies.satisfyDependency(ioController);
databaseDependencies.satisfyDependency(readOnlyDatabaseChecker);
databaseDependencies.satisfyDependency(databaseLayout);
databaseDependencies.satisfyDependency(startupController);
databaseDependencies.satisfyDependency(databaseConfig);
databaseDependencies.satisfyDependency(databaseMonitors);
databaseDependencies.satisfyDependency(databaseLogService);
databaseDependencies.satisfyDependency(databasePageCache);
databaseDependencies.satisfyDependency(tokenHolders);
databaseDependencies.satisfyDependency(databaseFacade);
databaseDependencies.satisfyDependency(kernelTransactionFactory);
databaseDependencies.satisfyDependency(databaseHealth);
databaseDependencies.satisfyDependency(storeCopyCheckPointMutex);
databaseDependencies.satisfyDependency(transactionStats);
databaseDependencies.satisfyDependency(locks);
databaseDependencies.satisfyDependency(databaseAvailabilityGuard);
databaseDependencies.satisfyDependency(databaseAvailability);
databaseDependencies.satisfyDependency(idGeneratorFactory);
databaseDependencies.satisfyDependency(idController);
databaseDependencies.satisfyDependency(lockService);
databaseDependencies.satisfyDependency(versionContextSupplier);
databaseDependencies.satisfyDependency(tracers.getDatabaseTracer());
databaseDependencies.satisfyDependency(tracers.getPageCacheTracer());
databaseDependencies.satisfyDependency(storageEngineFactory);
recoveryCleanupWorkCollector = RecoveryCleanupWorkCollector.immediate();
databaseDependencies.satisfyDependency(recoveryCleanupWorkCollector);
life.add(new PageCacheLifecycle(databasePageCache));
life.add(initializeExtensions(databaseDependencies));
DatabaseLayoutWatcher watcherService = watcherServiceFactory.apply(databaseLayout);
life.add(watcherService);
databaseDependencies.satisfyDependency(watcherService);
otherDatabasePool = otherMemoryPool.newDatabasePool(namedDatabaseId.name(), 0, null);
life.add(onShutdown(() -> otherDatabasePool.close()));
otherDatabaseMemoryTracker = otherDatabasePool.getPoolMemoryTracker();
databaseDependencies.satisfyDependency(new DatabaseMemoryTrackers(otherDatabaseMemoryTracker));
eventListeners.databaseCreate(namedDatabaseId);
initialized = true;
} catch (Throwable e) {
handleStartupFailure(e);
}
}
Aggregations