public static void main(String[] args) {
try {
CommandLine commandLine = parseArgs(args);
SecorConfig config = SecorConfig.load();
FileUtil.configure(config);
LogFileVerifier verifier = new LogFileVerifier(config,
commandLine.getOptionValue("topic"));
long startOffset = -2;
long endOffset = Long.MAX_VALUE;
if (commandLine.hasOption("start_offset")) {
startOffset = Long.parseLong(commandLine.getOptionValue("start_offset"));
if (commandLine.hasOption("end_offset")) {
endOffset = Long.parseLong(commandLine.getOptionValue("end_offset"));
}
}
int numMessages = -1;
if (commandLine.hasOption("messages")) {
numMessages = ((Number) commandLine.getParsedOptionValue("messages")).intValue();
}
verifier.verifyCounts(startOffset, endOffset, numMessages);
if (commandLine.hasOption("sequence_offsets")) {
verifier.verifySequences(startOffset, endOffset);
}
System.out.println("verification succeeded");
} catch (Throwable t) {
LOG.error("Log file verifier failed", t);
System.exit(1);