eolivelli commented on a change in pull request #11693:
URL: https://github.com/apache/pulsar/pull/11693#discussion_r702317404



##########
File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/ClusterResources.java
##########
@@ -48,5 +104,33 @@ public FailureDomainResources(MetadataStore store, 
Class<FailureDomainImpl> claz
                 int operationTimeoutSec) {
             super(store, clazz, operationTimeoutSec);
         }
+
+        public List<String> listFailureDomains(String clusterName) throws 
MetadataStoreException {
+            return getChildren(joinPath(BASE_CLUSTERS_PATH, clusterName, 
FAILURE_DOMAIN));
+        }
+
+        public Optional<FailureDomainImpl> getFailureDomain(String 
clusterName, String domainName)
+                throws MetadataStoreException {
+            return get(joinPath(BASE_CLUSTERS_PATH, clusterName, 
FAILURE_DOMAIN, domainName));
+        }
+
+        public void deleteFailureDomain(String clusterName, String domainName) 
throws MetadataStoreException {
+            delete(joinPath(BASE_CLUSTERS_PATH, clusterName, FAILURE_DOMAIN, 
domainName));
+        }
+
+        public void deleteFailureDomains(String clusterName) throws 
MetadataStoreException {
+            String failureDomainPath = joinPath(BASE_CLUSTERS_PATH, 
clusterName, FAILURE_DOMAIN);
+            for (String domain : 
getCache().getChildren(failureDomainPath).join()) {

Review comment:
       Makes sense. Thanks




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


Reply via email to