@Override public void onNext(final RemoteMessage<EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto> evaluatorHeartbeatMessage) { final EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto heartbeat = evaluatorHeartbeatMessage.getMessage(); final ReefServiceProtos.EvaluatorStatusProto status = heartbeat.getEvaluatorStatus(); final String evaluatorId = status.getEvaluatorId(); LOG.log(Level.FINEST, "TIME: Begin Heartbeat {0}", evaluatorId); LOG.log(Level.FINEST, "Heartbeat from Evaluator {0} with state {1} timestamp {2} from remoteId {3}", new Object[]{evaluatorId, status.getState(), heartbeat.getTimestamp(), evaluatorHeartbeatMessage.getIdentifier()}); final Optional<EvaluatorManager> evaluatorManager = this.evaluators.get(evaluatorId); if (evaluatorManager.isPresent()) { evaluatorManager.get().onEvaluatorHeartbeatMessage(evaluatorHeartbeatMessage); } else { final StringBuilder message = new StringBuilder("Contact from unknown Evaluator with identifier '"); message.append(evaluatorId); if (heartbeat.hasEvaluatorStatus()) { message.append("' with state '"); message.append(status.getState()); } message.append('\''); throw new RuntimeException(message.toString()); } LOG.log(Level.FINEST, "TIME: End Heartbeat {0}", evaluatorId); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasEvaluatorId()) { hash = (37 * hash) + EVALUATOR_ID_FIELD_NUMBER; hash = (53 * hash) + getEvaluatorId().hashCode(); } if (hasState()) { hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + hashEnum(getState()); } if (hasError()) { hash = (37 * hash) + ERROR_FIELD_NUMBER; hash = (53 * hash) + getError().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.microsoft.reef.proto.ReefServiceProtos.EvaluatorStatusProto)) { return super.equals(obj); } com.microsoft.reef.proto.ReefServiceProtos.EvaluatorStatusProto other = (com.microsoft.reef.proto.ReefServiceProtos.EvaluatorStatusProto) obj; boolean result = true; result = result && (hasEvaluatorId() == other.hasEvaluatorId()); if (hasEvaluatorId()) { result = result && getEvaluatorId() .equals(other.getEvaluatorId()); } result = result && (hasState() == other.hasState()); if (hasState()) { result = result && (getState() == other.getState()); } result = result && (hasError() == other.hasError()); if (hasError()) { result = result && getError() .equals(other.getError()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
/** * <code>required string evaluator_id = 1;</code> */ public Builder clearEvaluatorId() { bitField0_ = (bitField0_ & ~0x00000001); evaluatorId_ = getDefaultInstance().getEvaluatorId(); onChanged(); return this; } /**