zymap commented on a change in pull request #8961:
URL: https://github.com/apache/pulsar/pull/8961#discussion_r549532175
##########
File path:
pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZkIsolatedBookieEnsemblePlacementPolicy.java
##########
@@ -156,34 +177,79 @@ private ZooKeeperCache getAndSetZkCache(Configuration
conf) {
bookieToReplace, excludeBookies);
}
- private Set<BookieId> getBlacklistedBookies(int ensembleSize) {
- Set<BookieId> blacklistedBookies = new HashSet<BookieId>();
+ private Optional<EnsemblePlacementPolicyConfig>
getEnsemblePlacementPolicyConfig(
+ Map<String, byte[]> customMetadata) {
+
+ byte[] ensemblePlacementPolicyConfigData = customMetadata.get(
+ EnsemblePlacementPolicyConfig.ENSEMBLE_PLACEMENT_POLICY_CONFIG);
+ if (ensemblePlacementPolicyConfigData != null) {
+ try {
+ return
Optional.ofNullable(EnsemblePlacementPolicyConfig.decode(ensemblePlacementPolicyConfigData));
+ } catch (JsonUtil.ParseJsonException e) {
+ LOG.error("Failed to parse the ensemble placement policy
config from the custom metadata", e);
+ return Optional.empty();
+ }
+ }
+ return Optional.empty();
+ }
+
+ private Map<String, List<String>> getDefaultIsolationGroups() {
Review comment:
This method will use an instance variable.
----------------------------------------------------------------
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]