caigy commented on code in PR #5958:
URL: https://github.com/apache/rocketmq/pull/5958#discussion_r1093933378


##########
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:
   Format the message in `printf` formatter instead of concatenating strings 
directly.



##########
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:
   `status` should not contain format characters (like white spaces), do 
formatting work where it is necessary.



-- 
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]

Reply via email to