Search in sources :

Example 1 with RoundRobinByZoneRule

use of com.mesosphere.sdk.offer.evaluate.placement.RoundRobinByZoneRule in project dcos-commons by mesosphere.

the class ZoneValidatorTest method getServiceSpec.

private static ServiceSpec getServiceSpec(boolean referenceZones) {
    PlacementRule zoneRule = new RoundRobinByZoneRule(3);
    PlacementRule hostRule = new HostnameRule(ExactMatcher.create("hostname"));
    PlacementRule rule = referenceZones ? zoneRule : hostRule;
    PodSpec podSpec = getPodSpec(getTaskSpec(Collections.emptyMap()));
    podSpec = DefaultPodSpec.newBuilder(podSpec).placementRule(rule).build();
    return getServiceSpec(podSpec);
}
Also used : RoundRobinByZoneRule(com.mesosphere.sdk.offer.evaluate.placement.RoundRobinByZoneRule) PlacementRule(com.mesosphere.sdk.offer.evaluate.placement.PlacementRule) HostnameRule(com.mesosphere.sdk.offer.evaluate.placement.HostnameRule)

Aggregations

HostnameRule (com.mesosphere.sdk.offer.evaluate.placement.HostnameRule)1 PlacementRule (com.mesosphere.sdk.offer.evaluate.placement.PlacementRule)1 RoundRobinByZoneRule (com.mesosphere.sdk.offer.evaluate.placement.RoundRobinByZoneRule)1