use of org.neo4j.kernel.impl.storemigration.RecordStoreVersionCheck in project neo4j by neo4j.
the class StoreUpgraderInterruptionTestIT method tracePageCacheAccessOnIdStoreUpgrade.
@Test
public void tracePageCacheAccessOnIdStoreUpgrade() throws IOException, ConsistencyCheckIncompleteException {
MigrationTestUtils.prepareSampleLegacyDatabase(version, fs, workingDatabaseLayout.databaseDirectory(), prepareDirectory);
RecordStoreVersionCheck versionCheck = new RecordStoreVersionCheck(fs, pageCache, workingDatabaseLayout, NullLogProvider.getInstance(), Config.defaults(), NULL);
MigrationProgressMonitor progressMonitor = MigrationProgressMonitor.SILENT;
LogService logService = NullLogService.getInstance();
var idMigratorTracer = new DefaultPageCacheTracer();
var recordMigratorTracer = new DefaultPageCacheTracer();
IdGeneratorMigrator idMigrator = new IdGeneratorMigrator(fs, pageCache, CONFIG, idMigratorTracer);
assertTrue(checkNeoStoreHasFormatVersion(versionCheck, baselineFormat));
var migrator = new RecordStorageMigrator(fs, pageCache, CONFIG, logService, jobScheduler, recordMigratorTracer, batchImporterFactory, INSTANCE);
newUpgrader(versionCheck, progressMonitor, createIndexMigrator(), migrator, idMigrator).migrateIfNeeded(workingDatabaseLayout, false);
assertTrue(checkNeoStoreHasFormatVersion(versionCheck, successorFormat));
startStopDatabase(neo4jLayout.homeDirectory());
assertConsistentStore(workingDatabaseLayout);
assertEquals(43, idMigratorTracer.faults());
assertEquals(83, idMigratorTracer.hits());
assertEquals(126, idMigratorTracer.pins());
assertEquals(126, idMigratorTracer.unpins());
assertEquals(61, recordMigratorTracer.faults());
assertEquals(228, recordMigratorTracer.hits());
assertEquals(289, recordMigratorTracer.pins());
assertEquals(289, recordMigratorTracer.unpins());
}
Aggregations