Package org.apache.mesos

Examples of org.apache.mesos.SchedulerDriver


    }

    @Override
    public synchronized void stop() {
      if (stateMachine.getState() == State.RUNNING) {
        SchedulerDriver driver = get(State.RUNNING);
        driver.stop(true /* failover */);
        stateMachine.transition(State.STOPPED);
      }
    }
View Full Code Here


      }
    }

    @Override
    public void killTask(String taskId) {
      SchedulerDriver driver = get(State.RUNNING);
      Protos.Status status = driver.killTask(Protos.TaskID.newBuilder().setValue(taskId).build());

      if (status != DRIVER_RUNNING) {
        LOG.severe(String.format("Attempt to kill task %s failed with code %s",
            taskId, status));
        killFailures.incrementAndGet();
View Full Code Here

            when(mock.getMaster()).thenReturn(Optional.<MasterInfo> absent());
            when(mock.start()).thenReturn(Status.DRIVER_RUNNING);
            when(mock.getLastOfferTimestamp()).thenReturn(Optional.<Long>absent());
            binder.bind(SingularityDriver.class).toInstance(mock);

            SchedulerDriver driver = mock(SchedulerDriver.class);

            when(driver.killTask(null)).thenReturn(Status.DRIVER_RUNNING);

            SchedulerDriverSupplier driverSupplier = new SchedulerDriverSupplier();
            driverSupplier.setSchedulerDriver(driver);

            binder.bind(SchedulerDriverSupplier.class).toInstance(driverSupplier);
View Full Code Here

    final long reconciliationStart = System.currentTimeMillis();
    final List<SingularityTaskId> activeTaskIds = taskManager.getActiveTaskIds();

    LOG.info("Starting a reconciliation cycle - {} current active tasks", activeTaskIds.size());

    SchedulerDriver driver = schedulerDriver.get();
    driver.reconcileTasks(Collections.<TaskStatus> emptyList());

    scheduleReconciliationCheck(driver, reconciliationStart, activeTaskIds, 0);

    return ReconciliationState.STARTED;
  }
View Full Code Here

      frameworkBuilder.setId(FrameworkID.newBuilder().setValue(frameworkId.get()));
    } else {
      LOG.warning("Did not find a persisted framework ID, connecting as a new framework.");
    }

    SchedulerDriver schedulerDriver = driverFactory.create(
        scheduler,
        driverSettings.getCredentials(),
        frameworkBuilder.build(),
        driverSettings.getMasterUri());
    Protos.Status status = schedulerDriver.start();
    LOG.info("Driver started with code " + status);

    driverFuture.set(schedulerDriver);
  }
View Full Code Here

TOP

Related Classes of org.apache.mesos.SchedulerDriver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.