Search in sources :

Example 1 with DbmsInfo

use of org.neo4j.kernel.impl.factory.DbmsInfo in project neo4j by neo4j.

the class Recovery method instantiateRecoveryExtensions.

private static DatabaseExtensions instantiateRecoveryExtensions(DatabaseLayout databaseLayout, FileSystemAbstraction fileSystem, Config config, LogService logService, PageCache pageCache, JobScheduler jobScheduler, DbmsInfo dbmsInfo, Monitors monitors, TokenHolders tokenHolders, RecoveryCleanupWorkCollector recoveryCleanupCollector, DatabaseReadOnlyChecker readOnlyChecker, Iterable<ExtensionFactory<?>> extensionFactories, PageCacheTracer pageCacheTracer) {
    List<ExtensionFactory<?>> recoveryExtensions = stream(extensionFactories).filter(extension -> extension.getClass().isAnnotationPresent(RecoveryExtension.class)).collect(toList());
    Dependencies deps = new Dependencies();
    NonListenableMonitors nonListenableMonitors = new NonListenableMonitors(monitors, logService.getInternalLogProvider());
    deps.satisfyDependencies(fileSystem, config, logService, pageCache, nonListenableMonitors, jobScheduler, tokenHolders, recoveryCleanupCollector, pageCacheTracer, databaseLayout, readOnlyChecker);
    DatabaseExtensionContext extensionContext = new DatabaseExtensionContext(databaseLayout, dbmsInfo, deps);
    return new DatabaseExtensions(extensionContext, recoveryExtensions, deps, ExtensionFailureStrategies.fail());
}
Also used : DatabaseExtensionContext(org.neo4j.kernel.extension.context.DatabaseExtensionContext) DefaultIdController(org.neo4j.internal.id.DefaultIdController) LogFilesBuilder(org.neo4j.kernel.impl.transaction.log.files.LogFilesBuilder) Config(org.neo4j.configuration.Config) NullLogProvider(org.neo4j.logging.NullLogProvider) VersionAwareLogEntryReader(org.neo4j.kernel.impl.transaction.log.entry.VersionAwareLogEntryReader) IndexStatisticsStore(org.neo4j.kernel.impl.api.index.stats.IndexStatisticsStore) DatabasePageCache(org.neo4j.dbms.database.DatabasePageCache) ReadOnlyTokenCreator(org.neo4j.token.ReadOnlyTokenCreator) PageCacheTracer(org.neo4j.io.pagecache.tracing.PageCacheTracer) RecoveryCleanupWorkCollector(org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector) NullLog(org.neo4j.logging.NullLog) Path(java.nio.file.Path) INDEX_CLEANUP_WORK(org.neo4j.scheduler.Group.INDEX_CLEANUP_WORK) EMPTY_CHECKER(org.neo4j.kernel.recovery.RecoveryStartupChecker.EMPTY_CHECKER) TransactionLogFilesHelper(org.neo4j.kernel.impl.transaction.log.files.TransactionLogFilesHelper) StorageFilesState(org.neo4j.storageengine.api.StorageFilesState) Dependencies(org.neo4j.collection.Dependencies) IOController(org.neo4j.io.pagecache.IOController) FullScanStoreView(org.neo4j.kernel.impl.transaction.state.storeview.FullScanStoreView) Services(org.neo4j.service.Services) SimpleTriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo) Database(org.neo4j.kernel.database.Database) DefaultIdGeneratorFactory(org.neo4j.internal.id.DefaultIdGeneratorFactory) Tracers(org.neo4j.kernel.monitoring.tracing.Tracers) VersionContextSupplier(org.neo4j.io.pagecache.context.VersionContextSupplier) IndexingService(org.neo4j.kernel.impl.api.index.IndexingService) RecoveryThreshold(org.neo4j.kernel.impl.transaction.log.checkpoint.RecoveryThreshold) DefaultForceOperation(org.neo4j.kernel.database.DefaultForceOperation) DelegatingTokenHolder(org.neo4j.token.DelegatingTokenHolder) TYPE_PROPERTY_KEY(org.neo4j.token.api.TokenHolder.TYPE_PROPERTY_KEY) DatabaseExtensions(org.neo4j.kernel.extension.DatabaseExtensions) DefaultIndexProviderMap(org.neo4j.kernel.impl.transaction.state.DefaultIndexProviderMap) MemoryTracker(org.neo4j.memory.MemoryTracker) Lifecycle(org.neo4j.kernel.lifecycle.Lifecycle) PanicEventGenerator(org.neo4j.monitoring.PanicEventGenerator) TransactionMetadataCache(org.neo4j.kernel.impl.transaction.log.TransactionMetadataCache) IOException(java.io.IOException) DatabaseTracers(org.neo4j.kernel.database.DatabaseTracers) ExtensionFactory(org.neo4j.kernel.extension.ExtensionFactory) TokenHolders(org.neo4j.token.TokenHolders) TYPE_LABEL(org.neo4j.token.api.TokenHolder.TYPE_LABEL) StoreCopyCheckPointMutex(org.neo4j.kernel.impl.transaction.log.checkpoint.StoreCopyCheckPointMutex) LifecycleAdapter(org.neo4j.kernel.lifecycle.LifecycleAdapter) Log(org.neo4j.logging.Log) BatchingTransactionAppender(org.neo4j.kernel.impl.transaction.log.BatchingTransactionAppender) LifeSupport(org.neo4j.kernel.lifecycle.LifeSupport) DatabaseLayout(org.neo4j.io.layout.DatabaseLayout) LogRotation(org.neo4j.kernel.impl.transaction.log.rotation.LogRotation) RecoveryState(org.neo4j.storageengine.api.RecoveryState) Monitors(org.neo4j.monitoring.Monitors) LogVersionRepository(org.neo4j.storageengine.api.LogVersionRepository) CheckPointerImpl(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointerImpl) DatabaseSchemaState(org.neo4j.kernel.impl.api.DatabaseSchemaState) JobSchedulerFactory(org.neo4j.kernel.impl.scheduler.JobSchedulerFactory) PageCache(org.neo4j.io.pagecache.PageCache) LegacyTransactionLogsLocator(org.neo4j.kernel.impl.storemigration.LegacyTransactionLogsLocator) StorageEngine(org.neo4j.storageengine.api.StorageEngine) DatabaseReadOnlyChecker.writable(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker.writable) LogProgressReporter(org.neo4j.kernel.impl.util.monitoring.LogProgressReporter) String.format(java.lang.String.format) List(java.util.List) NO_LOCK_SERVICE(org.neo4j.lock.LockService.NO_LOCK_SERVICE) SimpleLogService(org.neo4j.logging.internal.SimpleLogService) Optional(java.util.Optional) DatabaseReadOnlyChecker(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker) TYPE_RELATIONSHIP_TYPE(org.neo4j.token.api.TokenHolder.TYPE_RELATIONSHIP_TYPE) PhysicalLogicalTransactionStore(org.neo4j.kernel.impl.transaction.log.PhysicalLogicalTransactionStore) LogFiles(org.neo4j.kernel.impl.transaction.log.files.LogFiles) LogicalTransactionStore(org.neo4j.kernel.impl.transaction.log.LogicalTransactionStore) Config.defaults(org.neo4j.configuration.Config.defaults) ProgressReporter(org.neo4j.common.ProgressReporter) GraphDatabaseSettings(org.neo4j.configuration.GraphDatabaseSettings) LogProvider(org.neo4j.logging.LogProvider) ConfiguringPageCacheFactory(org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory) GroupingRecoveryCleanupWorkCollector(org.neo4j.index.internal.gbptree.GroupingRecoveryCleanupWorkCollector) Clocks.systemClock(org.neo4j.time.Clocks.systemClock) Iterables(org.neo4j.internal.helpers.collection.Iterables) Objects.requireNonNull(java.util.Objects.requireNonNull) StoreId(org.neo4j.storageengine.api.StoreId) GraphDatabaseInternalSettings(org.neo4j.configuration.GraphDatabaseInternalSettings) DbmsInfo(org.neo4j.kernel.impl.factory.DbmsInfo) LogPruning(org.neo4j.kernel.impl.transaction.log.pruning.LogPruning) MemoryPools(org.neo4j.memory.MemoryPools) IndexStoreViewFactory(org.neo4j.kernel.impl.transaction.state.storeview.IndexStoreViewFactory) JobScheduler(org.neo4j.scheduler.JobScheduler) Iterables.stream(org.neo4j.internal.helpers.collection.Iterables.stream) DatabaseHealth(org.neo4j.monitoring.DatabaseHealth) NO_LOCKS(org.neo4j.kernel.impl.locking.Locks.NO_LOCKS) ConstraintSemantics.getConstraintSemantics(org.neo4j.kernel.impl.constraints.ConstraintSemantics.getConstraintSemantics) LogService(org.neo4j.logging.internal.LogService) StorageEngineFactory(org.neo4j.storageengine.api.StorageEngineFactory) INDEX_CLEANUP(org.neo4j.scheduler.Group.INDEX_CLEANUP) MetadataProvider(org.neo4j.storageengine.api.MetadataProvider) DefaultFileSystemAbstraction(org.neo4j.io.fs.DefaultFileSystemAbstraction) Collectors.toList(java.util.stream.Collectors.toList) StorageEngineFactory.selectStorageEngine(org.neo4j.storageengine.api.StorageEngineFactory.selectStorageEngine) Clock(java.time.Clock) ExtensionFailureStrategies(org.neo4j.kernel.extension.ExtensionFailureStrategies) TransactionIdStore(org.neo4j.storageengine.api.TransactionIdStore) Clocks(org.neo4j.time.Clocks) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) EmptyVersionContextSupplier(org.neo4j.io.pagecache.context.EmptyVersionContextSupplier) ExtensionFactory(org.neo4j.kernel.extension.ExtensionFactory) DatabaseExtensionContext(org.neo4j.kernel.extension.context.DatabaseExtensionContext) DatabaseExtensions(org.neo4j.kernel.extension.DatabaseExtensions) Dependencies(org.neo4j.collection.Dependencies)

