Search in sources :

Example 16 with PodInstance

use of com.mesosphere.sdk.specification.PodInstance in project dcos-commons by mesosphere.

the class CanaryStrategyTest method beforeAll.

@BeforeClass
public static void beforeAll() {
    for (int i = 0; i < 5; i++) {
        PodSpec podSpec = DefaultPodSpec.newBuilder("executor-uri").type("type" + i).count(1).tasks(Arrays.asList(TestPodFactory.getTaskSpec())).build();
        PodInstance podInstance = new DefaultPodInstance(podSpec, 0);
        PodInstanceRequirement podInstanceRequirement = PodInstanceRequirement.newBuilder(podInstance, Arrays.asList("task0")).build();
        podInstanceRequirements.add(podInstanceRequirement);
    }
}
Also used : PodSpec(com.mesosphere.sdk.specification.PodSpec) DefaultPodSpec(com.mesosphere.sdk.specification.DefaultPodSpec) PodInstance(com.mesosphere.sdk.specification.PodInstance) BeforeClass(org.junit.BeforeClass)

Aggregations

PodInstance (com.mesosphere.sdk.specification.PodInstance)16 DefaultPodInstance (com.mesosphere.sdk.scheduler.plan.DefaultPodInstance)10 PodSpec (com.mesosphere.sdk.specification.PodSpec)10 Test (org.junit.Test)10 DefaultPodSpec (com.mesosphere.sdk.specification.DefaultPodSpec)8 Protos (org.apache.mesos.Protos)7 PlacementRule (com.mesosphere.sdk.offer.evaluate.placement.PlacementRule)6 PodInstanceRequirement (com.mesosphere.sdk.scheduler.plan.PodInstanceRequirement)6 OfferRecommendation (com.mesosphere.sdk.offer.OfferRecommendation)4 TaskInfo (org.apache.mesos.Protos.TaskInfo)4 MesosResourcePool (com.mesosphere.sdk.offer.MesosResourcePool)2 SerialStrategy (com.mesosphere.sdk.scheduler.plan.strategy.SerialStrategy)2 Collectors (java.util.stream.Collectors)2 Before (org.junit.Before)2 TaskException (com.mesosphere.sdk.offer.TaskException)1 EvaluationOutcome (com.mesosphere.sdk.offer.evaluate.EvaluationOutcome)1 com.mesosphere.sdk.scheduler.plan (com.mesosphere.sdk.scheduler.plan)1 Strategy (com.mesosphere.sdk.scheduler.plan.strategy.Strategy)1 RecoveryPlanOverrider (com.mesosphere.sdk.scheduler.recovery.RecoveryPlanOverrider)1 RecoveryStep (com.mesosphere.sdk.scheduler.recovery.RecoveryStep)1