use of org.apache.reef.tang.JavaConfigurationBuilder in project mist by snuspl.
the class WindowAndAggregate 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.JavaConfigurationBuilder in project mist by snuspl.
the class RuleBasedMQTTHelloMist 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.JavaConfigurationBuilder in project mist by snuspl.
the class MistTaskConfigs method getConfiguration.
/**
* Get the task configuration.
* @return configuration
*/
public Configuration getConfiguration() {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
// Parameter
jcb.bindNamedParameter(DefaultNumEventProcessors.class, Integer.toString(numEventProcessors));
jcb.bindNamedParameter(MqttSourceKeepAliveSec.class, Integer.toString(mqttSourceKeepAliveSec));
jcb.bindNamedParameter(MqttSinkKeepAliveSec.class, Integer.toString(mqttSinkKeepAliveSec));
jcb.bindNamedParameter(MqttSourceClientNumPerBroker.class, Integer.toString(mqttSourceClientNumPerBroker));
jcb.bindNamedParameter(MqttSinkClientNumPerBroker.class, Integer.toString(mqttSinkClientNumPerBroker));
jcb.bindNamedParameter(GroupRebalancingPeriod.class, Long.toString(rebalancingPeriod));
jcb.bindNamedParameter(ProcessingTimeout.class, Long.toString(processingTimeout));
jcb.bindNamedParameter(GroupPinningTime.class, Long.toString(groupPinningTime));
jcb.bindNamedParameter(PeriodicCheckpointPeriod.class, Long.toString(checkpointPeriod));
jcb.bindNamedParameter(RecoveryThreadsNum.class, Integer.toString(recoveryThreadsNum));
// Implementation
jcb.bindImplementation(ClientToTaskMessage.class, DefaultClientToTaskMessageImpl.class);
jcb.bindImplementation(MasterToTaskMessage.class, DefaultMasterToTaskMessageImpl.class);
return jcb.build();
}
use of org.apache.reef.tang.JavaConfigurationBuilder in project mist by snuspl.
the class PhysicalObjectGeneratorTest method setUp.
@Before
public void setUp() throws InjectionException {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
jcb.bindNamedParameter(TaskHostname.class, "127.0.0.1");
final Injector injector = Tang.Factory.getTang().newInjector(jcb.build());
generator = injector.getInstance(PhysicalObjectGenerator.class);
}
use of org.apache.reef.tang.JavaConfigurationBuilder in project mist by snuspl.
the class MQTTSourceTest method setUp.
@Before
public void setUp() throws InjectionException, IOException {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
jcb.bindNamedParameter(TaskHostname.class, "127.0.0.1");
final Injector injector = Tang.Factory.getTang().newInjector(jcb.build());
mqttSharedResource = injector.getInstance(MQTTSharedResource.class);
// create local mqtt broker
mqttBroker = MqttUtils.createMqttBroker();
}
Aggregations