Search in sources :

Example 1 with LoggingMonitor

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);
}
Also used : Path(java.nio.file.Path) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) Log(org.neo4j.logging.Log) LoggingMonitor(org.neo4j.kernel.api.index.LoggingMonitor) Config(org.neo4j.configuration.Config) Monitors(org.neo4j.monitoring.Monitors) PageCacheTracer(org.neo4j.io.pagecache.tracing.PageCacheTracer) DatabaseLayout(org.neo4j.io.layout.DatabaseLayout) RecoveryCleanupWorkCollector(org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector) PageCache(org.neo4j.io.pagecache.PageCache)

Aggregations

Path (java.nio.file.Path)1 Config (org.neo4j.configuration.Config)1 RecoveryCleanupWorkCollector (org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector)1 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)1 DatabaseLayout (org.neo4j.io.layout.DatabaseLayout)1 PageCache (org.neo4j.io.pagecache.PageCache)1 PageCacheTracer (org.neo4j.io.pagecache.tracing.PageCacheTracer)1 LoggingMonitor (org.neo4j.kernel.api.index.LoggingMonitor)1 Log (org.neo4j.logging.Log)1 Monitors (org.neo4j.monitoring.Monitors)1