Package org.apache.beam.sdk.transforms
Class WithFailures.ThrowableHandler<T>
java.lang.Object
org.apache.beam.sdk.transforms.InferableFunction<WithFailures.ExceptionElement<T>,KV<T,EncodableThrowable>>
org.apache.beam.sdk.transforms.SimpleFunction<WithFailures.ExceptionElement<T>,KV<T,EncodableThrowable>>
org.apache.beam.sdk.transforms.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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the result of invoking this function on the given input.Methods inherited from class org.apache.beam.sdk.transforms.SimpleFunction
fromSerializableFunctionWithOutputTypeMethods inherited from class org.apache.beam.sdk.transforms.InferableFunction
fromProcessFunctionWithOutputType, getInputTypeDescriptor, getOutputTypeDescriptor, populateDisplayData
-
Constructor Details
-
ThrowableHandler
public ThrowableHandler()
-
-
Method Details
-
apply
Description copied from interface:ProcessFunctionReturns the result of invoking this function on the given input.- Specified by:
applyin interfaceProcessFunction<WithFailures.ExceptionElement<T>,KV<T, EncodableThrowable>> - Specified by:
applyin interfaceSerializableFunction<WithFailures.ExceptionElement<T>,KV<T, EncodableThrowable>> - Overrides:
applyin classSimpleFunction<WithFailures.ExceptionElement<T>,KV<T, EncodableThrowable>>
-