diff --git a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsAssignmentManagerSource.java b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsAssignmentManagerSource.java index 08b4ac5dc19..9473b267b14 100644 --- a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsAssignmentManagerSource.java +++ b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsAssignmentManagerSource.java @@ -40,7 +40,7 @@ public interface MetricsAssignmentManagerSource extends BaseSource { /** * Description */ - String METRICS_DESCRIPTION = "Metrics about HBase master assingment manager."; + String METRICS_DESCRIPTION = "Metrics about HBase master assignment manager."; String RIT_COUNT_NAME = "ritCount"; String RIT_COUNT_OVER_THRESHOLD_NAME = "ritCountOverThreshold"; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java index 4e25634959f..2b8c5210622 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java @@ -3538,6 +3538,7 @@ public class AssignmentManager extends ZooKeeperListener { int totalRITs = 0; int totalRITsOverThreshold = 0; long oldestRITTime = 0; + Map ritsOverThreshold = null; int ritThreshold = this.server.getConfiguration(). getInt(HConstants.METRICS_RIT_STUCK_WARNING_THRESHOLD, 60000); for (RegionState state: regionStates.getRegionsInTransition()) { @@ -3545,11 +3546,24 @@ public class AssignmentManager extends ZooKeeperListener { long ritTime = currentTime - state.getStamp(); if (ritTime > ritThreshold) { // more than the threshold totalRITsOverThreshold++; + if (ritsOverThreshold == null) { + ritsOverThreshold = new HashMap<>(); + } + ritsOverThreshold.put(state.getRegion().getEncodedName(), state); } if (oldestRITTime < ritTime) { oldestRITTime = ritTime; } } + if (LOG.isDebugEnabled() && ritsOverThreshold != null && !ritsOverThreshold.isEmpty()) { + StringBuilder sb = new StringBuilder(); + for (Map.Entry rit: ritsOverThreshold.entrySet()) { + sb.append(rit.getKey()).append(":") + .append(rit.getValue().getState().name()).append("\n"); + } + sb.delete(sb.length()-1, sb.length()); + LOG.debug("RITs over threshold: " + sb.toString()); + } if (this.metricsAssignmentManager != null) { this.metricsAssignmentManager.updateRITOldestAge(oldestRITTime); this.metricsAssignmentManager.updateRITCount(totalRITs);