use of org.neo4j.tools.txlog.checktypes.CheckType in project neo4j by neo4j.
the class CheckTxLogs method main.
public static void main(String[] args) throws Exception {
PrintStream out = System.out;
Args arguments = Args.withFlags(HELP_FLAG, VALIDATE_CHECKPOINTS_FLAG).parse(args);
if (arguments.getBoolean(HELP_FLAG)) {
printUsageAndExit(out);
}
boolean validateCheckPoints = arguments.getBoolean(VALIDATE_CHECKPOINTS_FLAG);
CheckType<?, ?>[] checkTypes = parseChecks(arguments);
File dir = parseDir(out, arguments);
boolean success = false;
try (FileSystemAbstraction fs = new DefaultFileSystemAbstraction()) {
PhysicalLogFiles logFiles = new PhysicalLogFiles(dir, fs);
int numberOfLogFilesFound = (int) (logFiles.getHighestLogVersion() - logFiles.getLowestLogVersion() + 1);
out.println("Found " + numberOfLogFilesFound + " log files to verify in " + dir.getCanonicalPath());
CheckTxLogs tool = new CheckTxLogs(out, fs);
PrintingInconsistenciesHandler handler = new PrintingInconsistenciesHandler(out);
success = tool.scan(logFiles, handler, checkTypes);
if (validateCheckPoints) {
success &= tool.validateCheckPoints(logFiles, handler);
}
}
if (!success) {
System.exit(1);
}
}
Aggregations