HBASE-25523 Region normalizer chore thread is getting killed (#2903)
Signed-off-by: Bharath Vissapragada <bharathv@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
parent
423ffb8a76
commit
818000de7b
|
@ -30,6 +30,7 @@ import java.util.function.BooleanSupplier;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
|
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
|
||||||
import org.apache.hadoop.hbase.RegionMetrics;
|
import org.apache.hadoop.hbase.RegionMetrics;
|
||||||
|
import org.apache.hadoop.hbase.ServerMetrics;
|
||||||
import org.apache.hadoop.hbase.ServerName;
|
import org.apache.hadoop.hbase.ServerName;
|
||||||
import org.apache.hadoop.hbase.Size;
|
import org.apache.hadoop.hbase.Size;
|
||||||
import org.apache.hadoop.hbase.TableName;
|
import org.apache.hadoop.hbase.TableName;
|
||||||
|
@ -225,8 +226,16 @@ class SimpleRegionNormalizer implements RegionNormalizer, ConfigurationObserver
|
||||||
private long getRegionSizeMB(RegionInfo hri) {
|
private long getRegionSizeMB(RegionInfo hri) {
|
||||||
ServerName sn =
|
ServerName sn =
|
||||||
masterServices.getAssignmentManager().getRegionStates().getRegionServerOfRegion(hri);
|
masterServices.getAssignmentManager().getRegionStates().getRegionServerOfRegion(hri);
|
||||||
RegionMetrics regionLoad =
|
if (sn == null) {
|
||||||
masterServices.getServerManager().getLoad(sn).getRegionMetrics().get(hri.getRegionName());
|
LOG.debug("{} region was not found on any Server", hri.getRegionNameAsString());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
ServerMetrics serverMetrics = masterServices.getServerManager().getLoad(sn);
|
||||||
|
if (serverMetrics == null) {
|
||||||
|
LOG.debug("server {} was not found in ServerManager", sn.getServerName());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
RegionMetrics regionLoad = serverMetrics.getRegionMetrics().get(hri.getRegionName());
|
||||||
if (regionLoad == null) {
|
if (regionLoad == null) {
|
||||||
LOG.debug("{} was not found in RegionsLoad", hri.getRegionNameAsString());
|
LOG.debug("{} was not found in RegionsLoad", hri.getRegionNameAsString());
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue