Search in sources :

Example 6 with ScanOnOpenOverwritingIdGeneratorFactory

use of org.neo4j.internal.id.ScanOnOpenOverwritingIdGeneratorFactory in project neo4j by neo4j.

the class StoreUpgraderTest method verifyStoreUpgradedWithin.

private void verifyStoreUpgradedWithin(long duration, TimeUnit unit) {
    StoreFactory factory = new StoreFactory(databaseLayout, allowMigrateConfig, new ScanOnOpenOverwritingIdGeneratorFactory(fileSystem, databaseLayout.getDatabaseName()), pageCache, fileSystem, NullLogProvider.getInstance(), NULL, writable());
    try (NeoStores neoStores = factory.openAllNeoStores()) {
        assertThat(neoStores.getMetaDataStore().getUpgradeTransaction()).isEqualTo(neoStores.getMetaDataStore().getLastCommittedTransaction());
        assertThat(neoStores.getMetaDataStore().getUpgradeTime()).isPositive();
        long minuteAgo = System.currentTimeMillis() - unit.toMillis(duration);
        assertThat(neoStores.getMetaDataStore().getUpgradeTime()).isGreaterThan(minuteAgo);
    }
}
Also used : NeoStores(org.neo4j.kernel.impl.store.NeoStores) StoreFactory(org.neo4j.kernel.impl.store.StoreFactory) ScanOnOpenOverwritingIdGeneratorFactory(org.neo4j.internal.id.ScanOnOpenOverwritingIdGeneratorFactory)

Aggregations

ScanOnOpenOverwritingIdGeneratorFactory (org.neo4j.internal.id.ScanOnOpenOverwritingIdGeneratorFactory)6 StoreFactory (org.neo4j.kernel.impl.store.StoreFactory)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 MethodSource (org.junit.jupiter.params.provider.MethodSource)5 Path (java.nio.file.Path)4 LogService (org.neo4j.logging.internal.LogService)4 NullLogService (org.neo4j.logging.internal.NullLogService)4 SimpleLogService (org.neo4j.logging.internal.SimpleLogService)4 NeoStores (org.neo4j.kernel.impl.store.NeoStores)3 MigrationProgressMonitor (org.neo4j.storageengine.migration.MigrationProgressMonitor)3 AssertableLogProvider (org.neo4j.logging.AssertableLogProvider)2 IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 ArrayList (java.util.ArrayList)1 NoSuchElementException (java.util.NoSuchElementException)1 SplittableRandom (java.util.SplittableRandom)1 MutableLongSet (org.eclipse.collections.api.set.primitive.MutableLongSet)1 LongHashSet (org.eclipse.collections.impl.set.mutable.primitive.LongHashSet)1 ProgressReporter (org.neo4j.common.ProgressReporter)1 GBPTreeRelationshipGroupDegreesStore (org.neo4j.internal.counts.GBPTreeRelationshipGroupDegreesStore)1