Search in sources :

Example 1 with Summarizers

use of org.apache.metron.dataloads.nonbulk.flatfile.importer.Summarizers in project metron by apache.

the class SimpleFlatFileSummarizer method main.

public static void main(Configuration hadoopConfig, String[] argv) throws Exception {
    CommandLine cli = SummarizeOptions.parse(new PosixParser(), argv);
    EnumMap<SummarizeOptions, Optional<Object>> config = SummarizeOptions.createConfig(cli);
    if (SummarizeOptions.LOG4J_PROPERTIES.has(cli)) {
        PropertyConfigurator.configure(SummarizeOptions.LOG4J_PROPERTIES.get(cli));
    }
    ExtractorHandler handler = ExtractorHandler.load(FileUtils.readFileToString(new File(SummarizeOptions.EXTRACTOR_CONFIG.get(cli).trim())));
    Summarizers strategy = (Summarizers) config.get(SummarizeOptions.IMPORT_MODE).get();
    strategy.getSummarizer().importData(config, handler, hadoopConfig);
}
Also used : CommandLine(org.apache.commons.cli.CommandLine) Optional(java.util.Optional) ExtractorHandler(org.apache.metron.dataloads.extractor.ExtractorHandler) PosixParser(org.apache.commons.cli.PosixParser) File(java.io.File) Summarizers(org.apache.metron.dataloads.nonbulk.flatfile.importer.Summarizers)

Aggregations

File (java.io.File)1 Optional (java.util.Optional)1 CommandLine (org.apache.commons.cli.CommandLine)1 PosixParser (org.apache.commons.cli.PosixParser)1 ExtractorHandler (org.apache.metron.dataloads.extractor.ExtractorHandler)1 Summarizers (org.apache.metron.dataloads.nonbulk.flatfile.importer.Summarizers)1