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

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
 ##########
 @@ -779,37 +796,107 @@ 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,
+            BookKeeperServerHealthInfo bookKeeperServerHealthInfo,
             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, bookKeeperServerHealthInfo, false, "", writeSet.size());
 
 Review comment:
   That's a good question. The reasoning is that I wanted to try to avoid 
duplication in RackAware and RegionAware placement policies, so I put the 
shared code in RackAwarePlacementPolicyImpl so that both of the policies can 
access it since RegionAware is a sublcass of RackAware. 

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