AHeise commented on a change in pull request #10903: [FLINK-15549][API/DataSet]
Fix Integer overflow in ResettableIterator*.
URL: https://github.com/apache/flink/pull/10903#discussion_r368541850
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/operators/resettable/SpillingResettableMutableObjectIterator.java
##########
@@ -204,8 +204,16 @@ public void consumeAndCacheRemainingData() throws
IOException {
} catch (IOException e) {
throw new
RuntimeException("SpillingIterator: Error writing element to buffer.", e);
}
- this.elementCount++;
+ increaseElementCount();
}
}
}
+
+ private void increaseElementCount() {
Review comment:
Extracting that logic to some `NumericUtil#safeIncrement` in `flink-core`
could be a viable option.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services