use of org.apache.reef.tang.formats.CommandLine in project mist by snuspl.
the class WordCount method main.
/**
* Set the environment(Hostname and port of driver, source, and sink) and submit a query.
* @param args command line parameters
* @throws Exception
*/
public static void main(final String[] args) throws Exception {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
final CommandLine commandLine = MISTExampleUtils.getDefaultCommandLine(jcb).registerShortNameOfClass(// Additional parameter
NettySourceAddress.class).processCommandLine(args);
if (commandLine == null) {
// Option '?' was entered and processCommandLine printed the help.
return;
}
Thread sinkServer = new Thread(MISTExampleUtils.getSinkServer());
sinkServer.start();
final APIQueryControlResult result = submitQuery(jcb.build());
System.out.println("Query submission result: " + result.getQueryId());
}
use of org.apache.reef.tang.formats.CommandLine in project mist by snuspl.
the class Mist method getCommandLineConf.
/**
* Gets configurations from command line args.
*/
private static Configuration getCommandLineConf(final String[] args) throws Exception {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
CommandLine commandLine = new CommandLine(jcb).registerShortNameOfClass(DriverRuntimeType.class).registerShortNameOfClass(DriverMemorySize.class);
commandLine = MistCommandLineOptions.addCommandLineConf(commandLine);
commandLine = commandLine.processCommandLine(args);
if (commandLine == null) {
// Option '?' was entered and processCommandLine printed the help.
return null;
}
return jcb.build();
}
use of org.apache.reef.tang.formats.CommandLine in project mist by snuspl.
the class RuleBasedWeatherInfo method main.
/**
* Set the environment(Hostname and port of driver, source, and sink) and submit a query.
* @param args command line parameters
* @throws Exception
*/
public static void main(final String[] args) throws Exception {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
final CommandLine commandLine = MISTExampleUtils.getDefaultCommandLine(jcb).registerShortNameOfClass(// Additional parameter
NettySourceAddress.class).processCommandLine(args);
if (commandLine == null) {
// Option '?' was entered and processCommandLine printed the help.
return;
}
Thread sinkServer = new Thread(MISTExampleUtils.getSinkServer());
sinkServer.start();
final APIQueryControlResult result = submitQuery(jcb.build());
System.out.println("Query submission result: " + result.getQueryId());
}
use of org.apache.reef.tang.formats.CommandLine in project mist by snuspl.
the class CepHRMonitoring method main.
/**
* Set the environment(Hostname and port of driver, source, and sink) and submit a query.
* @param args command line parameters
* @throws Exception
*/
public static void main(final String[] args) throws Exception {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
final CommandLine commandLine = MISTExampleUtils.getDefaultCommandLine(jcb).registerShortNameOfClass(// Additional parameter
NettySourceAddress.class).processCommandLine(args);
if (commandLine == null) {
// Option '?' was entered and processCommandLine printed the help.
return;
}
Thread sinkServer = new Thread(MISTExampleUtils.getSinkServer());
sinkServer.start();
final APIQueryControlResult result = submitQuery(jcb.build());
System.out.println("Query submission result: " + result.getQueryId());
}
use of org.apache.reef.tang.formats.CommandLine in project mist by snuspl.
the class JoinAndApplyStateful method main.
/**
* Set the environment(Hostname and port of driver, source, and sink) and submit a query.
* @param args command line parameters
* @throws Exception
*/
public static void main(final String[] args) throws Exception {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
final CommandLine commandLine = MISTExampleUtils.getDefaultCommandLine(jcb).registerShortNameOfClass(// Additional parameter
UnionLeftSourceAddress.class).registerShortNameOfClass(// Additional parameter
UnionRightSourceAddress.class).processCommandLine(args);
if (commandLine == null) {
// Option '?' was entered and processCommandLine printed the help.
return;
}
Thread sinkServer = new Thread(MISTExampleUtils.getSinkServer());
sinkServer.start();
final APIQueryControlResult result = submitQuery(jcb.build());
System.out.println("Query submission result: " + result.getQueryId());
}
Aggregations