Search in sources :

Example 1 with EcoSubmitter

use of org.apache.heron.eco.submit.EcoSubmitter in project heron by twitter.

the class Eco method main.

public static void main(String[] args) throws Exception {
    Options options = constructOptions();
    CommandLineParser parser = new DefaultParser();
    CommandLine cmd;
    try {
        cmd = parser.parse(options, args);
    } catch (ParseException e) {
        throw new RuntimeException("Error parsing command line options: ", e);
    }
    FileInputStream fin = new FileInputStream(new File(cmd.getOptionValue(ECO_CONFIG_FILE)));
    String propsFile = cmd.getOptionValue(PROPS);
    FileInputStream propsInputStream = null;
    if (propsFile != null) {
        propsInputStream = new FileInputStream(new File(propsFile));
    }
    Boolean filterFromEnv = cmd.hasOption(ENV_PROPS);
    Eco eco = new Eco(new EcoParser(), new EcoSubmitter());
    eco.submit(fin, propsInputStream, filterFromEnv);
}
Also used : Options(org.apache.commons.cli.Options) FileInputStream(java.io.FileInputStream) CommandLine(org.apache.commons.cli.CommandLine) EcoParser(org.apache.heron.eco.parser.EcoParser) CommandLineParser(org.apache.commons.cli.CommandLineParser) ParseException(org.apache.commons.cli.ParseException) File(java.io.File) EcoSubmitter(org.apache.heron.eco.submit.EcoSubmitter) DefaultParser(org.apache.commons.cli.DefaultParser)

Aggregations

File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 CommandLine (org.apache.commons.cli.CommandLine)1 CommandLineParser (org.apache.commons.cli.CommandLineParser)1 DefaultParser (org.apache.commons.cli.DefaultParser)1 Options (org.apache.commons.cli.Options)1 ParseException (org.apache.commons.cli.ParseException)1 EcoParser (org.apache.heron.eco.parser.EcoParser)1 EcoSubmitter (org.apache.heron.eco.submit.EcoSubmitter)1