You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/05/26 06:00:11 UTC

[GitHub] eolivelli commented on a change in pull request #1446: Add printreplicationworkerid option to ListUnderreplicatedCmd.

eolivelli commented on a change in pull request #1446: Add printreplicationworkerid option to ListUnderreplicatedCmd.
URL: https://github.com/apache/bookkeeper/pull/1446#discussion_r191040867
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
 ##########
 @@ -927,12 +930,26 @@ int runCmd(CommandLine cmdLine) throws Exception {
                 Iterator<Map.Entry<Long, List<String>>> iter = underreplicationManager
                         .listLedgersToRereplicate(predicate, printMissingReplica);
                 while (iter.hasNext()) {
-                    System.out.println(ledgerIdFormatter.formatLedgerId(iter.next().getKey()));
+                    Map.Entry<Long, List<String>> urLedgerMapEntry = iter.next();
+                    long urLedgerId = urLedgerMapEntry.getKey();
+                    System.out.println(ledgerIdFormatter.formatLedgerId(urLedgerId));
                     if (printMissingReplica) {
-                        iter.next().getValue().forEach((missingReplica) -> {
-                            System.out.println("\t" + missingReplica);
+                        urLedgerMapEntry.getValue().forEach((missingReplica) -> {
+                            System.out.println("\tMissingReplica : " + missingReplica);
                         });
                     }
+                    if (printReplicationWorkerId) {
+                        try {
+                            String replicationWorkerId = underreplicationManager
+                                    .getReplicationWorkerIdRereplicatingLedger(urLedgerId);
+                            if (replicationWorkerId != null) {
+                                System.out.println("\tReplicationWorkerId : " + replicationWorkerId);
 
 Review comment:
   Would it be useful to print something even in case of missing worker

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services