@Override public void migrate( DatabaseLayout directoryLayout, DatabaseLayout migrationLayout, ProgressReporter progressMonitor, String versionToMigrateFrom, String versionToMigrateTo ) throws IOException { if ( countStoreRebuildRequired( versionToMigrateFrom ) ) { // create counters from scratch fileOperation( DELETE, fileSystem, migrationLayout, migrationLayout, COUNTS_STORE_FILES, true, null ); File neoStore = directoryLayout.metadataStore(); long lastTxId = MetaDataStore.getRecord( pageCache, neoStore, Position.LAST_TRANSACTION_ID ); try { rebuildCountsFromScratch( directoryLayout, migrationLayout, lastTxId, progressMonitor, versionToMigrateTo, pageCache, NullLogProvider.getInstance() ); } catch ( StoreFailureException e ) { //This means that we did not perform a full migration, as the formats had the same capabilities. Thus // we should use the store directory for information when rebuilding the count store. Note that we // still put the new count store in the migration directory. rebuildCountsFromScratch( directoryLayout, migrationLayout, lastTxId, progressMonitor, versionToMigrateFrom, pageCache, NullLogProvider.getInstance() ); } migrated = true; } }
@Override public void migrate( DatabaseLayout directoryLayout, DatabaseLayout migrationLayout, ProgressReporter progressMonitor, String versionToMigrateFrom, String versionToMigrateTo ) throws IOException { if ( countStoreRebuildRequired( versionToMigrateFrom ) ) { // create counters from scratch fileOperation( DELETE, fileSystem, migrationLayout, migrationLayout, COUNTS_STORE_FILES, true, null ); File neoStore = directoryLayout.metadataStore(); long lastTxId = MetaDataStore.getRecord( pageCache, neoStore, Position.LAST_TRANSACTION_ID ); try { rebuildCountsFromScratch( directoryLayout, migrationLayout, lastTxId, progressMonitor, versionToMigrateTo, pageCache, NullLogProvider.getInstance() ); } catch ( StoreFailureException e ) { //This means that we did not perform a full migration, as the formats had the same capabilities. Thus // we should use the store directory for information when rebuilding the count store. Note that we // still put the new count store in the migration directory. rebuildCountsFromScratch( directoryLayout, migrationLayout, lastTxId, progressMonitor, versionToMigrateFrom, pageCache, NullLogProvider.getInstance() ); } migrated = true; } }