You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "aratno (via GitHub)" <gi...@apache.org> on 2025/12/08 15:20:33 UTC
Re: [PR] CASSANDRA-20987: Add virtual tables - MutationJournal and MutationShard [cassandra]
aratno commented on code in PR #4446:
URL: https://github.com/apache/cassandra/pull/4446#discussion_r2599031856
##########
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:
You can refactor this a bit by having Shard.DebugState be a map of LogId -> CoordinatorLog.DebugState. Part of the idea of DebugState is that it doesn't increase the visibility of these fields to public. Could you include these public getters (which exist for the vtable) in Shard.DebugState?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org