You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "mahaitao617 (via GitHub)" <gi...@apache.org> on 2023/02/02 05:42:34 UTC
[GitHub] [rocketmq] mahaitao617 commented on a diff in pull request #5958: [ISSUE #5936] feat:add display replica status
mahaitao617 commented on code in PR #5958:
URL: https://github.com/apache/rocketmq/pull/5958#discussion_r1094056948
##########
tools/src/main/java/org/apache/rocketmq/tools/command/ha/GetSyncStateSetSubCommand.java:
##########
@@ -123,13 +123,23 @@ private void printData(String controllerAddress, List<String> brokerNames,
next.getKey(), next.getValue().getMasterAddress(), next.getValue().getMasterEpoch(), next.getValue().getSyncStateSetEpoch(),
inSyncReplicas.size());
for (BrokerReplicasInfo.ReplicaIdentity member : inSyncReplicas) {
- System.out.printf("\n InSyncReplica:\t%s\n", member.toString());
+ System.out.printf("\n InSyncReplica:\t%s\n", member.toString() + acquireBrokerStatus(defaultMQAdminExt, member.getAddress()));
}
for (BrokerReplicasInfo.ReplicaIdentity member : notInSyncReplicas) {
- System.out.printf("\n NotInSyncReplica:\t%s\n", member.toString());
+ System.out.printf("\n NotInSyncReplica:\t%s\n", member.toString() + acquireBrokerStatus(defaultMQAdminExt, member.getAddress()));
Review Comment:
i have fixed it
##########
tools/src/main/java/org/apache/rocketmq/tools/command/ha/GetSyncStateSetSubCommand.java:
##########
@@ -123,13 +123,23 @@ private void printData(String controllerAddress, List<String> brokerNames,
next.getKey(), next.getValue().getMasterAddress(), next.getValue().getMasterEpoch(), next.getValue().getSyncStateSetEpoch(),
inSyncReplicas.size());
for (BrokerReplicasInfo.ReplicaIdentity member : inSyncReplicas) {
- System.out.printf("\n InSyncReplica:\t%s\n", member.toString());
+ System.out.printf("\n InSyncReplica:\t%s\n", member.toString() + acquireBrokerStatus(defaultMQAdminExt, member.getAddress()));
}
for (BrokerReplicasInfo.ReplicaIdentity member : notInSyncReplicas) {
- System.out.printf("\n NotInSyncReplica:\t%s\n", member.toString());
+ System.out.printf("\n NotInSyncReplica:\t%s\n", member.toString() + acquireBrokerStatus(defaultMQAdminExt, member.getAddress()));
}
}
}
}
+
+ private String acquireBrokerStatus(DefaultMQAdminExt defaultMQAdminExt,String brokerAddr) {
+ String status = " online";
Review Comment:
i have fixed it
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org