HBASE-20384 [AMv2] Logging format improvements; use encoded name rather than full region name marking transitions

This commit is contained in:
Michael Stack 2018-04-09 20:23:05 -07:00
parent bf7c631dee
commit c78908cff3
3 changed files with 5 additions and 6 deletions

View File

@ -189,7 +189,7 @@ public class RegionPlan implements Comparable<RegionPlan> {
@Override
public String toString() {
return "hri=" + this.hri.getRegionNameAsString() + ", source=" +
return "hri=" + this.hri.getEncodedName() + ", source=" +
(this.source == null? "": this.source.toString()) +
", destination=" + (this.dest == null? "": this.dest.toString());
}

View File

@ -864,7 +864,7 @@ public class AssignmentManager implements ServerListener {
final ServerStateNode serverNode = regionStates.getOrCreateServer(serverName);
if (!reportTransition(regionNode, serverNode, state, seqId)) {
// Don't log if shutting down cluster; during shutdown.
LOG.warn("No matchin procedure found for {} to transition to {}", regionNode, state);
LOG.warn("No matching procedure found for {} transition to {}", regionNode, state);
}
}

View File

@ -118,9 +118,8 @@ public class RegionStateStore {
final long openSeqNum = -1;
// TODO: move under trace, now is visible for debugging
LOG.info(String.format("Load hbase:meta entry region=%s regionState=%s lastHost=%s regionLocation=%s",
regionInfo, state, lastHost, regionLocation));
LOG.info("Load hbase:meta entry region={}, regionState={}, lastHost={}, " +
"regionLocation={}", regionInfo.getEncodedName(), state, lastHost, regionLocation);
visitor.visitRegionState(regionInfo, state, regionLocation, lastHost, openSeqNum);
}
}
@ -158,7 +157,7 @@ public class RegionStateStore {
MetaTableAccessor.addRegionInfo(put, regionInfo);
final StringBuilder info =
new StringBuilder("pid=").append(pid).append(" updating hbase:meta row=")
.append(regionInfo.getRegionNameAsString()).append(", regionState=").append(state);
.append(regionInfo.getEncodedName()).append(", regionState=").append(state);
if (openSeqNum >= 0) {
Preconditions.checkArgument(state == State.OPEN && regionLocation != null,
"Open region should be on a server");