Search in sources :

Example 6 with CommandLine

use of org.apache.samza.util.CommandLine in project samza by apache.

the class RepartitionExample method main.

// local execution mode
public static void main(String[] args) throws Exception {
    CommandLine cmdLine = new CommandLine();
    Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
    LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
    localRunner.run(new RepartitionExample());
}
Also used : CommandLine(org.apache.samza.util.CommandLine) Config(org.apache.samza.config.Config) LocalApplicationRunner(org.apache.samza.runtime.LocalApplicationRunner)

Example 7 with CommandLine

use of org.apache.samza.util.CommandLine in project samza by apache.

the class SamzaRestService method parseConfig.

/**
   * Reads a {@link org.apache.samza.config.Config} from command line parameters.
   * @param args  the command line parameters supported by {@link org.apache.samza.util.CommandLine}.
   * @return      the parsed {@link org.apache.samza.config.Config}.
   */
private static SamzaRestConfig parseConfig(String[] args) {
    CommandLine cmd = new CommandLine();
    OptionSet options = cmd.parser().parse(args);
    MapConfig cfg = cmd.loadConfig(options);
    return new SamzaRestConfig(new MapConfig(cfg));
}
Also used : CommandLine(org.apache.samza.util.CommandLine) MapConfig(org.apache.samza.config.MapConfig) OptionSet(joptsimple.OptionSet)

Example 8 with CommandLine

use of org.apache.samza.util.CommandLine in project samza by apache.

the class BroadcastExample method main.

// local execution mode
public static void main(String[] args) throws Exception {
    CommandLine cmdLine = new CommandLine();
    Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
    LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
    localRunner.run(new BroadcastExample());
}
Also used : CommandLine(org.apache.samza.util.CommandLine) Config(org.apache.samza.config.Config) LocalApplicationRunner(org.apache.samza.runtime.LocalApplicationRunner)

Example 9 with CommandLine

use of org.apache.samza.util.CommandLine in project samza by apache.

the class KeyValueStoreExample method main.

// local execution mode
public static void main(String[] args) throws Exception {
    CommandLine cmdLine = new CommandLine();
    Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
    LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
    localRunner.run(new KeyValueStoreExample());
}
Also used : CommandLine(org.apache.samza.util.CommandLine) Config(org.apache.samza.config.Config) LocalApplicationRunner(org.apache.samza.runtime.LocalApplicationRunner)

Example 10 with CommandLine

use of org.apache.samza.util.CommandLine in project samza by apache.

the class PageViewCounterExample method main.

// local execution mode
public static void main(String[] args) {
    CommandLine cmdLine = new CommandLine();
    Config config = cmdLine.loadConfig(cmdLine.parser().parse(args));
    LocalApplicationRunner localRunner = new LocalApplicationRunner(config);
    localRunner.run(new PageViewCounterExample());
}
Also used : CommandLine(org.apache.samza.util.CommandLine) Config(org.apache.samza.config.Config) LocalApplicationRunner(org.apache.samza.runtime.LocalApplicationRunner)

Aggregations

CommandLine (org.apache.samza.util.CommandLine)10 Config (org.apache.samza.config.Config)9 LocalApplicationRunner (org.apache.samza.runtime.LocalApplicationRunner)7 OptionSet (joptsimple.OptionSet)3 JobConfig (org.apache.samza.config.JobConfig)2 OptionParser (joptsimple.OptionParser)1 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)1 MapConfig (org.apache.samza.config.MapConfig)1 SetConfig (org.apache.samza.coordinator.stream.messages.SetConfig)1 ClientHelper (org.apache.samza.job.yarn.ClientHelper)1 MetricsValidator (org.apache.samza.metrics.MetricsValidator)1 HttpFileSystem (org.apache.samza.util.hadoop.HttpFileSystem)1