Package com.pinterest.secor.tools

Examples of com.pinterest.secor.tools.LogFileVerifier


    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);
View Full Code Here

TOP

Related Classes of com.pinterest.secor.tools.LogFileVerifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.