/** * Returns the side inputs of this {@link Combine}, tagged with the tag of the {@link * PCollectionView}. The values of the returned map will be equal to the result of {@link * #getSideInputs()}. */ @Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(sideInputs); }
@Parameters(name = "{index}: {0}") public static Iterable<CreatePCollectionView<?, ?>> data() { return ImmutableList.of( CreatePCollectionView.of( PCollectionViews.singletonView( testPCollection, testPCollection.getWindowingStrategy(), false, null, StringUtf8Coder.of())), CreatePCollectionView.of( PCollectionViews.listView(testPCollection, testPCollection.getWindowingStrategy()))); }
@Override public PCollectionView<List<T>> expand(PCollection<T> input) { try { GroupByKey.applicableTo(input); } catch (IllegalStateException e) { throw new IllegalStateException("Unable to create a side-input view from input", e); } PCollection<KV<Void, T>> materializationInput = input.apply(new VoidKeyToMultimapMaterialization<>()); PCollectionView<List<T>> view = PCollectionViews.listView( materializationInput, materializationInput.getWindowingStrategy()); materializationInput.apply(CreatePCollectionView.of(view)); return view; } }
@Override public PCollectionView<OutputT> expand(PCollection<InputT> input) { PCollection<OutputT> combined = input.apply(Combine.<InputT, OutputT>globally(fn).withoutDefaults().withFanout(fanout)); PCollection<KV<Void, OutputT>> materializationInput = combined.apply(new VoidKeyToMultimapMaterialization<>()); PCollectionView<OutputT> view = PCollectionViews.singletonView( materializationInput, input.getWindowingStrategy(), insertDefault, insertDefault ? fn.defaultValue() : null, combined.getCoder()); materializationInput.apply(CreatePCollectionView.of(view)); return view; }
@Override public PCollectionView<Iterable<T>> expand(PCollection<T> input) { try { GroupByKey.applicableTo(input); } catch (IllegalStateException e) { throw new IllegalStateException("Unable to create a side-input view from input", e); } PCollection<KV<Void, T>> materializationInput = input.apply(new VoidKeyToMultimapMaterialization<>()); PCollectionView<Iterable<T>> view = PCollectionViews.iterableView( materializationInput, materializationInput.getWindowingStrategy()); materializationInput.apply(CreatePCollectionView.of(view)); return view; } }
@Override public PCollectionView<Map<K, Iterable<V>>> expand(PCollection<KV<K, V>> input) { try { GroupByKey.applicableTo(input); } catch (IllegalStateException e) { throw new IllegalStateException("Unable to create a side-input view from input", e); } PCollection<KV<Void, KV<K, V>>> materializationInput = input.apply(new VoidKeyToMultimapMaterialization<>()); PCollectionView<Map<K, Iterable<V>>> view = PCollectionViews.multimapView( materializationInput, materializationInput.getWindowingStrategy()); materializationInput.apply(CreatePCollectionView.of(view)); return view; } }
@Override public PCollectionView<Map<K, V>> expand(PCollection<KV<K, V>> input) { try { GroupByKey.applicableTo(input); } catch (IllegalStateException e) { throw new IllegalStateException("Unable to create a side-input view from input", e); } PCollection<KV<Void, KV<K, V>>> materializationInput = input.apply(new VoidKeyToMultimapMaterialization<>()); PCollectionView<Map<K, V>> view = PCollectionViews.mapView( materializationInput, materializationInput.getWindowingStrategy()); materializationInput.apply(CreatePCollectionView.of(view)); return view; } }
/** * Returns the side inputs of this {@link Combine}, tagged with the tag of the {@link * PCollectionView}. The values of the returned map will be equal to the result of {@link * #getSideInputs()}. */ @Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(sideInputs); }
/** * Returns the side inputs of this {@link ParDo}, tagged with the tag of the {@link * PCollectionView}. The values of the returned map will be equal to the result of {@link * #getSideInputs()}. */ @Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(sideInputs); }
/** * Returns the side inputs of this {@link ParDo}, tagged with the tag of the {@link * PCollectionView}. The values of the returned map will be equal to the result of {@link * #getSideInputs()}. */ @Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(sideInputs); }
@Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(sideInputs); } }
@Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(sideInputs); }
@Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(sideInputs); }
@Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(sideInputs); }
@Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(getSideInputs()); }
@Override public Map<TupleTag<?>, PValue> getAdditionalInputs() { return PCollectionViews.toAdditionalInputs(getSideInputs()); }