ankit-j commented on a change in pull request #2096: Entries must be 
acknowledged by bookies in multiple fault domains before being acknowledged to 
client
URL: https://github.com/apache/bookkeeper/pull/2096#discussion_r287157881
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
 ##########
 @@ -1060,4 +1061,36 @@ public boolean 
isEnsembleAdheringToPlacementPolicy(List<BookieSocketAddress> ens
         }
         return true;
     }
+
+    @Override
+    public boolean 
areAckedBookiesAdheringToPlacementPolicy(Set<BookieSocketAddress> ackedBookies,
+                                                            int 
writeQuorumSize,
+                                                            int ackQuorumSize) 
{
+        HashSet<String> rackCounter = new HashSet<>();
+        int minWriteQuorumNumRacksPerWriteQuorum = Math.min(writeQuorumSize, 
minNumRacksPerWriteQuorum);
+
+        ReentrantReadWriteLock.ReadLock readLock = rwLock.readLock();
+        readLock.lock();
+        try {
+            for (BookieSocketAddress bookie : ackedBookies) {
+                try {
+                    
rackCounter.add(knownBookies.get(bookie).getNetworkLocation());
+                } catch (Exception e) {
 
 Review comment:
   Fixed. Removed the try catch as it not needed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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