killxdcj 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_r368415858
 
 

 ##########
 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:
   Maybe you can think of it this way, there may be many such scenes in 
reality, and you need to check the overflow, so whether all the places to check 
the overflow need to use the same code.
   
   And the point is that they are two separate components, and there is no need 
to reuse them for reuse.

----------------------------------------------------------------
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

Reply via email to