@Internal public class PCollectionViews extends java.lang.Object
Implementations of PCollectionView
shared across the SDK.
Modifier and Type | Class and Description |
---|---|
static class |
PCollectionViews.IterableViewFn<T>
Implementation which is able to adapt a multimap materialization to a
Iterable<T> . |
static class |
PCollectionViews.ListViewFn<T>
Implementation which is able to adapt a multimap materialization to a
List<T> . |
static class |
PCollectionViews.MapViewFn<K,V>
Implementation which is able to adapt a multimap materialization to a
Map<K, V> . |
static class |
PCollectionViews.MultimapViewFn<K,V>
Implementation which is able to adapt a multimap materialization to a
Map<K,
Iterable<V>> . |
static class |
PCollectionViews.SimplePCollectionView<ElemT,PrimitiveViewT,ViewT,W extends BoundedWindow>
A class for
PCollectionView implementations, with additional type parameters that are
not visible at pipeline assembly time when the view is used as a side input. |
static class |
PCollectionViews.SingletonViewFn<T>
Implementation which is able to adapt a multimap materialization to a
T . |
static interface |
PCollectionViews.TypeDescriptorSupplier<T> |
Constructor and Description |
---|
PCollectionViews() |
Modifier and Type | Method and Description |
---|---|
static <T,W extends BoundedWindow> |
iterableView(PCollection<KV<java.lang.Void,T>> pCollection,
PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier,
WindowingStrategy<?,W> windowingStrategy)
Returns a
PCollectionView<Iterable<T>> capable of processing elements windowed using
the provided WindowingStrategy . |
static <T,W extends BoundedWindow> |
listView(PCollection<KV<java.lang.Void,T>> pCollection,
PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier,
WindowingStrategy<?,W> windowingStrategy)
Returns a
PCollectionView<List<T>> capable of processing elements windowed using the
provided WindowingStrategy . |
static <K,V,W extends BoundedWindow> |
mapView(PCollection<KV<java.lang.Void,KV<K,V>>> pCollection,
PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier,
PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier,
WindowingStrategy<?,W> windowingStrategy)
Returns a
PCollectionView<Map<K, V>> capable of processing elements windowed using the
provided WindowingStrategy . |
static <K,V,W extends BoundedWindow> |
multimapView(PCollection<KV<java.lang.Void,KV<K,V>>> pCollection,
PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier,
PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier,
WindowingStrategy<?,W> windowingStrategy)
Returns a
PCollectionView<Map<K, Iterable<V>>> capable of processing elements windowed
using the provided WindowingStrategy . |
static <T,W extends BoundedWindow> |
singletonView(PCollection<KV<java.lang.Void,T>> pCollection,
PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier,
WindowingStrategy<?,W> windowingStrategy,
boolean hasDefault,
T defaultValue,
Coder<T> defaultValueCoder)
Returns a
PCollectionView<T> capable of processing elements windowed using the provided
WindowingStrategy . |
static java.util.Map<TupleTag<?>,PValue> |
toAdditionalInputs(java.lang.Iterable<PCollectionView<?>> views)
Expands a list of
PCollectionView into the form needed for PTransform.getAdditionalInputs() . |
public static <T,W extends BoundedWindow> PCollectionView<T> singletonView(PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy, boolean hasDefault, @Nullable T defaultValue, Coder<T> defaultValueCoder)
PCollectionView<T>
capable of processing elements windowed using the provided
WindowingStrategy
.
If hasDefault
is true
, then the view will take on the value defaultValue
for any empty windows.
public static <T,W extends BoundedWindow> PCollectionView<java.lang.Iterable<T>> iterableView(PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
PCollectionView<Iterable<T>>
capable of processing elements windowed using
the provided WindowingStrategy
.public static <T,W extends BoundedWindow> PCollectionView<java.util.List<T>> listView(PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
PCollectionView<List<T>>
capable of processing elements windowed using the
provided WindowingStrategy
.public static <K,V,W extends BoundedWindow> PCollectionView<java.util.Map<K,V>> mapView(PCollection<KV<java.lang.Void,KV<K,V>>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
PCollectionView<Map<K, V>>
capable of processing elements windowed using the
provided WindowingStrategy
.public static <K,V,W extends BoundedWindow> PCollectionView<java.util.Map<K,java.lang.Iterable<V>>> multimapView(PCollection<KV<java.lang.Void,KV<K,V>>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
PCollectionView<Map<K, Iterable<V>>>
capable of processing elements windowed
using the provided WindowingStrategy
.public static java.util.Map<TupleTag<?>,PValue> toAdditionalInputs(java.lang.Iterable<PCollectionView<?>> views)
PCollectionView
into the form needed for PTransform.getAdditionalInputs()
.