merlimat commented on a change in pull request #11693:
URL: https://github.com/apache/pulsar/pull/11693#discussion_r702308689
##########
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:
In this case it's redundant but correct. The exists and getChildren are
cached directly in the MetadataStore implementation, the MetadataCache is for
keeping a typed cache of the objects.
The delete operation on the cache is just a convenience method that is just
forwarded to the store implementation
--
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]