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; }
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()); }
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); }
private static Builder create() { return new Builder(); }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto build() { com.microsoft.reef.proto.DriverRuntimeProtocol.RuntimeStatusProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
/** * 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()); }