aparna0522 commented on code in PR #4446:
URL: https://github.com/apache/cassandra/pull/4446#discussion_r2599337882
##########
src/java/org/apache/cassandra/replication/Shard.java:
##########
@@ -375,4 +375,56 @@ void
collectShardReconciledOffsetsToBuilder(ReconciledKeyspaceOffsets.Builder ke
{
logs.values().forEach(log -> keyspaceBuilder.put(log.logId,
log.collectReconciledOffsets(), range));
}
+
+ public DebugInfo getDebugInfo()
+ {
+ List<LogDebugInfo> logInfos = new ArrayList<>();
+ for (CoordinatorLog log : logs.values())
+ {
+ logInfos.add(new LogDebugInfo(log.getLogId().toString(),
log.getDebugState()));
+ }
+ return new DebugInfo(logInfos);
+ }
+
+ public static class DebugInfo
+ {
+ public final List<LogDebugInfo> logs;
+
+ private DebugInfo(List<LogDebugInfo> logs)
+ {
+ this.logs = logs;
+ }
+ }
+
+ public static class LogDebugInfo
+ {
+ public final String logId;
+ public final CoordinatorLog.DebugState debugState;
+
+ private LogDebugInfo(String logId, CoordinatorLog.DebugState
debugState)
+ {
+ this.logId = logId;
+ this.debugState = debugState;
+ }
+ }
+
+ public String getKeyspace()
+ {
+ return keyspace;
+ }
+
+ public Range<Token> getRange()
+ {
+ return range;
+ }
+
+ public int getLocalNodeId()
+ {
+ return localNodeId;
+ }
+
+ public Participants getParticipants()
+ {
+ return participants;
+ }
Review Comment:
Makes sense. Added those changes.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]