reddycharan commented on a change in pull request #1883: Enhance
EnsemblePlacementPolicy and DNSResolverDecorator to log relevant metrics.
URL: https://github.com/apache/bookkeeper/pull/1883#discussion_r246831249
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java
##########
@@ -1206,4 +1240,32 @@ static void
shuffleWithMask(DistributionSchedule.WriteSet writeSet,
}
}
}
+
+ @Override
+ public boolean
isEnsembleAdheringToPlacementPolicy(List<BookieSocketAddress> ensembleList, int
writeQuorumSize,
+ int ackQuorumSize) {
+ int ensembleSize = ensembleList.size();
+ int minNumRacksPerWriteQuorumForThisEnsemble =
Math.min(writeQuorumSize, minNumRacksPerWriteQuorum);
+ HashSet<String> racksOrRegionsInQuorum = new HashSet<String>();
+ BookieSocketAddress bookie;
+ for (int i = 0; i < ensembleList.size(); i++) {
+ racksOrRegionsInQuorum.clear();
+ for (int j = 0; j < writeQuorumSize; j++) {
+ bookie = ensembleList.get((ensembleSize + i + j) %
ensembleSize);
Review comment:
not really if 'i' and 'j' are positive numbers, will remove it from
numerator to avoid confusion
----------------------------------------------------------------
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