dlmarion commented on code in PR #5290:
URL: https://github.com/apache/accumulo/pull/5290#discussion_r1932732554
##########
core/src/main/java/org/apache/accumulo/core/metadata/TabletState.java:
##########
@@ -34,18 +39,25 @@ public static TabletState compute(TabletMetadata tm,
Set<TServerInstance> liveTS
future = tm.getLocation();
}
if (future != null) {
- return liveTServers.contains(future.getServerInstance()) ?
TabletState.ASSIGNED
- : TabletState.ASSIGNED_TO_DEAD_SERVER;
+ return trace(liveTServers.contains(future.getServerInstance()) ?
TabletState.ASSIGNED
+ : TabletState.ASSIGNED_TO_DEAD_SERVER, tm);
} else if (current != null) {
if (liveTServers.contains(current.getServerInstance())) {
- return TabletState.HOSTED;
+ return trace(TabletState.HOSTED, tm);
} else {
- return TabletState.ASSIGNED_TO_DEAD_SERVER;
+ return trace(TabletState.ASSIGNED_TO_DEAD_SERVER, tm);
}
} else if (tm.getSuspend() != null) {
- return TabletState.SUSPENDED;
+ return trace(TabletState.SUSPENDED, tm);
} else {
- return TabletState.UNASSIGNED;
+ return trace(TabletState.UNASSIGNED, tm);
}
}
+
+ private static TabletState trace(TabletState tabletState, TabletMetadata tm)
{
+ // The prev row column for the table may not have been fetched so can not
call tm.getExtent()
+ log.trace("Computed state of {} for {}", tabletState,
+ TabletsSection.encodeRow(tm.getTableId(), tm.getEndRow()));
Review Comment:
I wonder if this should be wrapped with log.isTraceEnabled(). This will
always call TabletsSection.encodeRow, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]