@@ -1431,6 +1431,7 @@ RegionLoad createRegionLoad(final HRegion r, RegionLoad.Builder regionLoadBldr,
14311431    int  maxCompactedStoreFileRefCount  = 0 ;
14321432    int  storeUncompressedSizeMB  = 0 ;
14331433    int  storefileSizeMB  = 0 ;
1434+     long  storefileSizeByte  = 0L ;
14341435    int  memstoreSizeMB  = (int ) (r .getMemStoreDataSize () / 1024  / 1024 );
14351436    long  storefileIndexSizeKB  = 0 ;
14361437    int  rootLevelIndexSizeKB  = 0 ;
@@ -1448,7 +1449,7 @@ RegionLoad createRegionLoad(final HRegion r, RegionLoad.Builder regionLoadBldr,
14481449      maxCompactedStoreFileRefCount  = Math .max (maxCompactedStoreFileRefCount ,
14491450        currentMaxCompactedStoreFileRefCount );
14501451      storeUncompressedSizeMB  += (int ) (store .getStoreSizeUncompressed () / 1024  / 1024 );
1451-       storefileSizeMB  += ( int ) ( store .getStorefilesSize () /  1024  /  1024 );
1452+       storefileSizeByte  += store .getStorefilesSize ();
14521453      //TODO: storefileIndexSizeKB is same with rootLevelIndexSizeKB? 
14531454      storefileIndexSizeKB  += store .getStorefilesRootLevelIndexSize () / 1024 ;
14541455      CompactionProgress  progress  = store .getCompactionProgress ();
@@ -1460,6 +1461,9 @@ RegionLoad createRegionLoad(final HRegion r, RegionLoad.Builder regionLoadBldr,
14601461      totalStaticIndexSizeKB  += (int ) (store .getTotalStaticIndexSize () / 1024 );
14611462      totalStaticBloomSizeKB  += (int ) (store .getTotalStaticBloomSize () / 1024 );
14621463    }
1464+     //HBASE-26340 Fix false "0" size under 1MB 
1465+     storefileSizeMB  = storefileSizeByte  > 0  && storefileSizeByte  <= 1024  * 1024 
1466+        ? 1  : (int ) storefileSizeByte  / 1024  / 1024 ;
14631467
14641468    HDFSBlocksDistribution  hdfsBd  = r .getHDFSBlocksDistribution ();
14651469    float  dataLocality  = hdfsBd .getBlockLocalityIndex (serverName .getHostname ());
0 commit comments