In this method, you can get the region's Load per region:
private Map<String, RegionLoad> getRegionsLoad() {
try {
Map<String, RegionLoad> regionsNameToLoad = new HashMap<String,
RegionLoad>();
ClusterStatus clusterStatus = hAdmin.getClusterStatus();
for (ServerName serverName : clusterStatus.getServers()) {
HServerLoad load = clusterStatus.getLoad(serverName);
Map<byte[], RegionLoad> regionsLoad = load.getRegionsLoad();
for (Map.Entry<byte[], RegionLoad> entry :
regionsLoad.entrySet()) {
RegionLoad regionLoad = entry.getValue();
regionsNameToLoad.put(regionLoad.getNameAsString(),
regionLoad);
}
}
return regionsNameToLoad;
} catch (IOException e1) {
throw new RuntimeException("Failed while fetching cluster load:
"+e1.getMessage(), e1);
}
}
Then you get use it by:
regionLoad.getStorefileSizeMB()
and there are other methds on RegionLoad.
Check it out.
Asaf
On Mon, Dec 2, 2013 at 3:48 PM, Vineet Mishra <[email protected]>wrote:
> Hi
>
> Can Anyone tell me the Java API for getting the Region Size of a table!
>
> Thanks!
>