use of org.neo4j.kernel.api.index.LoggingMonitor in project neo4j by neo4j.
the class AbstractIndexProviderFactory method newInstance.
@Override
public IndexProvider newInstance(ExtensionContext context, Dependencies dependencies) {
PageCache pageCache = dependencies.pageCache();
Path databaseDir = context.directory();
FileSystemAbstraction fs = dependencies.fileSystem();
Log log = dependencies.getLogService().getInternalLogProvider().getLog(loggingClass());
Monitors monitors = dependencies.monitors();
String monitorTag = descriptor().toString();
monitors.addMonitorListener(new LoggingMonitor(log), monitorTag);
Config config = dependencies.getConfig();
var readOnlyChecker = dependencies.readOnlyChecker();
if (OperationalMode.SINGLE != context.dbmsInfo().operationalMode) {
// if running as part of cluster indexes should be writable to allow catchup process to accept transactions
readOnlyChecker = DatabaseReadOnlyChecker.writable();
}
RecoveryCleanupWorkCollector recoveryCleanupWorkCollector = dependencies.recoveryCleanupWorkCollector();
PageCacheTracer pageCacheTracer = dependencies.pageCacheTracer();
DatabaseLayout databaseLayout = dependencies.databaseLayout();
return internalCreate(pageCache, databaseDir, fs, monitors, monitorTag, config, readOnlyChecker, recoveryCleanupWorkCollector, databaseLayout, pageCacheTracer);
}
Aggregations