Example 2 with DbmsInfo

use of org.neo4j.kernel.impl.factory.DbmsInfo in project neo4j by neo4j.

the class DbmsDiagnosticsManager method dumpDatabaseDiagnostics.

private static void dumpDatabaseDiagnostics(Database database, Log log, boolean checkStatus) {
    dumpAsSingleMessageWithDbPrefix(log, stringJoiner -> {
        dumpDatabaseSectionName(database, stringJoiner::add);
        if (checkStatus) {
            logDatabaseStatus(database, stringJoiner::add);
            if (!database.isStarted()) {
                return;
            }
        }
        Dependencies databaseResolver = database.getDependencyResolver();
        DbmsInfo dbmsInfo = databaseResolver.resolveDependency(DbmsInfo.class);
        FileSystemAbstraction fs = databaseResolver.resolveDependency(FileSystemAbstraction.class);
        StorageEngineFactory storageEngineFactory = databaseResolver.resolveDependency(StorageEngineFactory.class);
        StorageEngine storageEngine = databaseResolver.resolveDependency(StorageEngine.class);
        DiagnosticsManager.dump(new VersionDiagnostics(dbmsInfo, database.getStoreId()), log, stringJoiner::add);
        DiagnosticsManager.dump(new StoreFilesDiagnostics(storageEngineFactory, fs, database.getDatabaseLayout()), log, stringJoiner::add);
        DiagnosticsManager.dump(new TransactionRangeDiagnostics(database), log, stringJoiner::add);
        storageEngine.dumpDiagnostics(log, stringJoiner::add);
    }, database.getNamedDatabaseId());
}
Also used : FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) StorageEngineFactory(org.neo4j.storageengine.api.StorageEngineFactory) DbmsInfo(org.neo4j.kernel.impl.factory.DbmsInfo) Dependencies(org.neo4j.collection.Dependencies) StorageEngine(org.neo4j.storageengine.api.StorageEngine)

