use of org.apache.reef.client.LauncherStatus in project mist by snuspl.
the class MistLauncher method runFromConf.
/**
* Run the Mist Driver for the given Configuration.
* @param driverConf The Configuration for the driver
* @return a status of the driver
* @throws InjectionException on configuration errors
*/
public LauncherStatus runFromConf(final Configuration driverConf) throws InjectionException {
final DriverLauncher launcher = DriverLauncher.getLauncher(mistRuntimeConf);
final Configuration mistDriverConf = getDriverConfiguration(driverConf);
final LauncherStatus status = timeOut == 0 ? launcher.run(mistDriverConf) : launcher.run(mistDriverConf, timeOut);
LOG.log(Level.INFO, "Mist completed: {0}", status);
return status;
}
use of org.apache.reef.client.LauncherStatus in project mist by snuspl.
the class Mist method main.
/**
* Start Mist Driver.
* @param args command line parameters.
*/
public static void main(final String[] args) throws Exception {
final Configuration commandLineConf = getCommandLineConf(args);
final Injector injector = Tang.Factory.getTang().newInjector(commandLineConf);
final int mem = injector.getNamedInstance(DriverMemorySize.class);
if (commandLineConf == null) {
return;
}
final LauncherStatus status = MistLauncher.getLauncherFromConf(commandLineConf).runFromConf(commandLineConf);
LOG.log(Level.INFO, "Mist completed: {0}", status);
}
use of org.apache.reef.client.LauncherStatus in project mist by snuspl.
the class MistLauncherTest method testMistLauncher.
/**
* Test for MistLauncher.
* @throws InjectionException
*/
@Test
public void testMistLauncher() throws InjectionException {
final LauncherStatus status = MistLauncher.getLauncher(MistLauncher.RuntimeType.LOCAL).setTimeout(4000).run(2, 4, 1, 256, 1, 256);
Assert.assertEquals(LauncherStatus.FORCE_CLOSED, status);
}
use of org.apache.reef.client.LauncherStatus in project mist by snuspl.
the class MistDriverTest method launchDriverTestHelper.
/**
* Test whether MistDriver runs MistTaks successfully.
* @throws InjectionException
*/
public void launchDriverTestHelper(final int clientToTaskPort) throws InjectionException {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
jcb.bindNamedParameter(DriverRuntimeType.class, "LOCAL");
jcb.bindNamedParameter(NumTaskCores.class, "1");
jcb.bindNamedParameter(DefaultNumEventProcessors.class, "1");
jcb.bindNamedParameter(TaskMemorySize.class, "256");
jcb.bindNamedParameter(NumMasterCores.class, "1");
jcb.bindNamedParameter(MasterMemorySize.class, "256");
jcb.bindNamedParameter(ClientToTaskPort.class, Integer.toString(clientToTaskPort));
final Configuration runtimeConf = LocalRuntimeConfiguration.CONF.build();
final Configuration driverConf = MistLauncher.getDriverConfiguration(jcb.build());
final LauncherStatus state = TestLauncher.run(runtimeConf, driverConf, 5000);
final Optional<Throwable> err = state.getError();
System.out.println("Job state after execution: " + state);
System.out.println("Error: " + err.get());
Assert.assertFalse(err.isPresent());
}
use of org.apache.reef.client.LauncherStatus in project mist by snuspl.
the class MistDriverTest method launchDriverTestHelper.
/**
* Test whether MistDriver runs MistTaks successfully.
* @throws InjectionException
*/
public void launchDriverTestHelper() throws InjectionException {
final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
jcb.bindNamedParameter(DriverRuntimeType.class, "LOCAL");
jcb.bindNamedParameter(NumTaskCores.class, "1");
jcb.bindNamedParameter(DefaultNumEventProcessors.class, "1");
jcb.bindNamedParameter(TaskMemorySize.class, "256");
jcb.bindNamedParameter(NumMasterCores.class, "1");
jcb.bindNamedParameter(MasterMemorySize.class, "256");
final Configuration runtimeConf = LocalRuntimeConfiguration.CONF.build();
final Configuration driverConf = MistLauncher.getDriverConfiguration(jcb.build());
final LauncherStatus state = TestLauncher.run(runtimeConf, driverConf, 4000);
final Optional<Throwable> err = state.getError();
System.out.println("Job state after execution: " + state);
System.out.println("Error: " + err.get());
Assert.assertFalse(err.isPresent());
}
Aggregations