Skip to content

Commit

Permalink
HBASE-26340 TableSplit returns false size under 1MB (apache#3872)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Somogyi <[email protected]
Signed-off-by: Duo Zhang <[email protected]>
  • Loading branch information
nkalmar authored Dec 18, 2021
1 parent a0acf8c commit 77b6b4d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,7 @@ RegionLoad createRegionLoad(final HRegion r, RegionLoad.Builder regionLoadBldr,
int maxCompactedStoreFileRefCount = 0;
int storeUncompressedSizeMB = 0;
int storefileSizeMB = 0;
long storefileSizeByte = 0L;
int memstoreSizeMB = (int) (r.getMemStoreDataSize() / 1024 / 1024);
long storefileIndexSizeKB = 0;
int rootLevelIndexSizeKB = 0;
Expand All @@ -1448,7 +1449,7 @@ RegionLoad createRegionLoad(final HRegion r, RegionLoad.Builder regionLoadBldr,
maxCompactedStoreFileRefCount = Math.max(maxCompactedStoreFileRefCount,
currentMaxCompactedStoreFileRefCount);
storeUncompressedSizeMB += (int) (store.getStoreSizeUncompressed() / 1024 / 1024);
storefileSizeMB += (int) (store.getStorefilesSize() / 1024 / 1024);
storefileSizeByte += store.getStorefilesSize();
//TODO: storefileIndexSizeKB is same with rootLevelIndexSizeKB?
storefileIndexSizeKB += store.getStorefilesRootLevelIndexSize() / 1024;
CompactionProgress progress = store.getCompactionProgress();
Expand All @@ -1460,6 +1461,9 @@ RegionLoad createRegionLoad(final HRegion r, RegionLoad.Builder regionLoadBldr,
totalStaticIndexSizeKB += (int) (store.getTotalStaticIndexSize() / 1024);
totalStaticBloomSizeKB += (int) (store.getTotalStaticBloomSize() / 1024);
}
//HBASE-26340 Fix false "0" size under 1MB
storefileSizeMB = storefileSizeByte > 0 && storefileSizeByte <= 1024 * 1024
? 1 : (int) storefileSizeByte / 1024 / 1024;

HDFSBlocksDistribution hdfsBd = r.getHDFSBlocksDistribution();
float dataLocality = hdfsBd.getBlockLocalityIndex(serverName.getHostname());
Expand Down

0 comments on commit 77b6b4d

Please sign in to comment.