use of org.neo4j.monitoring.Monitors in project neo4j by neo4j.
the class FusionIndexProvider30CompatibilitySuiteTest method createIndexProvider.
@Override
protected IndexProvider createIndexProvider(PageCache pageCache, FileSystemAbstraction fs, Path graphDbDir, Config config) {
Monitors monitors = new Monitors();
String monitorTag = "";
RecoveryCleanupWorkCollector recoveryCleanupWorkCollector = RecoveryCleanupWorkCollector.immediate();
var readOnlyChecker = new DatabaseReadOnlyChecker.Default(config, DEFAULT_DATABASE_NAME);
return NativeLuceneFusionIndexProviderFactory30.create(pageCache, graphDbDir, fs, monitors, monitorTag, config, readOnlyChecker, recoveryCleanupWorkCollector, PageCacheTracer.NULL, DEFAULT_DATABASE_NAME);
}
use of org.neo4j.monitoring.Monitors 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.monitoring.Monitors in project neo4j by neo4j.
the class BoltStateMachineFactoryImplTest method newBoltFactory.
private static BoltStateMachineFactoryImpl newBoltFactory(DatabaseManagementService managementService) {
var config = Config.defaults(GraphDatabaseSettings.default_database, CUSTOM_DB_NAME);
var dbProvider = new BoltKernelDatabaseManagementServiceProvider(managementService, new Monitors(), CLOCK, Duration.ZERO);
return new BoltStateMachineFactoryImpl(dbProvider, mock(Authentication.class), CLOCK, config, NullLogService.getInstance(), mock(DefaultDatabaseResolver.class));
}
use of org.neo4j.monitoring.Monitors in project neo4j by neo4j.
the class DefaultDatabaseTransactionStateMachineSPIProviderTest method newSpiProvider.
private TransactionStateMachineSPIProvider newSpiProvider(DatabaseManagementService managementService) {
var clock = mock(SystemNanoClock.class);
var dbProvider = new BoltKernelDatabaseManagementServiceProvider(managementService, new Monitors(), clock, Duration.ZERO);
return new AbstractTransactionStatementSPIProvider(dbProvider, mockBoltChannel, clock, mock(MemoryTracker.class, RETURNS_MOCKS)) {
@Override
protected TransactionStateMachineSPI newTransactionStateMachineSPI(BoltGraphDatabaseServiceSPI activeBoltGraphDatabaseServiceSPI, StatementProcessorReleaseManager resourceReleaseManger) {
return mock(TransactionStateMachineSPI.class);
}
@Override
public void releaseTransactionStateMachineSPI() {
}
};
}
use of org.neo4j.monitoring.Monitors in project neo4j by neo4j.
the class DatabaseServiceBookmarkTest method createDbSpi.
private BoltGraphDatabaseServiceSPI createDbSpi(TransactionIdStore txIdStore, Duration txAwaitDuration, DatabaseAvailabilityGuard availabilityGuard, SystemNanoClock clock) {
var queryExecutionEngine = mock(QueryExecutionEngine.class);
var db = mock(Database.class);
when(db.getNamedDatabaseId()).thenReturn(DATABASE_ID);
when(db.getDatabaseAvailabilityGuard()).thenReturn(availabilityGuard);
var dependencyResolver = mock(Dependencies.class);
when(dependencyResolver.resolveDependency(QueryExecutionEngine.class)).thenReturn(queryExecutionEngine);
when(dependencyResolver.resolveDependency(DatabaseAvailabilityGuard.class)).thenReturn(availabilityGuard);
when(dependencyResolver.resolveDependency(TransactionIdStore.class)).thenReturn(txIdStore);
when(dependencyResolver.resolveDependency(Database.class)).thenReturn(db);
when(db.getDependencyResolver()).thenReturn(dependencyResolver);
var facade = mock(GraphDatabaseAPI.class);
when(facade.getDependencyResolver()).thenReturn(dependencyResolver);
var tx = mock(InternalTransaction.class);
when(facade.beginTransaction(any(), any(), any())).thenReturn(tx);
var queryService = mock(GraphDatabaseQueryService.class);
when(queryService.getDependencyResolver()).thenReturn(dependencyResolver);
when(dependencyResolver.resolveDependency(GraphDatabaseQueryService.class)).thenReturn(queryService);
var managementService = mock(DatabaseManagementService.class);
when(managementService.database(DATABASE_ID.name())).thenReturn(facade);
var transactionIdTracker = new TransactionIdTracker(managementService, new Monitors(), clock);
return new BoltKernelGraphDatabaseServiceProvider(facade, transactionIdTracker, txAwaitDuration, mock(MemoryTracker.class, RETURNS_MOCKS));
}
Aggregations