Search in sources :

Example 1 with CommandLine

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());
}
Also used : APIQueryControlResult(edu.snu.mist.client.APIQueryControlResult) CommandLine(org.apache.reef.tang.formats.CommandLine) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder) NettySourceAddress(edu.snu.mist.examples.parameters.NettySourceAddress)

Example 2 with CommandLine

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();
}
Also used : CommandLine(org.apache.reef.tang.formats.CommandLine) DriverRuntimeType(edu.snu.mist.core.parameters.DriverRuntimeType) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder)

Example 3 with CommandLine

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());
}
Also used : APIQueryControlResult(edu.snu.mist.client.APIQueryControlResult) CommandLine(org.apache.reef.tang.formats.CommandLine) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder) NettySourceAddress(edu.snu.mist.examples.parameters.NettySourceAddress)

Example 4 with CommandLine

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());
}
Also used : APIQueryControlResult(edu.snu.mist.client.APIQueryControlResult) CommandLine(org.apache.reef.tang.formats.CommandLine) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder) NettySourceAddress(edu.snu.mist.examples.parameters.NettySourceAddress)

Example 5 with CommandLine

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());
}
Also used : APIQueryControlResult(edu.snu.mist.client.APIQueryControlResult) CommandLine(org.apache.reef.tang.formats.CommandLine) UnionRightSourceAddress(edu.snu.mist.examples.parameters.UnionRightSourceAddress) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder)

Aggregations

JavaConfigurationBuilder (org.apache.reef.tang.JavaConfigurationBuilder)18 CommandLine (org.apache.reef.tang.formats.CommandLine)18 APIQueryControlResult (edu.snu.mist.client.APIQueryControlResult)17 NettySourceAddress (edu.snu.mist.examples.parameters.NettySourceAddress)12 UnionRightSourceAddress (edu.snu.mist.examples.parameters.UnionRightSourceAddress)2 DriverRuntimeType (edu.snu.mist.core.parameters.DriverRuntimeType)1