You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/07/15 02:27:40 UTC

[GitHub] [hbase] Apache9 commented on a diff in pull request #4626: HBASE-27203 Clean up error-prone findings in hbase-client

Apache9 commented on code in PR #4626:
URL: https://github.com/apache/hbase/pull/4626#discussion_r921750654


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/ServerMetricsBuilder.java:
##########
@@ -414,16 +411,20 @@ public String toString() {
         int currentMaxCompactedStoreFileRefCount = r.getMaxCompactedStoreFileRefCount();
         maxCompactedStoreFileRefCount =
           Math.max(maxCompactedStoreFileRefCount, currentMaxCompactedStoreFileRefCount);
-        uncompressedStoreFileSizeMB += r.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE);
-        storeFileSizeMB += r.getStoreFileSize().get(Size.Unit.MEGABYTE);
-        memStoreSizeMB += r.getMemStoreSize().get(Size.Unit.MEGABYTE);
-        storefileIndexSizeKB += r.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE);
+        uncompressedStoreFileSizeMB = (long) (uncompressedStoreFileSizeMB

Review Comment:
   Just use += and cast the right operator to long is enough?



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/CacheEvictionStats.java:
##########
@@ -28,7 +29,7 @@ public final class CacheEvictionStats {
 
   private final long evictedBlocks;
   private final long maxCacheSize;
-  private final Map<byte[], Throwable> exceptions;
+  private final IdentityHashMap<byte[], Throwable> exceptions;

Review Comment:
   I think this will be a bit dangerous if we will return this map to upper layer...



-- 
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@hbase.apache.org

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