private void onRuntimeError(final Throwable throwable) { // SHUTDOWN YARN try { this.reefEventHandlers.close(); this.resourceManager.unregisterApplicationMaster( FinalApplicationStatus.FAILED, throwable.getMessage(), null); } catch (final Exception e) { LOG.log(Level.WARNING, "Error shutting down YARN application", e); } finally { this.resourceManager.stop(); } final RuntimeStatusProto.Builder runtimeStatusBuilder = RuntimeStatusProto.newBuilder() .setState(ReefServiceProtos.State.FAILED) .setName(RUNTIME_NAME); final Encoder<Throwable> codec = new ObjectSerializableCodec<>(); runtimeStatusBuilder.setError(ReefServiceProtos.RuntimeErrorProto.newBuilder() .setName(RUNTIME_NAME) .setMessage(throwable.getMessage()) .setException(ByteString.copyFrom(codec.encode(throwable))) .build()) .build(); this.reefEventHandlers.onRuntimeStatus(runtimeStatusBuilder.build()); }
hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasName()) { hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().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(); if (hasOutstandingContainerRequests()) { hash = (37 * hash) + OUTSTANDING_CONTAINER_REQUESTS_FIELD_NUMBER; hash = (53 * hash) + getOutstandingContainerRequests(); if (getContainerAllocationCount() > 0) { hash = (37 * hash) + CONTAINER_ALLOCATION_FIELD_NUMBER; hash = (53 * hash) + getContainerAllocationList().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash;
public com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto buildPartial() { com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto result = new com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getNameBytes()); size += 1 * getContainerAllocationList().size(); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
result = result && (hasName() == other.hasName()); if (hasName()) { result = result && getName() .equals(other.getName()); 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 && (hasOutstandingContainerRequests() == other.hasOutstandingContainerRequests()); if (hasOutstandingContainerRequests()) { result = result && (getOutstandingContainerRequests() == other.getOutstandingContainerRequests()); result = result && getContainerAllocationList() .equals(other.getContainerAllocationList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result;
public Builder mergeFrom(com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto other) { if (other == com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; onChanged(); } if (other.hasState()) { setState(other.getState()); } if (other.hasError()) { mergeError(other.getError()); } if (other.hasOutstandingContainerRequests()) { setOutstandingContainerRequests(other.getOutstandingContainerRequests()); } if (!other.containerAllocation_.isEmpty()) { if (containerAllocation_.isEmpty()) { containerAllocation_ = other.containerAllocation_; bitField0_ = (bitField0_ & ~0x00000010); } else { ensureContainerAllocationIsMutable(); containerAllocation_.addAll(other.containerAllocation_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
@Override public synchronized void onNext(final DriverRuntimeProtocol.RuntimeStatusProto runtimeStatusProto) { final ReefServiceProtos.State newState = runtimeStatusProto.getState(); LOG.log(Level.FINEST, "Runtime status " + runtimeStatusProto); this.outstandingContainerRequests = runtimeStatusProto.getOutstandingContainerRequests(); this.containerAllocationCount = runtimeStatusProto.getContainerAllocationCount(); this.setState(runtimeStatusProto.getState()); switch (newState) { case FAILED: this.onRMFailure(runtimeStatusProto); break; case DONE: this.onRMDone(runtimeStatusProto); break; case RUNNING: this.onRMRunning(runtimeStatusProto); break; } }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasName()) { memoizedIsInitialized = 0; return false; } if (!hasState()) { memoizedIsInitialized = 0; return false; } if (hasError()) { if (!getError().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto prototype) {
public Builder toBuilder() { return newBuilder(this); }
public static Builder newBuilder(com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto getDefaultInstanceForType() { return com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto.getDefaultInstance(); }
/** * <code>required string name = 1;</code> * * <pre> * e.g., local, yarn21 * </pre> */ public Builder clearName() { bitField0_ = (bitField0_ & ~0x00000001); name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
/** * Update the driver with my current status */ private void updateRuntimeStatus() { final DriverRuntimeProtocol.RuntimeStatusProto.Builder builder = DriverRuntimeProtocol.RuntimeStatusProto.newBuilder() .setName(RUNTIME_NAME) .setState(ReefServiceProtos.State.RUNNING) .setOutstandingContainerRequests(this.containerRequestCounter.get()); for (final String allocatedContainerId : this.containers.getContainerIds()) { builder.addContainerAllocation(allocatedContainerId); } this.reefEventHandlers.onRuntimeStatus(builder.build()); }
@Override public void onShutdownRequest() { this.reefEventHandlers.onRuntimeStatus(RuntimeStatusProto.newBuilder() .setName(RUNTIME_NAME).setState(ReefServiceProtos.State.DONE).build()); this.driverStatusManager.onError(new Exception("Shutdown requested by YARN.")); }
private void sendRuntimeStatus() { final DriverRuntimeProtocol.RuntimeStatusProto msg = DriverRuntimeProtocol.RuntimeStatusProto.newBuilder() .setName("LOCAL") .setState(ReefServiceProtos.State.RUNNING) .setOutstandingContainerRequests(this.requestQueue.getNumberOfOutstandingRequests()) .addAllContainerAllocation(this.theContainers.getAllocatedContainerIDs()) .build(); LOG.log(Level.INFO, "Allocated: {0}, Outstanding requests: {1}", new Object[]{msg.getContainerAllocationCount(), msg.getOutstandingContainerRequests()}); this.runtimeStatusHandlerEventHandler.onNext(msg); }