use of org.apache.beam.runners.dataflow.worker.GroupAlsoByWindowFnRunner in project beam by apache.
the class BatchGroupAlsoByWindowReshuffleDoFnTest method makeRunner.
private static <K, InputT, OutputT, W extends BoundedWindow> DoFnRunner<KV<K, Iterable<WindowedValue<InputT>>>, KV<K, OutputT>> makeRunner(GroupAlsoByWindowDoFnFactory<K, InputT, OutputT> fnFactory, WindowingStrategy<?, W> windowingStrategy, TupleTag<KV<K, OutputT>> outputTag, DoFnRunners.OutputManager outputManager) {
final StepContext stepContext = new TestStepContext(STEP_NAME);
StateInternalsFactory<K> stateInternalsFactory = key -> stepContext.stateInternals();
BatchGroupAlsoByWindowFn<K, InputT, OutputT> fn = fnFactory.forStrategy(windowingStrategy, stateInternalsFactory);
return new GroupAlsoByWindowFnRunner<>(PipelineOptionsFactory.create(), fn, NullSideInputReader.empty(), outputManager, outputTag, stepContext);
}
Aggregations