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/27 19:17:38 UTC

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

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

 ##########
 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:
   i think it would be noisy. At a given point, the number of locks acquired would be roughly equal to number of ReplicationWorkers in the cluster. So for the rest of the under-replicated ledgers this value would be null and if we print something in case lock is not yet acquired for the under replicated ledger then it would become verbose and noisy.

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