Package org.apache.beam.sdk.values
Class PCollectionViews
java.lang.Object
org.apache.beam.sdk.values.PCollectionViews
For internal use only; no backwards compatibility guarantees.
Implementations of PCollectionView
shared across the SDK.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static class
Implementation which is able to adapt a multimap materialization to an in-memoryList<T>
.static class
Implementation which is able to adapt an iterable materialization to an in-memoryList<T>
.static class
Implementation which is able to adapt a multimap materialization to an in-memoryMap<K, V>
.static class
Implementation which is able to adapt an iterable materialization to an in-memoryMap<K, V>
.static class
Implementation which is able to adapt a multimap materialization to an in-memoryMap<K, Iterable<V>>
.static class
Implementation which is able to adapt an iterable materialization to an in-memoryMap<K, Iterable<V>>
.static interface
static class
Implementation which is able to adapt an iterable materialization to aList<T>
.static class
Deprecated.static class
Implementation which is able to adapt an iterable materialization to aIterable<T>
.static class
Deprecated.static class
Implementation which is able to adapt a multimap materialization to aList<T>
.static class
Deprecated.static class
Implementation which is able to adapt a multimap materialization to aMap<K, V>
.static class
Deprecated.static class
Implementation which is able to adapt a multimap materialization to aMap<K, Iterable<V>>
.static class
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
Deprecated.static class
Implementation which is able to adapt an iterable materialization to aT
.static interface
static class
Stores values or metadata about values.static class
A coder forPCollectionViews.ValueOrMetadata
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
W extends BoundedWindow>
PCollectionView<List<T>> inMemoryListView
(PCollection<T> 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<List<T>> inMemoryListViewUsingVoidKey
(PCollection<KV<Void, T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
.static <K,
V, W extends BoundedWindow>
PCollectionView<Map<K, V>> inMemoryMapView
(PCollection<KV<K, V>> pCollection, Coder<K> keyCoder, Coder<V> valueCoder, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<Map<K, V>>
capable of processing elements windowed using the providedWindowingStrategy
.static <K,
V, W extends BoundedWindow>
PCollectionView<Map<K, V>> inMemoryMapViewUsingVoidKey
(PCollection<KV<Void, KV<K, V>>> pCollection, Coder<K> keyCoder, Coder<V> valueCoder, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<Map<K, V>>
capable of processing elements windowed using the providedWindowingStrategy
.static <K,
V, W extends BoundedWindow>
PCollectionView<Map<K, Iterable<V>>> inMemoryMultimapView
(PCollection<KV<K, V>> pCollection, Coder<K> keyCoder, Coder<V> valueCoder, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<Map<K, Iterable<V>>>
capable of processing elements windowed using the providedWindowingStrategy
.static <K,
V, W extends BoundedWindow>
PCollectionView<Map<K, Iterable<V>>> inMemoryMultimapViewUsingVoidKey
(PCollection<KV<Void, KV<K, V>>> pCollection, Coder<K> keyCoder, Coder<V> valueCoder, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<Map<K, Iterable<V>>>
capable of processing elements windowed using the providedWindowingStrategy
.static <T,
W extends BoundedWindow>
PCollectionView<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<Iterable<T>> iterableViewUsingVoidKey
(TupleTag<Materializations.MultimapView<Void, T>> tag, PCollection<KV<Void, T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) static <T,
W extends BoundedWindow>
PCollectionView<List<T>> listView
(PCollection<T> 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<List<T>> listView
(PCollection<T> pCollection, TupleTag<Materializations.IterableView<T>> 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<List<T>> listViewUsingVoidKey
(PCollection<KV<Void, T>> pCollection, TupleTag<Materializations.MultimapView<Void, T>> tag, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) static <T,
W extends BoundedWindow>
PCollectionView<List<T>> listViewUsingVoidKey
(TupleTag<Materializations.MultimapView<Void, T>> tag, PCollection<KV<Void, T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) static <T,
W extends BoundedWindow>
PCollectionView<List<T>> listViewWithRandomAccess
(PCollection<KV<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<List<T>> listViewWithRandomAccess
(PCollection<KV<Long, PCollectionViews.ValueOrMetadata<T, OffsetRange>>> pCollection, TupleTag<Materializations.MultimapView<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 <K,
V, W extends BoundedWindow>
PCollectionView<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<Map<K, V>> mapViewUsingVoidKey
(TupleTag<Materializations.MultimapView<Void, KV<K, V>>> tag, PCollection<KV<Void, KV<K, V>>> pCollection, PCollectionViews.TypeDescriptorSupplier<K> keyTypeDescriptorSupplier, PCollectionViews.TypeDescriptorSupplier<V> valueTypeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) static <K,
V, W extends BoundedWindow>
PCollectionView<Map<K, 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<Map<K, Iterable<V>>> multimapViewUsingVoidKey
(TupleTag<Materializations.MultimapView<Void, KV<K, V>>> tag, PCollection<KV<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<Void, T>> tag, PCollection<KV<Void, T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy, boolean hasDefault, @Nullable T defaultValue, Coder<T> defaultValueCoder) toAdditionalInputs
(Iterable<PCollectionView<?>> views) Expands a list ofPCollectionView
into the form needed forPTransform.getAdditionalInputs()
.
-
Constructor Details
-
PCollectionViews
public PCollectionViews()
-
-
Method Details
-
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<Void, T>> tag, PCollection<KV<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<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<Iterable<T>> iterableViewUsingVoidKey(TupleTag<Materializations.MultimapView<Void, T>> tag, PCollection<KV<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<List<T>> listView(PCollection<T> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
. -
inMemoryListView
public static <T,W extends BoundedWindow> PCollectionView<List<T>> inMemoryListView(PCollection<T> 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<List<T>> listView(PCollection<T> pCollection, TupleTag<Materializations.IterableView<T>> tag, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
. -
listViewWithRandomAccess
public static <T,W extends BoundedWindow> PCollectionView<List<T>> listViewWithRandomAccess(PCollection<KV<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
. -
listViewWithRandomAccess
public static <T,W extends BoundedWindow> PCollectionView<List<T>> listViewWithRandomAccess(PCollection<KV<Long, PCollectionViews.ValueOrMetadata<T, OffsetRange>>> pCollection, TupleTag<Materializations.MultimapView<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<List<T>> listViewUsingVoidKey(TupleTag<Materializations.MultimapView<Void, T>> tag, PCollection<KV<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<List<T>> listViewUsingVoidKey(PCollection<KV<Void, T>> pCollection, TupleTag<Materializations.MultimapView<Void, T>> tag, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
. -
inMemoryListViewUsingVoidKey
public static <T,W extends BoundedWindow> PCollectionView<List<T>> inMemoryListViewUsingVoidKey(PCollection<KV<Void, T>> pCollection, PCollectionViews.TypeDescriptorSupplier<T> typeDescriptorSupplier, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<List<T>>
capable of processing elements windowed using the providedWindowingStrategy
. -
mapView
public static <K,V, PCollectionView<Map<K,W extends BoundedWindow> 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
. -
inMemoryMapView
public static <K,V, PCollectionView<Map<K,W extends BoundedWindow> V>> inMemoryMapView(PCollection<KV<K, V>> pCollection, Coder<K> keyCoder, Coder<V> valueCoder, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<Map<K, V>>
capable of processing elements windowed using the providedWindowingStrategy
. -
mapViewUsingVoidKey
@Deprecated public static <K,V, PCollectionView<Map<K,W extends BoundedWindow> V>> mapViewUsingVoidKey(TupleTag<Materializations.MultimapView<Void, KV<K, V>>> tag, PCollection<KV<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
. -
inMemoryMapViewUsingVoidKey
public static <K,V, PCollectionView<Map<K,W extends BoundedWindow> V>> inMemoryMapViewUsingVoidKey(PCollection<KV<Void, KV<K, V>>> pCollection, Coder<K> keyCoder, Coder<V> valueCoder, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<Map<K, V>>
capable of processing elements windowed using the providedWindowingStrategy
. -
multimapView
public static <K,V, PCollectionView<Map<K,W extends BoundedWindow> 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
. -
inMemoryMultimapView
public static <K,V, PCollectionView<Map<K,W extends BoundedWindow> Iterable<V>>> inMemoryMultimapView(PCollection<KV<K, V>> pCollection, Coder<K> keyCoder, Coder<V> valueCoder, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<Map<K, Iterable<V>>>
capable of processing elements windowed using the providedWindowingStrategy
. -
multimapViewUsingVoidKey
@Deprecated public static <K,V, PCollectionView<Map<K,W extends BoundedWindow> Iterable<V>>> multimapViewUsingVoidKey(TupleTag<Materializations.MultimapView<Void, KV<K, V>>> tag, PCollection<KV<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
. -
inMemoryMultimapViewUsingVoidKey
public static <K,V, PCollectionView<Map<K,W extends BoundedWindow> Iterable<V>>> inMemoryMultimapViewUsingVoidKey(PCollection<KV<Void, KV<K, V>>> pCollection, Coder<K> keyCoder, Coder<V> valueCoder, WindowingStrategy<?, W> windowingStrategy) Returns aPCollectionView<Map<K, Iterable<V>>>
capable of processing elements windowed using the providedWindowingStrategy
. -
toAdditionalInputs
Expands a list ofPCollectionView
into the form needed forPTransform.getAdditionalInputs()
.
-
PCollectionViews.IterableViewFn2
.