@InterfaceAudience.Private public class RemoteProcedureException extends ProcedureException
RemoteProcedureExceptions are sent to 'remote' peers to signal an abort in the face of failures. When serialized for transmission we encode using Protobufs to ensure version compatibility.
RemoteProcedureException exceptions contain a Throwable as its cause. This can be a "regular" exception generated locally or a ProxyThrowable that is a representation of the original exception created on original 'remote' source. These ProxyThrowables have their their stacks traces and messages overridden to reflect the original 'remote' exception.
Constructor and Description |
---|
RemoteProcedureException(String source,
Throwable cause)
Create a new RemoteProcedureException that can be serialized.
|
Modifier and Type | Method and Description |
---|---|
ErrorHandlingProtos.ForeignExceptionMessage |
convert() |
static RemoteProcedureException |
deserialize(byte[] bytes)
Takes a series of bytes and tries to generate an RemoteProcedureException instance for it.
|
static RemoteProcedureException |
fromProto(ErrorHandlingProtos.ForeignExceptionMessage eem) |
String |
getSource() |
static byte[] |
serialize(String source,
Throwable t)
Converts a RemoteProcedureException to an array of bytes.
|
static ErrorHandlingProtos.ForeignExceptionMessage |
toProto(String source,
Throwable t) |
String |
toString() |
Exception |
unwrapRemoteException() |
IOException |
unwrapRemoteIOException() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public String getSource()
public Exception unwrapRemoteException()
public IOException unwrapRemoteIOException()
public static byte[] serialize(String source, Throwable t)
source
- the name of the external exception sourcet
- the "local" external exception (local)public static RemoteProcedureException deserialize(byte[] bytes) throws IOException
bytes
- InvalidProtocolBufferException
- if there was deserialization problem this is thrown.IOException
public ErrorHandlingProtos.ForeignExceptionMessage convert()
public static ErrorHandlingProtos.ForeignExceptionMessage toProto(String source, Throwable t)
public static RemoteProcedureException fromProto(ErrorHandlingProtos.ForeignExceptionMessage eem)
Copyright © 2007–2019 Cloudera. All rights reserved.