Package org.apache.beam.sdk.values
Class PCollectionViews
- java.lang.Object
-
- org.apache.beam.sdk.values.PCollectionViews
-
@Internal public class PCollectionViews extends java.lang.Object
For internal use only; no backwards compatibility guarantees.Implementations of
PCollectionView
shared across the SDK.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PCollectionViews.HasDefaultValue<T>
static class
PCollectionViews.IterableViewFn<T>
Deprecated.static class
PCollectionViews.IterableViewFn2<T>
Implementation which is able to adapt an iterable materialization to aIterable<T>
.static class
PCollectionViews.ListViewFn<T>
Deprecated.static class
PCollectionViews.ListViewFn2<T>
Implementation which is able to adapt a multimap materialization to aList<T>
.static class
PCollectionViews.MapViewFn<K,V>
Deprecated.static class
PCollectionViews.MapViewFn2<K,V>
Implementation which is able to adapt a multimap materialization to aMap<K, V>
.static class
PCollectionViews.MultimapViewFn<K,V>
Deprecated.static class
PCollectionViews.MultimapViewFn2<K,V>
Implementation which is able to adapt a multimap materialization to aMap<K, Iterable<V>>
.static class
PCollectionViews.SimplePCollectionView<ElemT,PrimitiveViewT,ViewT,W extends BoundedWindow>
A class forPCollectionView
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>
Deprecated.static class
PCollectionViews.SingletonViewFn2<T>
Implementation which is able to adapt an iterable materialization to aT
.static interface
PCollectionViews.TypeDescriptorSupplier<T>
static class
PCollectionViews.ValueOrMetadata<T,MetaT>
Stores values or metadata about values.static class
PCollectionViews.ValueOrMetadataCoder<T,MetaT>
A coder forPCollectionViews.ValueOrMetadata
.
-
Constructor Summary
Constructors Constructor Description PCollectionViews()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T,W extends BoundedWindow>
PCollectionView<java.lang.Iterable<T>>iterableView(PCollection<T> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Iterable<T>>
capable of processing elements windowed using the providedWindowingStrategy
.static <T,W extends BoundedWindow>
PCollectionView<java.lang.Iterable<T>>iterableViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,T>> tag, PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
static <T,W extends BoundedWindow>
PCollectionView<java.util.List<T>>listView(PCollection<KV<java.lang.Long,PCollectionViews.ValueOrMetadata<T,OffsetRange>>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
.static <T,W extends BoundedWindow>
PCollectionView<java.util.List<T>>listView(PCollection<KV<java.lang.Long,PCollectionViews.ValueOrMetadata<T,OffsetRange>>> pCollection, TupleTag<Materializations.MultimapView<java.lang.Long,PCollectionViews.ValueOrMetadata<T,OffsetRange>>> tag, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
.static <T,W extends BoundedWindow>
PCollectionView<java.util.List<T>>listViewUsingVoidKey(PCollection<KV<java.lang.Void,T>> pCollection, TupleTag<Materializations.MultimapView<java.lang.Void,T>> tag, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
static <T,W extends BoundedWindow>
PCollectionView<java.util.List<T>>listViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,T>> tag, PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
static <K,V,W extends BoundedWindow>
PCollectionView<java.util.Map<K,V>>mapView(PCollection<KV<K,V>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Map<K, V>>
capable of processing elements windowed using the providedWindowingStrategy
.static <K,V,W extends BoundedWindow>
PCollectionView<java.util.Map<K,V>>mapViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,KV<K,V>>> tag, PCollection<KV<java.lang.Void,KV<K,V>>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
static <K,V,W extends BoundedWindow>
PCollectionView<java.util.Map<K,java.lang.Iterable<V>>>multimapView(PCollection<KV<K,V>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Map<K, Iterable<V>>>
capable of processing elements windowed using the providedWindowingStrategy
.static <K,V,W extends BoundedWindow>
PCollectionView<java.util.Map<K,java.lang.Iterable<V>>>multimapViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,KV<K,V>>> tag, PCollection<KV<java.lang.Void,KV<K,V>>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
static <T,W extends BoundedWindow>
PCollectionView<T>singletonView(PCollection<T> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy, boolean hasDefault, @Nullable T defaultValue, Coder<T> defaultValueCoder)
Returns aPCollectionView<T>
capable of processing elements windowed using the providedWindowingStrategy
.static <T,W extends BoundedWindow>
PCollectionView<T>singletonViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,T>> tag, PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy, boolean hasDefault, @Nullable T defaultValue, Coder<T> defaultValueCoder)
static java.util.Map<TupleTag<?>,PValue>
toAdditionalInputs(java.lang.Iterable<PCollectionView<?>> views)
Expands a list ofPCollectionView
into the form needed forPTransform.getAdditionalInputs()
.
-
-
-
Method Detail
-
singletonView
public static <T,W extends BoundedWindow> PCollectionView<T> singletonView(PCollection<T> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy, boolean hasDefault, @Nullable T defaultValue, Coder<T> defaultValueCoder)
Returns aPCollectionView<T>
capable of processing elements windowed using the providedWindowingStrategy
.If
hasDefault
istrue
, then the view will take on the valuedefaultValue
for any empty windows.
-
singletonViewUsingVoidKey
@Deprecated public static <T,W extends BoundedWindow> PCollectionView<T> singletonViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,T>> tag, PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy, boolean hasDefault, @Nullable T defaultValue, Coder<T> defaultValueCoder)
Returns aPCollectionView<T>
capable of processing elements windowed using the providedWindowingStrategy
.If
hasDefault
istrue
, then the view will take on the valuedefaultValue
for any empty windows.
-
iterableView
public static <T,W extends BoundedWindow> PCollectionView<java.lang.Iterable<T>> iterableView(PCollection<T> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Iterable<T>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
iterableViewUsingVoidKey
@Deprecated public static <T,W extends BoundedWindow> PCollectionView<java.lang.Iterable<T>> iterableViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,T>> tag, PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Iterable<T>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
listView
public static <T,W extends BoundedWindow> PCollectionView<java.util.List<T>> listView(PCollection<KV<java.lang.Long,PCollectionViews.ValueOrMetadata<T,OffsetRange>>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
listView
public static <T,W extends BoundedWindow> PCollectionView<java.util.List<T>> listView(PCollection<KV<java.lang.Long,PCollectionViews.ValueOrMetadata<T,OffsetRange>>> pCollection, TupleTag<Materializations.MultimapView<java.lang.Long,PCollectionViews.ValueOrMetadata<T,OffsetRange>>> tag, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
listViewUsingVoidKey
@Deprecated public static <T,W extends BoundedWindow> PCollectionView<java.util.List<T>> listViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,T>> tag, PCollection<KV<java.lang.Void,T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
listViewUsingVoidKey
@Deprecated public static <T,W extends BoundedWindow> PCollectionView<java.util.List<T>> listViewUsingVoidKey(PCollection<KV<java.lang.Void,T>> pCollection, TupleTag<Materializations.MultimapView<java.lang.Void,T>> tag, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
mapView
public static <K,V,W extends BoundedWindow> PCollectionView<java.util.Map<K,V>> mapView(PCollection<KV<K,V>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Map<K, V>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
mapViewUsingVoidKey
@Deprecated public static <K,V,W extends BoundedWindow> PCollectionView<java.util.Map<K,V>> mapViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,KV<K,V>>> tag, PCollection<KV<java.lang.Void,KV<K,V>>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Map<K, V>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
multimapView
public static <K,V,W extends BoundedWindow> PCollectionView<java.util.Map<K,java.lang.Iterable<V>>> multimapView(PCollection<KV<K,V>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Map<K, Iterable<V>>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
multimapViewUsingVoidKey
@Deprecated public static <K,V,W extends BoundedWindow> PCollectionView<java.util.Map<K,java.lang.Iterable<V>>> multimapViewUsingVoidKey(TupleTag<Materializations.MultimapView<java.lang.Void,KV<K,V>>> tag, PCollection<KV<java.lang.Void,KV<K,V>>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?,W> windowingStrategy)
Returns aPCollectionView<Map<K, Iterable<V>>>
capable of processing elements windowed using the providedWindowingStrategy
.
-
toAdditionalInputs
public static java.util.Map<TupleTag<?>,PValue> toAdditionalInputs(java.lang.Iterable<PCollectionView<?>> views)
Expands a list ofPCollectionView
into the form needed forPTransform.getAdditionalInputs()
.
-
-