advancedxy commented on code in PR #8297:
URL: https://github.com/apache/iceberg/pull/8297#discussion_r1293037698


##########
api/src/main/java/org/apache/iceberg/metrics/DefaultCounter.java:
##########
@@ -107,7 +106,6 @@ public void increment() {
 
     @Override
     public void increment(Integer amount) {

Review Comment:
   For `IntCounter`, I believe that we can still add a cheap overflow check at 
the `value()` method.
   
   ```java
       public Integer value() {
         long sum = counter.longValue();
         if (sum > Integer.MaxValue) {
           ...
         }
         return (int) sum
       }
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to