提交 a9d55d3e 编写于 作者: R Rucongzhang 提交者: mbalassi

[flink-2532] [streaming] fix variable name in StreamWindow

Closes #1025
上级 67087dea
......@@ -153,24 +153,24 @@ public class StreamWindow<T> extends ArrayList<T> implements Collector<T> {
if (n > numElements) {
return split(window, numElements);
} else {
List<StreamWindow<X>> split = new ArrayList<StreamWindow<X>>();
List<StreamWindow<X>> splitsList = new ArrayList<StreamWindow<X>>();
int splitSize = numElements / n;
int index = -1;
StreamWindow<X> currentSubWindow = new StreamWindow<X>(window.windowID, n);
split.add(currentSubWindow);
splitsList.add(currentSubWindow);
for (X element : window) {
index++;
if (index == splitSize && split.size() < n) {
if (index == splitSize && splitsList.size() < n) {
currentSubWindow = new StreamWindow<X>(window.windowID, n);
split.add(currentSubWindow);
splitsList.add(currentSubWindow);
index = 0;
}
currentSubWindow.add(element);
}
return split;
return splitsList;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册