use of org.neo4j.kernel.recovery.PositionToRecoverFrom in project neo4j by neo4j.
the class RecoveryRequiredChecker method isRecoveryRequiredAt.
public boolean isRecoveryRequiredAt(File dataDir) throws IOException {
File neoStore = new File(dataDir, MetaDataStore.DEFAULT_NAME);
boolean noStoreFound = !NeoStores.isStorePresent(pageCache, dataDir);
// We need config to determine where the logical log files are
if (noStoreFound) {
// No database in the specified directory.
return false;
}
long logVersion = MetaDataStore.getRecord(pageCache, neoStore, MetaDataStore.Position.LOG_VERSION);
PhysicalLogFiles logFiles = new PhysicalLogFiles(dataDir, fs);
LogEntryReader<ReadableClosablePositionAwareChannel> reader = new VersionAwareLogEntryReader<>();
LatestCheckPointFinder finder = new LatestCheckPointFinder(logFiles, fs, reader);
return new PositionToRecoverFrom(finder, NO_MONITOR).apply(logVersion) != LogPosition.UNSPECIFIED;
}
Aggregations