Package org.apache.beam.sdk.transforms
Class ViewFn<PrimitiveViewT,ViewT>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.ViewFn<PrimitiveViewT,ViewT>
-
- Type Parameters:
PrimitiveViewT
- the type of the underlying primitive view requiredViewT
- the type of the value(s) accessible via thisPCollectionView
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
PCollectionViews.IterableViewFn
,PCollectionViews.IterableViewFn2
,PCollectionViews.ListViewFn
,PCollectionViews.ListViewFn2
,PCollectionViews.MapViewFn
,PCollectionViews.MapViewFn2
,PCollectionViews.MultimapViewFn
,PCollectionViews.MultimapViewFn2
,PCollectionViews.SingletonViewFn
,PCollectionViews.SingletonViewFn2
@Internal public abstract class ViewFn<PrimitiveViewT,ViewT> extends java.lang.Object implements java.io.Serializable
For internal use only; no backwards-compatibility guarantees.A function to adapt a primitive "view" of a
PCollection
- some materialization specified in the Beam model and implemented by the runner - to a user-facing view type for side input.Both the underlying primitive view and the user-facing view are immutable.
The most common case is using the
View
transforms to prepare aPCollection
for use as a side input toParDo
. SeeView.asSingleton()
,View.asIterable()
, andView.asMap()
for more detail on specific views available in the SDK.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ViewFn()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract ViewT
apply(PrimitiveViewT primitiveViewT)
A function to adapt a primitive view type to a desired view type.abstract Materialization<PrimitiveViewT>
getMaterialization()
Gets the materialization of thisViewFn
.abstract TypeDescriptor<ViewT>
getTypeDescriptor()
Return theTypeDescriptor
describing the output of this fn.
-
-
-
Method Detail
-
getMaterialization
public abstract Materialization<PrimitiveViewT> getMaterialization()
Gets the materialization of thisViewFn
.
-
apply
public abstract ViewT apply(PrimitiveViewT primitiveViewT)
A function to adapt a primitive view type to a desired view type.
-
getTypeDescriptor
public abstract TypeDescriptor<ViewT> getTypeDescriptor()
Return theTypeDescriptor
describing the output of this fn.
-
-