jiazhai commented on a change in pull request #839: Issue 709: Add Slow 
Bookkeeper Servers to Placement Policy for read ordering
URL: https://github.com/apache/bookkeeper/pull/839#discussion_r157387911
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
 ##########
 @@ -789,35 +805,105 @@ protected BookieNode selectRandomFromRack(String 
netPath, Set<Node> excludeBooki
         throw new BKNotEnoughBookiesException();
     }
 
+    @Override
+    public void registerSlowBookie(BookieSocketAddress bookieSocketAddress, 
long entryId) {
+        slowBookies.put(bookieSocketAddress, entryId);
+    }
+
     @Override
     public DistributionSchedule.WriteSet reorderReadSequence(
             ArrayList<BookieSocketAddress> ensemble,
-            Map<BookieSocketAddress, Long> bookieFailureHistory,
+            BookiesHealthInfo bookiesHealthInfo,
             DistributionSchedule.WriteSet writeSet) {
+        Map<Integer, String> writeSetWithRegion = new HashMap<>();
+        for (int i = 0; i < writeSet.size(); i++) {
+            writeSetWithRegion.put(writeSet.get(i), "");
+        }
+        return reorderReadSequenceWithRegion(
+            ensemble, writeSet, writeSetWithRegion, bookiesHealthInfo, false, 
"", writeSet.size());
+    }
+
+    /**
+     * This function orders the read sequence with a given region. For 
region-unaware policies (e.g.
+     * RackAware), we pass in false for regionAware and an empty myRegion. 
When this happens, any
+     * remote list will stay empty. The ordering is as follows (the R* at the 
beginning of each list item
+     * is only present for region aware policies.
 
 Review comment:
   need a ")" ?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to