Search in sources :

Example 11 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class MetaDataStoreTest method newMetaDataStore.

private MetaDataStore newMetaDataStore() throws IOException {
    LogProvider logProvider = NullLogProvider.getInstance();
    StoreFactory storeFactory = new StoreFactory(STORE_DIR, pageCacheWithFakeOverflow, fs, logProvider);
    return storeFactory.openNeoStores(true, StoreType.META_DATA).getMetaDataStore();
}
Also used : LogProvider(org.neo4j.logging.LogProvider) NullLogProvider(org.neo4j.logging.NullLogProvider)

Example 12 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class StoreFactoryTest method storeFactory.

private StoreFactory storeFactory(Config config, OpenOption... openOptions) {
    LogProvider logProvider = NullLogProvider.getInstance();
    RecordFormats recordFormats = selectForStoreOrConfig(config, storeDir, fsRule.get(), pageCache, logProvider);
    return new StoreFactory(storeDir, DEFAULT_NAME, config, idGeneratorFactory, pageCache, fsRule.get(), recordFormats, logProvider, openOptions);
}
Also used : LogProvider(org.neo4j.logging.LogProvider) NullLogProvider(org.neo4j.logging.NullLogProvider) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats)

Example 13 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class ConsistencyCheckTool method run.

ConsistencyCheckService.Result run(String... args) throws ToolFailureException, IOException {
    Args arguments = Args.withFlags(VERBOSE).parse(args);
    File storeDir = determineStoreDirectory(arguments);
    Config tuningConfiguration = readConfiguration(arguments);
    boolean verbose = isVerbose(arguments);
    checkDbState(storeDir, tuningConfiguration);
    LogProvider logProvider = FormattedLogProvider.toOutputStream(System.out);
    try {
        return consistencyCheckService.runFullConsistencyCheck(storeDir, tuningConfiguration, ProgressMonitorFactory.textual(System.err), logProvider, fs, verbose, new CheckConsistencyConfig(tuningConfiguration));
    } catch (ConsistencyCheckIncompleteException e) {
        throw new ToolFailureException("Check aborted due to exception", e);
    }
}
Also used : LogProvider(org.neo4j.logging.LogProvider) FormattedLogProvider(org.neo4j.logging.FormattedLogProvider) Args(org.neo4j.helpers.Args) CheckConsistencyConfig(org.neo4j.consistency.checking.full.CheckConsistencyConfig) Config(org.neo4j.kernel.configuration.Config) CheckConsistencyConfig(org.neo4j.consistency.checking.full.CheckConsistencyConfig) ConsistencyCheckIncompleteException(org.neo4j.consistency.checking.full.ConsistencyCheckIncompleteException) File(java.io.File)

Example 14 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class DatabaseMigrator method migrate.

/**
     * Performs construction of {@link StoreUpgrader} and all of the necessary participants and performs store
     * migration if that is required.
     * @param storeDir store to migrate
     */
public void migrate(File storeDir) {
    LogProvider logProvider = logService.getInternalLogProvider();
    UpgradableDatabase upgradableDatabase = new UpgradableDatabase(fs, new StoreVersionCheck(pageCache), new LegacyStoreVersionCheck(fs), format);
    StoreUpgrader storeUpgrader = new StoreUpgrader(upgradableDatabase, progressMonitor, config, fs, pageCache, logProvider);
    StoreMigrationParticipant schemaMigrator = schemaIndexProvider.storeMigrationParticipant(fs, pageCache, labelScanStoreProvider);
    LegacyIndexMigrator legacyIndexMigrator = new LegacyIndexMigrator(fs, indexProviders, logProvider);
    StoreMigrator storeMigrator = new StoreMigrator(fs, pageCache, config, logService, schemaIndexProvider);
    storeUpgrader.addParticipant(schemaMigrator);
    storeUpgrader.addParticipant(legacyIndexMigrator);
    storeUpgrader.addParticipant(storeMigrator);
    storeUpgrader.migrateIfNeeded(storeDir);
}
Also used : LogProvider(org.neo4j.logging.LogProvider) LegacyStoreVersionCheck(org.neo4j.kernel.impl.storemigration.legacystore.LegacyStoreVersionCheck) LegacyIndexMigrator(org.neo4j.kernel.impl.storemigration.participant.LegacyIndexMigrator) StoreMigrator(org.neo4j.kernel.impl.storemigration.participant.StoreMigrator) LegacyStoreVersionCheck(org.neo4j.kernel.impl.storemigration.legacystore.LegacyStoreVersionCheck)

Example 15 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class LuceneSchemaIndexProviderFactory method newInstance.

@Override
public LuceneSchemaIndexProvider newInstance(KernelContext context, Dependencies dependencies) throws Throwable {
    Config config = dependencies.getConfig();
    LogProvider logging = dependencies.getLogging().getInternalLogProvider();
    boolean ephemeral = config.get(GraphDatabaseFacadeFactory.Configuration.ephemeral);
    FileSystemAbstraction fileSystem = dependencies.fileSystem();
    DirectoryFactory directoryFactory = directoryFactory(ephemeral, fileSystem);
    return new LuceneSchemaIndexProvider(fileSystem, directoryFactory, context.storeDir(), logging, config, context.databaseInfo().operationalMode);
}
Also used : LogProvider(org.neo4j.logging.LogProvider) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) Config(org.neo4j.kernel.configuration.Config) DirectoryFactory(org.neo4j.kernel.api.impl.index.storage.DirectoryFactory)

Aggregations

LogProvider (org.neo4j.logging.LogProvider)65 NullLogProvider (org.neo4j.logging.NullLogProvider)26 Config (org.neo4j.kernel.configuration.Config)16 File (java.io.File)15 Test (org.junit.Test)15 Log (org.neo4j.logging.Log)14 FormattedLogProvider (org.neo4j.logging.FormattedLogProvider)11 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)10 OnDemandJobScheduler (org.neo4j.test.OnDemandJobScheduler)9 Config (org.neo4j.configuration.Config)7 LogService (org.neo4j.kernel.impl.logging.LogService)7 DummyRaftableContentSerializer (org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer)6 StoreFactory (org.neo4j.kernel.impl.store.StoreFactory)6 Monitors (org.neo4j.kernel.monitoring.Monitors)6 DependencyResolver (org.neo4j.graphdb.DependencyResolver)5 DefaultIdGeneratorFactory (org.neo4j.internal.id.DefaultIdGeneratorFactory)5 RecordFormats (org.neo4j.kernel.impl.store.format.RecordFormats)5 IOException (java.io.IOException)4 Path (java.nio.file.Path)4 NeoStores (org.neo4j.kernel.impl.store.NeoStores)4