Package org.apache.beam.sdk.values
Class EncodableThrowable
java.lang.Object
org.apache.beam.sdk.values.EncodableThrowable
- All Implemented Interfaces:
Serializable
A wrapper around a
Throwable
for use with coders.
Though Throwable
is serializable, it doesn't override Object.equals(Object)
,
which can lead to false positives in mutation detection for coders. This class provides a coder-
safe way to pass exceptions around without running into problems like log spam.
This class is not suitable for general-purpose equality comparison among Throwable
s
and should only be used to pass a Throwable
from one PTransform to another.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static EncodableThrowable
forThrowable
(Throwable throwable) Wrapsthrowable
and returns the result.int
hashCode()
Returns the underlyingThrowable
.