Class BaseResources<T>
java.lang.Object
org.apache.pulsar.broker.resources.BaseResources<T>
- Type Parameters:
T- type of configuration-resources.
- Direct Known Subclasses:
BookieResources,BrokerResources,ClusterResources,ClusterResources.ClusterPoliciesResources,ClusterResources.FailureDomainResources,DynamicConfigurationResources,LoadBalanceResources.BrokerTimeAverageDataResources,LoadBalanceResources.BundleDataResources,LoadBalanceResources.QuotaResources,LoadManagerReportResources,LocalPoliciesResources,NamespaceResources,NamespaceResources.IsolationPolicyResources,NamespaceResources.PartitionedTopicResources,ResourceGroupResources,TenantResources
Base class for all configuration resources to access configurations from metadata-store.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseResources(MetadataStore store, com.fasterxml.jackson.core.type.TypeReference<T> typeRef, int operationTimeoutSec) BaseResources(MetadataStore store, Class<T> clazz, int operationTimeoutSec) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected CompletableFuture<Void>createAsync(String path, T data) protected voidprotected CompletableFuture<Void>deleteAsync(String path) protected CompletableFuture<Void>deleteIfExistsAsync(String path) protected booleanprotected CompletableFuture<Boolean>existsAsync(String path) protected CompletableFuture<Optional<T>>getChildren(String path) protected CompletableFuture<List<String>>getChildrenAsync(String path) protected CompletableFuture<List<String>>intprotected static Stringprotected CompletableFuture<Optional<T>>refreshAndGetAsync(String path) protected voidprotected CompletableFuture<Void>protected voidprotected CompletableFuture<Void>
-
Field Details
-
BASE_POLICIES_PATH
- See Also:
-
BASE_CLUSTERS_PATH
- See Also:
-
LOCAL_POLICIES_ROOT
- See Also:
-
-
Constructor Details
-
BaseResources
-
BaseResources
public BaseResources(MetadataStore store, com.fasterxml.jackson.core.type.TypeReference<T> typeRef, int operationTimeoutSec)
-
-
Method Details
-
getChildren
- Throws:
MetadataStoreException
-
getChildrenAsync
-
getChildrenRecursiveAsync
-
get
- Throws:
MetadataStoreException
-
getAsync
-
refreshAndGetAsync
-
set
- Throws:
MetadataStoreException
-
setAsync
-
setWithCreate
protected void setWithCreate(String path, Function<Optional<T>, T> createFunction) throws MetadataStoreException- Throws:
MetadataStoreException
-
setWithCreateAsync
-
create
- Throws:
MetadataStoreException
-
createAsync
-
delete
- Throws:
MetadataStoreException
-
deleteAsync
-
deleteIfExistsAsync
-
exists
- Throws:
MetadataStoreException
-
existsAsync
-
getOperationTimeoutSec
public int getOperationTimeoutSec() -
joinPath
-