use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class BTreeIndexKeySizeValidationIT method startDb.
private void startDb(int pageSize) {
TestDatabaseManagementServiceBuilder builder = new TestDatabaseManagementServiceBuilder(neo4jLayout);
builder.setConfig(default_schema_provider, NATIVE_BTREE10.providerName());
scheduler = JobSchedulerFactory.createInitialisedScheduler();
PageCache pageCache = StandalonePageCacheFactory.createPageCache(fs, scheduler, pageSize);
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependency(pageCache);
builder.setExternalDependencies(dependencies);
dbms = builder.build();
db = (GraphDatabaseAPI) dbms.database(DEFAULT_DATABASE_NAME);
}
use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class StoreUpgraderTest method newUpgrader.
private StoreUpgrader newUpgrader(StoreVersionCheck storeVersionCheck, PageCache pageCache, Config config, MigrationProgressMonitor progressMonitor, PageCacheTracer pageCacheTracer, boolean forceUpgrade) {
NullLogService instance = NullLogService.getInstance();
BatchImporterFactory batchImporterFactory = BatchImporterFactory.withHighestPriority();
RecordStorageMigrator defaultMigrator = new RecordStorageMigrator(fileSystem, pageCache, getTuningConfig(), instance, jobScheduler, pageCacheTracer, batchImporterFactory, INSTANCE);
StorageEngineFactory storageEngineFactory = StorageEngineFactory.defaultStorageEngine();
SchemaIndexMigrator indexMigrator = new SchemaIndexMigrator("Indexes", fileSystem, pageCache, IndexProvider.EMPTY.directoryStructure(), storageEngineFactory, true);
LegacyTransactionLogsLocator logsLocator = new LegacyTransactionLogsLocator(config, databaseLayout);
DatabaseHealth databaseHealth = new DatabaseHealth(NO_OP, NullLog.getInstance());
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependencies(new Monitors());
LogsUpgrader logsUpgrader = new LogsUpgrader(fileSystem, storageEngineFactory, databaseLayout, pageCache, logsLocator, config, dependencies, pageCacheTracer, INSTANCE, databaseHealth, forceUpgrade);
StoreUpgrader upgrader = new StoreUpgrader(storeVersionCheck, progressMonitor, config, fileSystem, NullLogProvider.getInstance(), logsUpgrader, pageCacheTracer);
upgrader.addParticipant(indexMigrator);
upgrader.addParticipant(NOT_PARTICIPATING);
upgrader.addParticipant(NOT_PARTICIPATING);
upgrader.addParticipant(NOT_PARTICIPATING);
upgrader.addParticipant(NOT_PARTICIPATING);
upgrader.addParticipant(defaultMigrator);
return upgrader;
}
use of org.neo4j.collection.Dependencies 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);
}
}
use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class QueryRestartIT method startSnapshotQueryDb.
private GraphDatabaseService startSnapshotQueryDb() {
// Inject TransactionVersionContextSupplier
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependencies(testContextSupplier);
managementService = new TestDatabaseManagementServiceBuilder(storeDir).setExternalDependencies(dependencies).setConfig(snapshot_query, true).setConfig(index_background_sampling_enabled, false).build();
return managementService.database(DEFAULT_DATABASE_NAME);
}
use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class DbmsSupportController method startDatabase.
public void startDatabase(String databaseName) {
if (!dbms.listDatabases().contains(databaseName)) {
dbms.createDatabase(databaseName);
}
var db = (GraphDatabaseAPI) dbms.database(databaseName);
var dependencyResolver = db.getDependencyResolver();
injectDependencies(dependencyResolver);
// Also inject DbmsController into the test.
Dependencies deps = new Dependencies();
deps.satisfyDependencies(asDbmsController());
injectDependencies(deps);
}
Aggregations