hangc0276 commented on code in PR #4106:
URL: https://github.com/apache/bookkeeper/pull/4106#discussion_r1361462724
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RegionAwareEnsemblePlacementPolicy.java:
##########
@@ -324,10 +324,11 @@ public PlacementResult<List<BookieId>> newEnsemble(int
ensembleSize, int writeQu
excludedBookies);
Set<Node> excludeNodes =
convertBookiesToNodes(comprehensiveExclusionBookiesSet);
List<String> availableRegions = new ArrayList<>();
- for (String region: perRegionPlacement.keySet()) {
- if ((null == disallowBookiePlacementInRegionFeatureName)
+ for (Map.Entry<String, TopologyAwareEnsemblePlacementPolicy> entry
: perRegionPlacement.entrySet()) {
+ String region = entry.getKey();
Review Comment:
We can filter the empty region in the beginning
```
if (entry.getValue().knownBookies.isEmpty()) {
continue;
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]