use of org.neo4j.monitoring.Monitors in project neo4j by neo4j.
the class DatabaseManagementServiceFactoryTest method setup.
@BeforeEach
void setup() {
when(deps.monitors()).thenReturn(new Monitors());
when(deps.dependencies()).thenReturn(null);
}
use of org.neo4j.monitoring.Monitors in project neo4j by neo4j.
the class StoreUpgraderInterruptionTestIT method newUpgrader.
private StoreUpgrader newUpgrader(StoreVersionCheck versionCheck, MigrationProgressMonitor progressMonitor, StoreMigrationParticipant... participants) {
Config config = Config.defaults(allow_upgrade, true);
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependencies(new Monitors());
RecordStorageEngineFactory storageEngineFactory = new RecordStorageEngineFactory();
var databaseHealth = new DatabaseHealth(PanicEventGenerator.NO_OP, NullLog.getInstance());
LogsUpgrader logsUpgrader = new LogsUpgrader(fs, storageEngineFactory, workingDatabaseLayout, pageCache, legacyTransactionLogsLocator, config, dependencies, NULL, INSTANCE, databaseHealth, false);
StoreUpgrader upgrader = new StoreUpgrader(versionCheck, progressMonitor, config, fs, NullLogProvider.getInstance(), logsUpgrader, NULL);
for (StoreMigrationParticipant participant : participants) {
upgrader.addParticipant(participant);
}
return upgrader;
}
use of org.neo4j.monitoring.Monitors in project neo4j by neo4j.
the class LuceneIndexAccessorIT method setUp.
@BeforeEach
void setUp() {
Path path = directory.directory("db");
config = Config.defaults();
readOnlyChecker = new DatabaseReadOnlyChecker.Default(config, DEFAULT_DATABASE_NAME);
indexProvider = new LuceneIndexProvider(directory.getFileSystem(), PERSISTENT, directoriesByProvider(path), new Monitors(), config, readOnlyChecker);
life.add(indexProvider);
life.start();
samplingConfig = new IndexSamplingConfig(config);
}
use of org.neo4j.monitoring.Monitors in project neo4j by neo4j.
the class LuceneSchemaIndexCorruptionTest method newFaultyIndexProvider.
private LuceneIndexProvider newFaultyIndexProvider(long faultyIndexId, Exception error) {
DirectoryFactory directoryFactory = mock(DirectoryFactory.class);
Path indexRootFolder = testDirectory.homePath();
AtomicReference<FaultyIndexStorageFactory> reference = new AtomicReference<>();
Monitors monitors = new Monitors();
monitors.addMonitorListener(monitor);
return new LuceneIndexProvider(fs, directoryFactory, directoriesByProvider(indexRootFolder), monitors, Config.defaults(), readOnly()) {
@Override
protected IndexStorageFactory buildIndexStorageFactory(FileSystemAbstraction fileSystem, DirectoryFactory directoryFactory) {
FaultyIndexStorageFactory storageFactory = new FaultyIndexStorageFactory(faultyIndexId, error, directoryFactory, directoryStructure());
reference.set(storageFactory);
return storageFactory;
}
};
}
use of org.neo4j.monitoring.Monitors in project neo4j by neo4j.
the class LuceneSchemaIndexPopulatorTest method before.
@BeforeEach
void before() throws IOException {
directory = new ByteBuffersDirectory();
DirectoryFactory directoryFactory = new DirectoryFactory.Single(new DirectoryFactory.UncloseableDirectory(directory));
provider = new LuceneIndexProvider(fs, directoryFactory, directoriesByProvider(testDir.directory("folder")), new Monitors(), Config.defaults(), writable());
propertyAccessor = mock(NodePropertyAccessor.class);
IndexSamplingConfig samplingConfig = new IndexSamplingConfig(Config.defaults());
index = IndexPrototype.forSchema(forLabel(42, propertyKeyId), provider.getProviderDescriptor()).withName("index").materialise(0);
indexPopulator = provider.getPopulator(index, samplingConfig, heapBufferFactory(1024), INSTANCE, SIMPLE_TOKEN_LOOKUP);
indexPopulator.create();
}
Aggregations