You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/21 18:17:51 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #5328: API: Remove Optional from Counter#count()

rdblue commented on code in PR #5328:
URL: https://github.com/apache/iceberg/pull/5328#discussion_r926979715


##########
api/src/main/java/org/apache/iceberg/metrics/IntCounter.java:
##########
@@ -45,8 +44,8 @@ public void increment(Integer amount) {
   }
 
   @Override
-  public Optional<Integer> count() {
-    return Optional.of(counter.get());
+  public Integer count() {

Review Comment:
   Since this is in API, we can't remove it without deprecation. For now, can you add it back and just always return a non-empty optional? Then we can add a new method that always returns the value, like `value()`.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org