Class WithFailures.ThrowableHandler<T>

All Implemented Interfaces:
Serializable, HasDisplayData, ProcessFunction<WithFailures.ExceptionElement<T>,KV<T,EncodableThrowable>>, SerializableFunction<WithFailures.ExceptionElement<T>,KV<T,EncodableThrowable>>
Enclosing class:
WithFailures

public static class WithFailures.ThrowableHandler<T> extends SimpleFunction<WithFailures.ExceptionElement<T>,KV<T,EncodableThrowable>>
A handler that holds onto the Throwable that led to the exception, returning it along with the original value as a KV.

Extends SimpleFunction so that full type information is captured. KV and EncodableThrowable coders can be easily inferred by Beam, so coder inference can be successfully applied if the consuming transform passes type information to the failure collection's TupleTag. This may require creating an instance of an anonymous inherited class rather than of this class directly.

See Also: