File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -117,8 +117,8 @@ public void setRITCountOverThreshold(final int ritCount) {
117
117
}
118
118
119
119
@ Override
120
- public void setRITOldestAge (final long ritCount ) {
121
- ritOldestAgeGauge .set (ritCount );
120
+ public void setRITOldestAge (final long ritOldestAge ) {
121
+ ritOldestAgeGauge .set (ritOldestAge );
122
122
}
123
123
124
124
@ Override
Original file line number Diff line number Diff line change @@ -1666,7 +1666,13 @@ protected void update(final AssignmentManager am) {
1666
1666
private void update (final Collection <RegionState > regions , final long currentTime ) {
1667
1667
for (RegionState state : regions ) {
1668
1668
totalRITs ++;
1669
- final long ritTime = currentTime - state .getStamp ();
1669
+ final long ritStartedMs = state .getStamp ();
1670
+ if (ritStartedMs == 0 ) {
1671
+ // Don't output bogus values to metrics if they accidentally make it here.
1672
+ LOG .warn ("The RIT {} has no start time" , state .getRegion ());
1673
+ continue ;
1674
+ }
1675
+ final long ritTime = currentTime - ritStartedMs ;
1670
1676
if (ritTime > ritThreshold ) {
1671
1677
if (ritsOverThreshold == null ) {
1672
1678
ritsOverThreshold = new HashMap <String , RegionState >();
Original file line number Diff line number Diff line change @@ -178,7 +178,11 @@ public boolean isSplit() {
178
178
179
179
public long getLastUpdate () {
180
180
TransitRegionStateProcedure proc = this .procedure ;
181
- return proc != null ? proc .getLastUpdate () : lastUpdate ;
181
+ if (proc != null ) {
182
+ long lastUpdate = proc .getLastUpdate ();
183
+ return lastUpdate != 0 ? lastUpdate : proc .getSubmittedTime ();
184
+ }
185
+ return lastUpdate ;
182
186
}
183
187
184
188
public void setLastHost (final ServerName serverName ) {
You can’t perform that action at this time.
0 commit comments