Google Cloud Dataflow SDK for Java, version 1.9.1
Class ForwardingPTransform<InputT extends PInput,OutputT extends POutput>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.PTransform<InputT,OutputT>
-
- com.google.cloud.dataflow.sdk.runners.inprocess.ForwardingPTransform<InputT,OutputT>
-
- All Implemented Interfaces:
- HasDisplayData, Serializable
public abstract class ForwardingPTransform<InputT extends PInput,OutputT extends POutput> extends PTransform<InputT,OutputT>
A base class for implementingPTransform
overrides, which behave identically to the delegate transform but with overridden methods. Implementors are required to implementdelegate()
, which returns the object to forward calls to, andapply(PInput)
.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform
name
-
-
Constructor Summary
Constructors Constructor and Description ForwardingPTransform()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description OutputT
apply(InputT input)
Applies thisPTransform
on the givenInputT
, and returns itsOutput
.protected abstract PTransform<InputT,OutputT>
delegate()
<T> Coder<T>
getDefaultOutputCoder(InputT input, TypedPValue<T> output)
Returns the defaultCoder
to use for the given output of this single-outputPTransform
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.-
Methods inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform
getDefaultOutputCoder, getDefaultOutputCoder, getKindString, toString
-
-
-
-
Method Detail
-
delegate
protected abstract PTransform<InputT,OutputT> delegate()
-
apply
public OutputT apply(InputT input)
Description copied from class:PTransform
Applies thisPTransform
on the givenInputT
, and returns itsOutput
.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)
.
-
validate
public void validate(InputT input)
Description copied from class:PTransform
Called before invoking apply (which may be intercepted by the runner) to verify this transform is fully specified and applicable to the specified input.By default, does nothing.
-
getName
public String getName()
Description copied from class:PTransform
Returns the transform name.This name is provided by the transform creator and is not required to be unique.
-
getDefaultOutputCoder
public <T> Coder<T> getDefaultOutputCoder(InputT input, TypedPValue<T> output) throws CannotProvideCoderException
Description copied from class:PTransform
Returns the defaultCoder
to use for the given output of this single-outputPTransform
when applied to the given input.By default, always throws.
- Overrides:
getDefaultOutputCoder
in classPTransform<InputT extends PInput,OutputT extends POutput>
- Throws:
CannotProvideCoderException
- if none can be inferred.
-
populateDisplayData
public void populateDisplayData(DisplayData.Builder builder)
Description copied from class:PTransform
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:
populateDisplayData
in interfaceHasDisplayData
- Overrides:
populateDisplayData
in classPTransform<InputT extends PInput,OutputT extends POutput>
- Parameters:
builder
- The builder to populate with display data.- See Also:
HasDisplayData
-
-