use of org.apache.mesos.Protos.Status in project incubator-myriad by apache.
the class MyriadDriver method stop.
/**
* Stops the underlying Mesos SchedulerDriver. If the failover flag is set to
* false, Myriad will not reconnect to Mesos. Consequently, Mesos will unregister
* the Myriad framework and shutdown all the Myriad tasks and executors. If failover
* is set to true, all Myriad executors and tasks will remain running for a defined
* period of time, allowing the MyriadScheduler to reconnect to Mesos.
*
* @param failover Whether framework failover is expected.
*
* @return The state of the driver after the call.
*
* @see Status
*/
public Status stop(boolean failover) {
LOGGER.info("Stopping driver");
Status status = driver.stop(failover);
LOGGER.info("Driver stopped with status: {}", status);
return status;
}
use of org.apache.mesos.Protos.Status in project incubator-myriad by apache.
the class MyriadDriver method abort.
/**
* Aborts the underlying Mesos SchedulerDriver so that no more callbacks
* can be made to the MyriadScheduler. Note from Mesos documentation:
* The semantics of abort and stop have deliberately been separated so that
* code can detect an aborted driver and instantiate and start another driver
* if desired (from within the same process).
*
* @return The state of the driver after the call.
*
* @see Status
*/
public Status abort() {
LOGGER.info("Aborting driver");
Status status = driver.abort();
LOGGER.info("Aborted driver with status: {}", status);
return status;
}
use of org.apache.mesos.Protos.Status in project incubator-myriad by apache.
the class MyriadDriver method kill.
/**
* Kills the specified task via the underlying Mesos SchedulerDriver.
* Important note from the Mesos documentation: "attempting to kill a
* task is currently not reliable. If, for example, a scheduler fails over
* while it was attempting to kill a task it will need to retry in
* the future Likewise, if unregistered / disconnected, the request
* will be dropped (these semantics may be changed in the future)."
*
* @param taskId The ID of the task to be killed.
*
* @return The state of the driver after the call.
*
* @see Status
*/
public Status kill(final TaskID taskId) {
Status status = driver.killTask(taskId);
LOGGER.info("Task {} kill initiated with Driver status {}", taskId, status);
return status;
}
use of org.apache.mesos.Protos.Status in project incubator-myriad by apache.
the class MyriadDriverTest method testAbort.
@Test
public void testAbort() throws Exception {
MyriadDriver driver = new MyriadDriver(new MockSchedulerDriver());
Status status = driver.abort();
assertEquals(Protos.Status.DRIVER_ABORTED_VALUE, status.getNumber());
}
use of org.apache.mesos.Protos.Status in project incubator-myriad by apache.
the class MyriadDriverTest method testStart.
@Test
public void testStart() throws Exception {
MyriadDriver driver = new MyriadDriver(new MockSchedulerDriver());
Status status = driver.start();
assertEquals(Protos.Status.DRIVER_RUNNING_VALUE, status.getNumber());
}
Aggregations