@Override public void onNext(final Throwable e) { LOG.log(Level.SEVERE, "Uncaught exception.", e); // TODO: This gets a new EventHandler each time an exception is caught. It would be better to cache the handler. But // that introduces threading issues and isn't really worth it, as the JVM typically will be killed once we catch an // Exception in here. if (!this.errorHandlerRID.equals(ErrorHandlerRID.NONE)) { final EventHandler<ReefServiceProtos.RuntimeErrorProto> runtimeErrorHandler = this.remoteManager.get() .getHandler(errorHandlerRID, ReefServiceProtos.RuntimeErrorProto.class); final ReefServiceProtos.RuntimeErrorProto message = ReefServiceProtos.RuntimeErrorProto.newBuilder() .setName("reef") .setIdentifier(launchID) .setMessage(e.getMessage()) .setException(ByteString.copyFrom(this.exceptionCodec.toBytes(e))) .build(); try { runtimeErrorHandler.onNext(message); } catch (final Throwable t) { LOG.log(Level.SEVERE, "Unable to send the error upstream", t); } } else { LOG.log(Level.SEVERE, "Caught an exception from Wake we cannot send upstream because there is no upstream"); } }
runtimeError_ = com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.getDefaultInstance(); } else { runtimeErrorBuilder_.clear();
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasName()) { hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); } if (hasMessage()) { hash = (37 * hash) + MESSAGE_FIELD_NUMBER; hash = (53 * hash) + getMessage().hashCode(); } if (hasException()) { hash = (37 * hash) + EXCEPTION_FIELD_NUMBER; hash = (53 * hash) + getException().hashCode(); } if (hasIdentifier()) { hash = (37 * hash) + IDENTIFIER_FIELD_NUMBER; hash = (53 * hash) + getIdentifier().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
if (hasRuntimeError()) { result = result && getRuntimeError() .equals(other.getRuntimeError());
if (hasError()) { result = result && getError() .equals(other.getError());
result = result && (hasName() == other.hasName()); if (hasName()) { result = result && getName() .equals(other.getName()); result = result && (hasMessage() == other.hasMessage()); if (hasMessage()) { result = result && getMessage() .equals(other.getMessage()); result = result && (hasException() == other.hasException()); if (hasException()) { result = result && getException() .equals(other.getException()); result = result && (hasIdentifier() == other.hasIdentifier()); if (hasIdentifier()) { result = result && getIdentifier() .equals(other.getIdentifier()); getUnknownFields().equals(other.getUnknownFields()); return result;
public com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto buildPartial() { com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto result = new com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.name_ = name_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.message_ = message_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.exception_ = exception_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.identifier_ = identifier_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * <code>optional .RuntimeErrorProto error = 3;</code> * * <pre> * runtime (e.g., YARN) error * </pre> */ public Builder mergeError(com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto value) { if (errorBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && error_ != com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.getDefaultInstance()) { error_ = com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.newBuilder(error_).mergeFrom(value).buildPartial(); } else { error_ = value; } onChanged(); } else { errorBuilder_.mergeFrom(value); } bitField0_ |= 0x00000004; 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()); }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getNameBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getMessageBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, exception_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, getIdentifierBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public Builder mergeFrom(com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto other) { if (other == com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; onChanged(); } if (other.hasMessage()) { bitField0_ |= 0x00000002; message_ = other.message_; onChanged(); } if (other.hasException()) { setException(other.getException()); } if (other.hasIdentifier()) { bitField0_ |= 0x00000008; identifier_ = other.identifier_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>optional .RuntimeErrorProto runtimeError = 3;</code> * * <pre> * Messages defined in reef_service_protos.proto * </pre> */ public Builder mergeRuntimeError(com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto value) { if (runtimeErrorBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && runtimeError_ != com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.getDefaultInstance()) { runtimeError_ = com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.newBuilder(runtimeError_).mergeFrom(value).buildPartial(); } else { runtimeError_ = value; } onChanged(); } else { runtimeErrorBuilder_.mergeFrom(value); } bitField0_ |= 0x00000004; return this; } /**
/** * <code>optional .RuntimeErrorProto error = 3;</code> * * <pre> * runtime (e.g., YARN) error * </pre> */ public Builder clearError() { if (errorBuilder_ == null) { error_ = com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.getDefaultInstance(); onChanged(); } else { errorBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); return this; } /**
public Builder clear() { super.clear(); name_ = ""; bitField0_ = (bitField0_ & ~0x00000001); state_ = com.microsoft.reef.proto.ReefServiceProtos.State.INIT; bitField0_ = (bitField0_ & ~0x00000002); if (errorBuilder_ == null) { error_ = com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.getDefaultInstance(); } else { errorBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); outstandingContainerRequests_ = 0; bitField0_ = (bitField0_ & ~0x00000008); containerAllocation_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000010); return this; }
/** * <code>optional .RuntimeErrorProto runtimeError = 3;</code> * * <pre> * Messages defined in reef_service_protos.proto * </pre> */ public Builder clearRuntimeError() { if (runtimeErrorBuilder_ == null) { runtimeError_ = com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto.getDefaultInstance(); onChanged(); } else { runtimeErrorBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); return this; } /**
public Builder toBuilder() { return newBuilder(this); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getNameBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getMessageBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, exception_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeBytes(5, getIdentifierBytes()); } getUnknownFields().writeTo(output); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.microsoft.reef.proto.ReefServiceProtos.RuntimeErrorProto prototype) {
/** * <code>required string name = 1;</code> * * <pre> * e.g., local, yarn21 * </pre> */ public Builder clearName() { bitField0_ = (bitField0_ & ~0x00000001); name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
/** * <code>optional string identifier = 5;</code> * * <pre> * e.g., evaluator id * </pre> */ public Builder clearIdentifier() { bitField0_ = (bitField0_ & ~0x00000008); identifier_ = getDefaultInstance().getIdentifier(); onChanged(); return this; } /**