Class InferableFunction<InputT,OutputT>
- All Implemented Interfaces:
Serializable,HasDisplayData,ProcessFunction<InputT,OutputT>
- Direct Known Subclasses:
SimpleFunction
ProcessFunction which is not a functional interface. Concrete subclasses allow
us to infer type information, which in turn aids Coder
inference.
See SimpleFunction for providing robust type information where a SerializableFunction is required.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected -
Method Summary
Modifier and TypeMethodDescriptionReturns the result of invoking this function on the given input.static <InputT,OutputT>
InferableFunction<InputT, OutputT> fromProcessFunctionWithOutputType(ProcessFunction<InputT, OutputT> fn, TypeDescriptor<OutputT> outputType) Returns aTypeDescriptorcapturing what is known statically about the input type of thisInferableFunctioninstance's most-derived class.Returns aTypeDescriptorcapturing what is known statically about the output type of thisInferableFunctioninstance's most-derived class.voidpopulateDisplayData(DisplayData.Builder builder) Register display data for the given transform or component.
-
Constructor Details
-
InferableFunction
protected InferableFunction() -
InferableFunction
-
-
Method Details
-
apply
Description copied from interface:ProcessFunctionReturns the result of invoking this function on the given input.- Specified by:
applyin interfaceProcessFunction<InputT,OutputT> - Throws:
Exception
-
fromProcessFunctionWithOutputType
public static <InputT,OutputT> InferableFunction<InputT,OutputT> fromProcessFunctionWithOutputType(ProcessFunction<InputT, OutputT> fn, TypeDescriptor<OutputT> outputType) -
getInputTypeDescriptor
Returns aTypeDescriptorcapturing what is known statically about the input type of thisInferableFunctioninstance's most-derived class.See
getOutputTypeDescriptor()for more discussion. -
getOutputTypeDescriptor
Returns aTypeDescriptorcapturing what is known statically about the output type of thisInferableFunctioninstance's most-derived class.In the normal case of a concrete
InferableFunctionsubclass with no generic type parameters of its own (including anonymous inner classes), this will be a complete non-generic type, which is good for choosing a default outputCoder<OutputT>for the outputPCollection<OutputT>. -
populateDisplayData
Register display data for the given transform or component.populateDisplayData(DisplayData.Builder)is invoked by Pipeline runners to collect display data viaDisplayData.from(HasDisplayData). Implementations may callsuper.populateDisplayData(builder)in order to register display data in the current namespace, but should otherwise usesubcomponent.populateDisplayData(builder)to use the namespace of the subcomponent.By default, does not register any display data. Implementors may override this method to provide their own display data.
- Specified by:
populateDisplayDatain interfaceHasDisplayData- Parameters:
builder- The builder to populate with display data.- See Also:
-