public class SplittableParDo<InputT,OutputT,RestrictionT,WatermarkEstimatorStateT> extends PTransform<PCollection<InputT>,PCollectionTuple>
DoFn
by expanding it into a
network of simpler transforms:
DoFn
's DoFn.ProcessElement
method.
This transform is intended as a helper for internal use by runners when implementing ParDo.of(splittable DoFn)
, but not for direct use by pipeline writers.
Modifier and Type | Class and Description |
---|---|
static class |
SplittableParDo.OverrideFactory<InputT,OutputT>
|
static class |
SplittableParDo.PrimitiveBoundedRead<T>
The original primitive based
Read.Bounded expansion. |
static class |
SplittableParDo.PrimitiveUnboundedRead<T>
The original primitive based
Read.Unbounded expansion. |
static class |
SplittableParDo.ProcessKeyedElements<InputT,OutputT,RestrictionT,WatermarkEstimatorStateT>
Runner-specific primitive
PTransform that invokes the DoFn.ProcessElement
method for a splittable DoFn on each KV of the input PCollection of
KVs keyed with arbitrary but globally unique keys. |
static class |
SplittableParDo.ProcessKeyedElementsTranslator
A translator for
SplittableParDo.ProcessKeyedElements . |
static class |
SplittableParDo.Registrar
|
Modifier and Type | Field and Description |
---|---|
static PTransformOverride |
PRIMITIVE_BOUNDED_READ_OVERRIDE
A transform override for
Read.Bounded that converts it to a SplittableParDo.PrimitiveBoundedRead . |
static PTransformOverride |
PRIMITIVE_UNBOUNDED_READ_OVERRIDE
A transform override for
Read.Unbounded that converts it to a SplittableParDo.PrimitiveUnboundedRead . |
static java.lang.String |
SPLITTABLE_GBKIKWI_URN |
static java.lang.String |
SPLITTABLE_PROCESS_URN |
annotations, displayData, name, resourceHints
Modifier and Type | Method and Description |
---|---|
static void |
convertReadBasedSplittableDoFnsToPrimitiveReads(Pipeline pipeline)
Converts
Read based Splittable DoFn expansions to primitive reads implemented by SplittableParDo.PrimitiveBoundedRead and SplittableParDo.PrimitiveUnboundedRead . |
static void |
convertReadBasedSplittableDoFnsToPrimitiveReadsIfNecessary(Pipeline pipeline)
Converts
Read based Splittable DoFn expansions to primitive reads implemented by SplittableParDo.PrimitiveBoundedRead and SplittableParDo.PrimitiveUnboundedRead if either the experiment use_deprecated_read or beam_fn_api_use_deprecated_read are specified. |
PCollectionTuple |
expand(PCollection<InputT> input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
static <InputT,OutputT> |
forAppliedParDo(AppliedPTransform<PCollection<InputT>,PCollectionTuple,?> parDo)
Creates the transform for a
ParDo -compatible AppliedPTransform . |
java.util.Map<TupleTag<?>,PValue> |
getAdditionalInputs()
Returns all
PValues that are consumed as inputs to this PTransform that
are independent of the expansion of the InputT within PTransform.expand(PInput) . |
addAnnotation, compose, compose, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
public static final java.lang.String SPLITTABLE_PROCESS_URN
public static final java.lang.String SPLITTABLE_GBKIKWI_URN
public static final PTransformOverride PRIMITIVE_BOUNDED_READ_OVERRIDE
Read.Bounded
that converts it to a SplittableParDo.PrimitiveBoundedRead
.public static final PTransformOverride PRIMITIVE_UNBOUNDED_READ_OVERRIDE
Read.Unbounded
that converts it to a SplittableParDo.PrimitiveUnboundedRead
.public static <InputT,OutputT> SplittableParDo<InputT,OutputT,?,?> forAppliedParDo(AppliedPTransform<PCollection<InputT>,PCollectionTuple,?> parDo)
ParDo
-compatible AppliedPTransform
.
The input may generally be a deserialized transform so it may not actually be a ParDo
. Instead ParDoTranslation
will be used to extract fields.
public PCollectionTuple expand(PCollection<InputT> input)
PTransform
PTransform
should be expanded on the given
InputT
.
NOTE: This method should not be called directly. Instead apply the PTransform
should
be applied to the InputT
using the apply
method.
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).
expand
in class PTransform<PCollection<InputT>,PCollectionTuple>
public java.util.Map<TupleTag<?>,PValue> getAdditionalInputs()
PTransform
PValues
that are consumed as inputs to this PTransform
that
are independent of the expansion of the InputT
within PTransform.expand(PInput)
.
For example, this can contain any side input consumed by this PTransform
.
getAdditionalInputs
in class PTransform<PCollection<InputT>,PCollectionTuple>
public static void convertReadBasedSplittableDoFnsToPrimitiveReadsIfNecessary(Pipeline pipeline)
Read
based Splittable DoFn expansions to primitive reads implemented by SplittableParDo.PrimitiveBoundedRead
and SplittableParDo.PrimitiveUnboundedRead
if either the experiment use_deprecated_read
or beam_fn_api_use_deprecated_read
are specified.
TODO(https://github.com/apache/beam/issues/20530): Remove the primitive Read and make the splittable DoFn the only option.
public static void convertReadBasedSplittableDoFnsToPrimitiveReads(Pipeline pipeline)
Read
based Splittable DoFn expansions to primitive reads implemented by SplittableParDo.PrimitiveBoundedRead
and SplittableParDo.PrimitiveUnboundedRead
.
TODO(https://github.com/apache/beam/issues/20530): Remove the primitive Read and make the splittable DoFn the only option.