Search in sources :

Example 1 with MesosExecutorDriver

use of org.apache.mesos.MesosExecutorDriver in project storm-mesos by nathanmarz.

the class MesosSupervisor method prepare.

@Override
public void prepare(Map conf, String localDir) {
    try {
        _state = new LocalState(localDir);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    Semaphore initter = new Semaphore(0);
    _executor = new StormExecutor(initter);
    _driver = new MesosExecutorDriver(_executor);
    _driver.start();
    LOG.info("Waiting for executor to initialize...");
    try {
        initter.acquire();
    } catch (InterruptedException e) {
        throw new RuntimeException(e);
    }
    LOG.info("Executor initialized...");
    Thread suicide = new SuicideDetector(conf);
    suicide.setDaemon(true);
    suicide.start();
}
Also used : MesosExecutorDriver(org.apache.mesos.MesosExecutorDriver) LocalState(backtype.storm.utils.LocalState) IOException(java.io.IOException) Semaphore(java.util.concurrent.Semaphore)

Example 2 with MesosExecutorDriver

use of org.apache.mesos.MesosExecutorDriver in project alluxio by Alluxio.

the class AlluxioMasterExecutor method main.

/**
   * Starts the Alluxio master executor.
   *
   * @param args command-line arguments
   * @throws Exception if the executor encounters an unrecoverable error
   */
public static void main(String[] args) throws Exception {
    MesosExecutorDriver driver = new MesosExecutorDriver(new AlluxioMasterExecutor());
    System.exit(driver.run() == Protos.Status.DRIVER_STOPPED ? 0 : 1);
}
Also used : MesosExecutorDriver(org.apache.mesos.MesosExecutorDriver)

Example 3 with MesosExecutorDriver

use of org.apache.mesos.MesosExecutorDriver in project elastic-job by dangdangdotcom.

the class JobBootstrap method execute.

/**
     * 执行作业.
     */
public static void execute() {
    MesosExecutorDriver driver = new MesosExecutorDriver(new TaskExecutor());
    System.exit(Protos.Status.DRIVER_STOPPED == driver.run() ? 0 : -1);
}
Also used : TaskExecutor(com.dangdang.ddframe.job.cloud.executor.TaskExecutor) MesosExecutorDriver(org.apache.mesos.MesosExecutorDriver)

Example 4 with MesosExecutorDriver

use of org.apache.mesos.MesosExecutorDriver in project cassandra-mesos-deprecated by mesosphere.

the class CassandraExecutor method main.

public static void main(final String[] args) {
    final MesosExecutorDriver driver = new MesosExecutorDriver(new CassandraExecutor(new ProdObjectFactory()));
    final int status;
    switch(driver.run()) {
        case DRIVER_STOPPED:
            status = 0;
            break;
        case DRIVER_ABORTED:
            status = 1;
            break;
        case DRIVER_NOT_STARTED:
            status = 2;
            break;
        default:
            status = 3;
            break;
    }
    driver.stop();
    System.exit(status);
}
Also used : MesosExecutorDriver(org.apache.mesos.MesosExecutorDriver)

Example 5 with MesosExecutorDriver

use of org.apache.mesos.MesosExecutorDriver in project alluxio by Alluxio.

the class AlluxioWorkerExecutor method main.

/**
   * Starts the Alluxio worker executor.
   *
   * @param args command-line arguments
   * @throws Exception if the executor encounters an unrecoverable error
   */
public static void main(String[] args) throws Exception {
    MesosExecutorDriver driver = new MesosExecutorDriver(new AlluxioWorkerExecutor());
    System.exit(driver.run() == Protos.Status.DRIVER_STOPPED ? 0 : 1);
}
Also used : MesosExecutorDriver(org.apache.mesos.MesosExecutorDriver)

Aggregations

MesosExecutorDriver (org.apache.mesos.MesosExecutorDriver)5 LocalState (backtype.storm.utils.LocalState)1 TaskExecutor (com.dangdang.ddframe.job.cloud.executor.TaskExecutor)1 IOException (java.io.IOException)1 Semaphore (java.util.concurrent.Semaphore)1