use of org.apache.beam.runners.twister2.translators.functions.AssignWindowsFunction in project beam by apache.
the class AssignWindowTranslatorBatch method translateNode.
@Override
public void translateNode(Window.Assign<T> transform, Twister2BatchTranslationContext context) {
BatchTSetImpl<WindowedValue<T>> inputTTSet = context.getInputDataSet(context.getInput(transform));
final WindowingStrategy<T, BoundedWindow> windowingStrategy = (WindowingStrategy<T, BoundedWindow>) context.getOutput(transform).getWindowingStrategy();
WindowFn<T, BoundedWindow> windowFn = windowingStrategy.getWindowFn();
ComputeTSet<WindowedValue<T>, Iterator<WindowedValue<T>>> outputTSet = inputTTSet.direct().compute(new AssignWindowsFunction(windowFn, context.getOptions()));
context.setOutputDataSet(context.getOutput(transform), outputTSet);
}
Aggregations