Aggregations

Dependencies (org.neo4j.collection.Dependencies)2 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)2 IOException (java.io.IOException)1 String.format (java.lang.String.format)1 Path (java.nio.file.Path)1 Clock (java.time.Clock)1 List (java.util.List)1 Objects.requireNonNull (java.util.Objects.requireNonNull)1 Optional (java.util.Optional)1 Collectors.toList (java.util.stream.Collectors.toList)1 ProgressReporter (org.neo4j.common.ProgressReporter)1 Config (org.neo4j.configuration.Config)1 Config.defaults (org.neo4j.configuration.Config.defaults)1 GraphDatabaseInternalSettings (org.neo4j.configuration.GraphDatabaseInternalSettings)1 GraphDatabaseSettings (org.neo4j.configuration.GraphDatabaseSettings)1 DatabaseReadOnlyChecker (org.neo4j.configuration.helpers.DatabaseReadOnlyChecker)1 DatabaseReadOnlyChecker.writable (org.neo4j.configuration.helpers.DatabaseReadOnlyChecker.writable)1 DatabasePageCache (org.neo4j.dbms.database.DatabasePageCache)1 GroupingRecoveryCleanupWorkCollector (org.neo4j.index.internal.gbptree.GroupingRecoveryCleanupWorkCollector)1 RecoveryCleanupWorkCollector (org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector)1