protected Offer createOffer(double cpus, double memory, double disk, String slave, String host, Optional<String> rack, Map<String, String> attributes, String[] portRanges, Optional<String> role) { AgentID slaveId = AgentID.newBuilder().setValue(slave).build(); FrameworkID frameworkId = FrameworkID.newBuilder().setValue("framework1").build();
void slaveLost(AgentID slaveIdObj) { final String slaveId = slaveIdObj.getValue(); Optional<SingularitySlave> slave = slaveManager.getObject(slaveId); if (slave.isPresent()) { MachineState previousState = slave.get().getCurrentState().getState(); slaveManager.changeState(slave.get(), MachineState.DEAD, Optional.absent(), Optional.absent()); if (configuration.getDisasterDetection().isEnabled()) { updateDisasterCounter(previousState); } checkRackAfterSlaveLoss(slave.get()); } else { LOG.warn("Lost a slave {}, but didn't know about it", slaveId); } }
/** * <code>required .mesos.v1.AgentID agent_id = 1;</code> */ public org.apache.mesos.v1.Protos.AgentIDOrBuilder getAgentIdOrBuilder() { if (agentIdBuilder_ != null) { return agentIdBuilder_.getMessageOrBuilder(); } else { return agentId_ == null ? org.apache.mesos.v1.Protos.AgentID.getDefaultInstance() : agentId_; } } /**
.collect(Collectors.groupingBy((o) -> o.getAgentId().getValue())) .entrySet().stream() .filter((e) -> e.getValue().size() > 0)
LOG.debug("Received offer ID {} with roles {} from {} ({}) for {} cpu(s), {} memory, {} ports, and {} disk", offer.getId().getValue(), rolesInfo, offer.getHostname(), offer.getAgentId().getValue(), MesosUtils.getNumCpus(offer), MesosUtils.getMemory(offer), MesosUtils.getNumPorts(offer), MesosUtils.getDisk(offer));
.map(event -> event.getUpdate().getStatus()) .filter(status -> { if (!status.hasAgentId() || !status.getAgentId().hasValue()) { LOG.warn("Filtering out status update without agentId {}", status); return false;
if (hasAgentId()) { result = result && getAgentId() .equals(other.getAgentId());
protected Offer createOffer(double cpus, double memory, double disk, String slave, String host, Optional<String> rack, Map<String, String> attributes, String[] portRanges, Optional<String> role) { AgentID slaveId = AgentID.newBuilder().setValue(slave).build(); FrameworkID frameworkId = FrameworkID.newBuilder().setValue("framework1").build();
) { return update( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), org.apache.mesos.v1.Protos.TaskID.newBuilder().setValue(taskId).build(),
if (!getAgentId().isInitialized()) { memoizedIsInitialized = 0; return false;
fakeTaskStatusBuilder.setAgentId(AgentID.newBuilder().setValue(taskStatusHolder.getSlaveId().get()));
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.mesos.v1.scheduler.Protos.Call.Message)) { return super.equals(obj); } org.apache.mesos.v1.scheduler.Protos.Call.Message other = (org.apache.mesos.v1.scheduler.Protos.Call.Message) obj; boolean result = true; result = result && (hasAgentId() == other.hasAgentId()); if (hasAgentId()) { result = result && getAgentId() .equals(other.getAgentId()); } result = result && (hasExecutorId() == other.hasExecutorId()); if (hasExecutorId()) { result = result && getExecutorId() .equals(other.getExecutorId()); } result = result && (hasData() == other.hasData()); if (hasData()) { result = result && getData() .equals(other.getData()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.mesos.v1.scheduler.Protos.Event.Message)) { return super.equals(obj); } org.apache.mesos.v1.scheduler.Protos.Event.Message other = (org.apache.mesos.v1.scheduler.Protos.Event.Message) obj; boolean result = true; result = result && (hasAgentId() == other.hasAgentId()); if (hasAgentId()) { result = result && getAgentId() .equals(other.getAgentId()); } result = result && (hasExecutorId() == other.hasExecutorId()); if (hasExecutorId()) { result = result && getExecutorId() .equals(other.getExecutorId()); } result = result && (hasData() == other.hasData()); if (hasData()) { result = result && getData() .equals(other.getData()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * Utility method to more succinctly construct an {@link Protos.Event Event} of type * {@link Protos.Event.Type#MESSAGE MESSAGE}. * * @param agentId The {@link org.apache.mesos.v1.Protos.AgentID#getValue() value} of the * {@link Protos.Event.Message#getAgentId() agentId} to be set on the * {@link Protos.Event.Message Message}. * @param executorId The {@link org.apache.mesos.v1.Protos.ExecutorID#getValue() value} of the * {@link Protos.Event.Message#getExecutorId() executorId} to be set on the * {@link Protos.Event.Message Message}. * @param data The {@link Protos.Event.Message#getData() data} to be set on the * {@link Protos.Event.Message Message}. * @return A {@link Protos.Call Call} with a configured {@link Protos.Call.Acknowledge Acknowledge}. */ @NotNull public static Protos.Event message( @NotNull final String agentId, @NotNull final String executorId, @NotNull final ByteString data ) { return message( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), data ); }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasOperationId()) { memoizedIsInitialized = 0; return false; } if (!getOperationId().isInitialized()) { memoizedIsInitialized = 0; return false; } if (hasAgentId()) { if (!getAgentId().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasResourceProviderId()) { if (!getResourceProviderId().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasTaskId()) { memoizedIsInitialized = 0; return false; } if (!getTaskId().isInitialized()) { memoizedIsInitialized = 0; return false; } if (hasAgentId()) { if (!getAgentId().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasKillPolicy()) { if (!getKillPolicy().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasAgentId()) { hash = (37 * hash) + AGENT_ID_FIELD_NUMBER; hash = (53 * hash) + getAgentId().hashCode(); } if (hasResourceProviderId()) { hash = (37 * hash) + RESOURCE_PROVIDER_ID_FIELD_NUMBER; hash = (53 * hash) + getResourceProviderId().hashCode(); } if (hasUuid()) { hash = (37 * hash) + UUID_FIELD_NUMBER; hash = (53 * hash) + getUuid().hashCode(); } if (hasOperationId()) { hash = (37 * hash) + OPERATION_ID_FIELD_NUMBER; hash = (53 * hash) + getOperationId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
) { return update( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), org.apache.mesos.v1.Protos.TaskID.newBuilder().setValue(taskId).build(),
.setAgentId(AgentID.newBuilder().setValue("1")) .setId(OfferID.newBuilder().setValue("1")) .setFrameworkId(FrameworkID.newBuilder().setValue("1")) 1, "DEFAULT", offer.getAgentId().getValue(), offer.getHostname(), Collections.emptyMap(),
/** * Utility method to more succinctly construct an {@link Protos.Event Event} of type * {@link Protos.Event.Type#MESSAGE MESSAGE}. * * @param agentId The {@link org.apache.mesos.v1.Protos.AgentID#getValue() value} of the * {@link Protos.Event.Message#getAgentId() agentId} to be set on the * {@link Protos.Event.Message Message}. * @param executorId The {@link org.apache.mesos.v1.Protos.ExecutorID#getValue() value} of the * {@link Protos.Event.Message#getExecutorId() executorId} to be set on the * {@link Protos.Event.Message Message}. * @param data The {@link Protos.Event.Message#getData() data} to be set on the * {@link Protos.Event.Message Message}. * @return A {@link Protos.Call Call} with a configured {@link Protos.Call.Acknowledge Acknowledge}. */ @NotNull public static Protos.Event message( @NotNull final String agentId, @NotNull final String executorId, @NotNull final ByteString data ) { return message( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), data ); }