public abstract class ForwardingPTransform<InputT extends PInput,OutputT extends POutput> extends PTransform<InputT,OutputT>
PTransform overrides, which behave identically to the
delegate transform but with overridden methods. Implementors are required to implement
delegate(), which returns the object to forward calls to, and apply(PInput).name| Constructor and Description |
|---|
ForwardingPTransform() |
| Modifier and Type | Method and Description |
|---|---|
OutputT |
apply(InputT input)
Applies this
PTransform on the given InputT, and returns its
Output. |
protected abstract PTransform<InputT,OutputT> |
delegate() |
<T> Coder<T> |
getDefaultOutputCoder(InputT input,
TypedPValue<T> output)
Returns the default
Coder to use for the given output of
this single-output PTransform when applied to the given input. |
String |
getName()
Returns the transform name.
|
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
void |
validate(InputT input)
Called before invoking apply (which may be intercepted by the runner) to
verify this transform is fully specified and applicable to the specified
input.
|
getDefaultOutputCoder, getDefaultOutputCoder, getKindString, toStringprotected abstract PTransform<InputT,OutputT> delegate()
public OutputT apply(InputT input)
PTransformPTransform on the given InputT, and returns its
Output.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
The default implementation throws an exception. A derived class must
either implement apply, or else each runner must supply a custom
implementation via
PipelineRunner.apply(com.google.cloud.dataflow.sdk.transforms.PTransform<InputT, OutputT>, InputT).
public void validate(InputT input)
PTransformBy default, does nothing.
public String getName()
PTransformThis name is provided by the transform creator and is not required to be unique.
public <T> Coder<T> getDefaultOutputCoder(InputT input, TypedPValue<T> output) throws CannotProvideCoderException
PTransformCoder to use for the given output of
this single-output PTransform when applied to the given input.getDefaultOutputCoder in class PTransform<InputT extends PInput,OutputT extends POutput>CannotProvideCoderException - if none can be inferred.
By default, always throws.
public void populateDisplayData(DisplayData.Builder builder)
PTransformpopulateDisplayData(DisplayData.Builder) is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData). Implementations may call
super.populateDisplayData(builder) in order to register display data in the current
namespace, but should otherwise use subcomponent.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.
populateDisplayData in interface HasDisplayDatapopulateDisplayData in class PTransform<InputT extends PInput,OutputT extends POutput>builder - The builder to populate with display data.HasDisplayData