Skip to content

Commit

Permalink
#! [euphoria-flink] Avoid extra shuffle when windowing on streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
xitep authored and vanekjar committed Mar 21, 2017
1 parent 3f67275 commit 4312951
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public DataStream<?> translate(FlinkOperator<ReduceStateByKey> operator,
// assign windows
DataStream<KeyedMultiWindowedElement> windowed = input.map(new WindowAssigner(
windowing, keyExtractor, valueExtractor, eventTimeAssigner))
.setParallelism(operator.getParallelism());
// ~ execute in the same chain of the input's processing
// so far, thereby, avoiding an unnecessary shuffle
.setParallelism(input.getParallelism());

DataStream<WindowedElement<?, Pair>> reduced = (DataStream) windowed.keyBy(new KeyExtractor())
.transform(operator.getName(), TypeInformation.of(WindowedElement.class), new WindowOperator<>(
Expand Down

0 comments on commit 4312951

Please sign in to comment.