Search in sources :

Example 1 with DecommissionRecorder

use of com.mesosphere.sdk.scheduler.decommission.DecommissionRecorder in project dcos-commons by mesosphere.

the class DefaultScheduler method getOfferAccepter.

private static OfferAccepter getOfferAccepter(StateStore stateStore, ServiceSpec serviceSpec, PlanCoordinator planCoordinator) {
    List<OperationRecorder> recorders = new ArrayList<>();
    recorders.add(new PersistentLaunchRecorder(stateStore, serviceSpec));
    Optional<DecommissionPlanManager> decommissionManager = getDecomissionManager(planCoordinator);
    if (decommissionManager.isPresent()) {
        Collection<Step> steps = decommissionManager.get().getPlan().getChildren().stream().flatMap(phase -> phase.getChildren().stream()).collect(Collectors.toList());
        recorders.add(new DecommissionRecorder(stateStore, steps));
    }
    return new OfferAccepter(recorders);
}
Also used : OfferOutcomeTracker(com.mesosphere.sdk.offer.history.OfferOutcomeTracker) Protos(org.apache.mesos.Protos) java.util(java.util) com.mesosphere.sdk.offer(com.mesosphere.sdk.offer) Logger(org.slf4j.Logger) DecommissionRecorder(com.mesosphere.sdk.scheduler.decommission.DecommissionRecorder) OfferEvaluator(com.mesosphere.sdk.offer.evaluate.OfferEvaluator) ArtifactQueries(com.mesosphere.sdk.http.queries.ArtifactQueries) StringPropertyDeserializer(com.mesosphere.sdk.http.types.StringPropertyDeserializer) Collectors(java.util.stream.Collectors) PersisterException(com.mesosphere.sdk.storage.PersisterException) ServiceSpec(com.mesosphere.sdk.specification.ServiceSpec) Capabilities(com.mesosphere.sdk.dcos.Capabilities) TaskKiller(com.mesosphere.sdk.framework.TaskKiller) EndpointProducer(com.mesosphere.sdk.http.types.EndpointProducer) com.mesosphere.sdk.state(com.mesosphere.sdk.state) com.mesosphere.sdk.http.endpoints(com.mesosphere.sdk.http.endpoints) com.mesosphere.sdk.scheduler.plan(com.mesosphere.sdk.scheduler.plan) Persister(com.mesosphere.sdk.storage.Persister) VisibleForTesting(com.google.common.annotations.VisibleForTesting) FrameworkConfig(com.mesosphere.sdk.framework.FrameworkConfig) DecommissionRecorder(com.mesosphere.sdk.scheduler.decommission.DecommissionRecorder)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Capabilities (com.mesosphere.sdk.dcos.Capabilities)1 FrameworkConfig (com.mesosphere.sdk.framework.FrameworkConfig)1 TaskKiller (com.mesosphere.sdk.framework.TaskKiller)1 com.mesosphere.sdk.http.endpoints (com.mesosphere.sdk.http.endpoints)1 ArtifactQueries (com.mesosphere.sdk.http.queries.ArtifactQueries)1 EndpointProducer (com.mesosphere.sdk.http.types.EndpointProducer)1 StringPropertyDeserializer (com.mesosphere.sdk.http.types.StringPropertyDeserializer)1 com.mesosphere.sdk.offer (com.mesosphere.sdk.offer)1 OfferEvaluator (com.mesosphere.sdk.offer.evaluate.OfferEvaluator)1 OfferOutcomeTracker (com.mesosphere.sdk.offer.history.OfferOutcomeTracker)1 DecommissionRecorder (com.mesosphere.sdk.scheduler.decommission.DecommissionRecorder)1 com.mesosphere.sdk.scheduler.plan (com.mesosphere.sdk.scheduler.plan)1 ServiceSpec (com.mesosphere.sdk.specification.ServiceSpec)1 com.mesosphere.sdk.state (com.mesosphere.sdk.state)1 Persister (com.mesosphere.sdk.storage.Persister)1 PersisterException (com.mesosphere.sdk.storage.PersisterException)1 java.util (java.util)1 Collectors (java.util.stream.Collectors)1 Protos (org.apache.mesos.Protos)1