apurtell commented on code in PR #4647:
URL: https://github.com/apache/hbase/pull/4647#discussion_r929422515


##########
hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/RowCountEndpoint.java:
##########
@@ -118,24 +117,18 @@ public void getKeyValueCount(RpcController controller, 
CountRequest request,
       scanner = env.getRegion().getScanner(new Scan());
       List<Cell> results = new ArrayList<>();
       boolean hasMore = false;
-      long count = 0;
+      MutableLong count = new MutableLong();
       do {
         hasMore = scanner.next(results);
-        for (Cell kv : results) {
-          count++;
-        }
+        results.forEach((r) -> count.increment());

Review Comment:
   Or Iterables.size like you suggested on the review of hbase-endpoint. 



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

Reply via email to