/** * Creates a {@link ParDo} {@link PTransform} that will invoke the given {@link DoFn} function. * * <p>The resulting {@link PTransform PTransform} is ready to be applied, or further properties * can be set on it first. */ public static <InputT, OutputT> SingleOutput<InputT, OutputT> of(DoFn<InputT, OutputT> fn) { validate(fn); return new SingleOutput<>(fn, Collections.emptyList(), displayDataForFn(fn)); }
/** * Returns a new {@link ParDo} {@link PTransform} that's like this {@link PTransform} but with * the specified additional side inputs. Does not modify this {@link PTransform}. * * <p>See the discussion of Side Inputs above for more explanation. */ public SingleOutput<InputT, OutputT> withSideInputs( Iterable<? extends PCollectionView<?>> sideInputs) { return new SingleOutput<>( fn, ImmutableList.<PCollectionView<?>>builder() .addAll(this.sideInputs) .addAll(sideInputs) .build(), fnDisplayData); }