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.FailureDomainResources,DynamicConfigurationResources,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(org.apache.pulsar.metadata.api.MetadataStore store, com.fasterxml.jackson.core.type.TypeReference<T> typeRef, int operationTimeoutSec) BaseResources(org.apache.pulsar.metadata.api.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) 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(org.apache.pulsar.metadata.api.MetadataStore store, com.fasterxml.jackson.core.type.TypeReference<T> typeRef, int operationTimeoutSec)
-
-
Method Details
-
getChildren
protected List<String> getChildren(String path) throws org.apache.pulsar.metadata.api.MetadataStoreException - Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
getChildrenAsync
-
get
- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
getAsync
-
refreshAndGetAsync
-
set
protected void set(String path, Function<T, T> modifyFunction) throws org.apache.pulsar.metadata.api.MetadataStoreException- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
setAsync
-
setWithCreate
protected void setWithCreate(String path, Function<Optional<T>, T> createFunction) throws org.apache.pulsar.metadata.api.MetadataStoreException- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
setWithCreateAsync
-
create
protected void create(String path, T data) throws org.apache.pulsar.metadata.api.MetadataStoreException - Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
createAsync
-
delete
- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
deleteAsync
-
deleteIfExistsAsync
-
exists
- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
existsAsync
-
getOperationTimeoutSec
public int getOperationTimeoutSec() -
joinPath
-