Abstract interface for connecting a scheduler to Mesos. This interface is used both to manage the scheduler's lifecycle (start it, stop it, or wait for it to finish) and to interact with Mesos (e.g., launch tasks, kill tasks, etc.).
| 33 | * (e.g., launch tasks, kill tasks, etc.). |
| 34 | */ |
| 35 | public interface SchedulerDriver { |
| 36 | /** |
| 37 | * Starts the scheduler driver. This needs to be called before any |
| 38 | * other driver calls are made. |
| 39 | * |
| 40 | * @return The state of the driver after the call. |
| 41 | * |
| 42 | * @see Status |
| 43 | */ |
| 44 | Status start(); |
| 45 | |
| 46 | /** |
| 47 | * Stops the scheduler driver. If the 'failover' flag is set to |
| 48 | * false then it is expected that this framework will never |
| 49 | * reconnect to Mesos. So Mesos will unregister the framework |
| 50 | * and shutdown all its tasks and executors. If 'failover' is true, |
| 51 | * all executors and tasks will remain running (for some framework |
| 52 | * specific failover timeout) allowing the scheduler to reconnect |
| 53 | * (possibly in the same process, or from a different process, for |
| 54 | * example, on a different machine). |
| 55 | * |
| 56 | * @param failover Whether framework failover is expected. |
| 57 | * |
| 58 | * @return The state of the driver after the call. |
| 59 | * |
| 60 | * @see Status |
| 61 | */ |
| 62 | Status stop(boolean failover); |
| 63 | |
| 64 | /** |
| 65 | * Stops the scheduler driver assuming no failover. This will |
| 66 | * cause Mesos to unregister the framework and shutdown all |
| 67 | * its tasks and executors. Please see {@link #stop(boolean)} |
| 68 | * for more details. |
| 69 | * |
| 70 | * @return The state of the driver after the call. |
| 71 | */ |
| 72 | Status stop(); |
| 73 | |
| 74 | /** |
| 75 | * Aborts the driver so that no more callbacks can be made to the |
| 76 | * scheduler. The semantics of abort and stop have deliberately been |
| 77 | * separated so that code can detect an aborted driver (i.e., via |
| 78 | * the return status of {@link #join}, see below), and instantiate |
| 79 | * and start another driver if desired (from within the same |
| 80 | * process). |
| 81 | * |
| 82 | * @return The state of the driver after the call. |
| 83 | */ |
| 84 | Status abort(); |
| 85 | |
| 86 | /** |
| 87 | * Waits for the driver to be stopped or aborted, possibly |
| 88 | * <i>blocking</i> the current thread indefinitely. The return status of |
| 89 | * this function can be used to determine if the driver was aborted |
| 90 | * (see mesos.proto for a description of Status). |
| 91 | * |
| 92 | * @return The state of the driver after the call. |
no outgoing calls
no test coverage detected