@Override public Collection<String> getKeys(Protos.Offer offer) { if (offer.hasDomain() && offer.getDomain().hasFaultDomain()) { return Collections.singletonList(offer.getDomain().getFaultDomain().getRegion().getName()); } return Collections.emptyList(); }
@Override public Collection<String> getKeys(Protos.Offer offer) { if (offer.hasDomain() && offer.getDomain().hasFaultDomain()) { return Collections.singletonList(offer.getDomain().getFaultDomain().getRegion().getName()); } return Collections.emptyList(); }
@Override public Collection<String> getKeys(Protos.Offer offer) { if (offer.hasDomain() && offer.getDomain().hasFaultDomain()) { return Arrays.asList(offer.getDomain().getFaultDomain().getZone().getName()); } return Collections.emptyList(); }
Collection<Protos.TaskInfo> tasks) boolean regionPresent = offer.hasDomain() && offer.getDomain().hasFaultDomain(); if (!regionPresent) { return EvaluationOutcome.pass(
.setIndex(podInfoBuilder.getIndex()) .setHostname(offer); if (offer.hasDomain() && offer.getDomain().hasFaultDomain()) { writer.setRegion(offer.getDomain().getFaultDomain().getRegion()) .setZone(offer.getDomain().getFaultDomain().getZone());
private static void updateFaultDomainEnv(Protos.TaskInfo.Builder builder, Protos.Offer offer) { if (!offer.hasDomain() || !offer.getDomain().hasFaultDomain() || !builder.hasCommand()) { return; } Protos.Environment.Variable regionVar = Protos.Environment.Variable.newBuilder() .setName(EnvConstants.REGION_TASKENV) .setValue(offer.getDomain().getFaultDomain().getRegion().getName()) .build(); Protos.Environment.Variable zoneVar = Protos.Environment.Variable.newBuilder() .setName(EnvConstants.ZONE_TASKENV) .setValue(offer.getDomain().getFaultDomain().getZone().getName()) .build(); builder.getCommandBuilder() .getEnvironmentBuilder() .addVariables(regionVar) .addVariables(zoneVar); } }
@Override protected String getKey(Protos.Offer offer) { if (offer.hasDomain() && offer.getDomain().hasFaultDomain()) { return offer.getDomain().getFaultDomain().getRegion().getName(); } return null; }
@Override public Collection<String> getKeys(Protos.Offer offer) { if (offer.hasDomain() && offer.getDomain().hasFaultDomain()) { return Arrays.asList(offer.getDomain().getFaultDomain().getZone().getName()); } else { return Collections.emptyList(); } }
@Override public String getKey(Protos.Offer offer) { if (offer.hasDomain() && offer.getDomain().hasFaultDomain()) { return offer.getDomain().getFaultDomain().getZone().getName(); } return null; }
public static boolean hasZone(Protos.Offer offer) { if (!offer.hasDomain()) { return false; } Protos.DomainInfo domainInfo = offer.getDomain(); if (!domainInfo.hasFaultDomain()) { return false; } return domainInfo.getFaultDomain().hasZone(); }