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 2019/02/20 00:56:20 UTC

[GitHub] sijie commented on a change in pull request #1941: Exclude defaultrack bookies when enforceMinNumRacksPerWriteQuorum is enabled

sijie commented on a change in pull request #1941: Exclude defaultrack bookies when enforceMinNumRacksPerWriteQuorum is enabled
URL: https://github.com/apache/bookkeeper/pull/1941#discussion_r258294225
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
 ##########
 @@ -531,26 +561,40 @@ public void handleBookiesThatJoined(Set<BookieSocketAddress> joinedBookies) {
         return networkLocs;
     }
 
+    /*
+     * this method should be called in readlock scope of 'rwLock'
+     */
+    protected Set<BookieSocketAddress> addDefaultZoneBookiesIfMinNumRacksIsEnforced(
+            Set<BookieSocketAddress> excludeBookies) {
+        Set<BookieSocketAddress> comprehensiveExclusionBookiesSet;
+        if (enforceMinNumRacksPerWriteQuorum) {
+            comprehensiveExclusionBookiesSet = new HashSet<BookieSocketAddress>(excludeBookies);
+            topology.getLeaves(getDefaultRack()).forEach((Node node) -> {
+                if (node instanceof BookieNode) {
+                    BookieNode bookieNode = (BookieNode) node;
+                    comprehensiveExclusionBookiesSet.add(bookieNode.getAddr());
+                }
 
 Review comment:
   yeah we should handle `else` branch.

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