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
public class BaseResources<T> extends java.lang.ObjectBase class for all configuration resources to access configurations from metadata-store.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringBASE_CLUSTERS_PATHprotected static java.lang.StringBASE_POLICIES_PATH
-
Constructor Summary
Constructors Constructor Description BaseResources(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, java.lang.Class<T> clazz, int operationTimeoutSec)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreate(java.lang.String path, T data)protected java.util.concurrent.CompletableFuture<java.lang.Void>createAsync(java.lang.String path, T data)protected voiddelete(java.lang.String path)protected java.util.concurrent.CompletableFuture<java.lang.Void>deleteAsync(java.lang.String path)protected java.util.concurrent.CompletableFuture<java.lang.Void>deleteIfExistsAsync(java.lang.String path)protected booleanexists(java.lang.String path)protected java.util.concurrent.CompletableFuture<java.lang.Boolean>existsAsync(java.lang.String path)protected java.util.Optional<T>get(java.lang.String path)protected java.util.concurrent.CompletableFuture<java.util.Optional<T>>getAsync(java.lang.String path)protected java.util.List<java.lang.String>getChildren(java.lang.String path)protected java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>>getChildrenAsync(java.lang.String path)intgetOperationTimeoutSec()protected static java.lang.StringjoinPath(java.lang.String... parts)protected voidset(java.lang.String path, java.util.function.Function<T,T> modifyFunction)protected java.util.concurrent.CompletableFuture<java.lang.Void>setAsync(java.lang.String path, java.util.function.Function<T,T> modifyFunction)protected voidsetWithCreate(java.lang.String path, java.util.function.Function<java.util.Optional<T>,T> createFunction)protected java.util.concurrent.CompletableFuture<java.lang.Void>setWithCreateAsync(java.lang.String path, java.util.function.Function<java.util.Optional<T>,T> createFunction)
-
-
-
Field Detail
-
BASE_POLICIES_PATH
protected static final java.lang.String BASE_POLICIES_PATH
- See Also:
- Constant Field Values
-
BASE_CLUSTERS_PATH
protected static final java.lang.String BASE_CLUSTERS_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BaseResources
public BaseResources(org.apache.pulsar.metadata.api.MetadataStore store, java.lang.Class<T> clazz, int operationTimeoutSec)
-
BaseResources
public BaseResources(org.apache.pulsar.metadata.api.MetadataStore store, com.fasterxml.jackson.core.type.TypeReference<T> typeRef, int operationTimeoutSec)
-
-
Method Detail
-
getChildren
protected java.util.List<java.lang.String> getChildren(java.lang.String path) throws org.apache.pulsar.metadata.api.MetadataStoreException- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
getChildrenAsync
protected java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> getChildrenAsync(java.lang.String path)
-
get
protected java.util.Optional<T> get(java.lang.String path) throws org.apache.pulsar.metadata.api.MetadataStoreException
- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
getAsync
protected java.util.concurrent.CompletableFuture<java.util.Optional<T>> getAsync(java.lang.String path)
-
set
protected void set(java.lang.String path, java.util.function.Function<T,T> modifyFunction) throws org.apache.pulsar.metadata.api.MetadataStoreException- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
setAsync
protected java.util.concurrent.CompletableFuture<java.lang.Void> setAsync(java.lang.String path, java.util.function.Function<T,T> modifyFunction)
-
setWithCreate
protected void setWithCreate(java.lang.String path, java.util.function.Function<java.util.Optional<T>,T> createFunction) throws org.apache.pulsar.metadata.api.MetadataStoreException- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
setWithCreateAsync
protected java.util.concurrent.CompletableFuture<java.lang.Void> setWithCreateAsync(java.lang.String path, java.util.function.Function<java.util.Optional<T>,T> createFunction)
-
create
protected void create(java.lang.String path, T data) throws org.apache.pulsar.metadata.api.MetadataStoreException- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
createAsync
protected java.util.concurrent.CompletableFuture<java.lang.Void> createAsync(java.lang.String path, T data)
-
delete
protected void delete(java.lang.String path) throws org.apache.pulsar.metadata.api.MetadataStoreException- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
deleteAsync
protected java.util.concurrent.CompletableFuture<java.lang.Void> deleteAsync(java.lang.String path)
-
deleteIfExistsAsync
protected java.util.concurrent.CompletableFuture<java.lang.Void> deleteIfExistsAsync(java.lang.String path)
-
exists
protected boolean exists(java.lang.String path) throws org.apache.pulsar.metadata.api.MetadataStoreException- Throws:
org.apache.pulsar.metadata.api.MetadataStoreException
-
existsAsync
protected java.util.concurrent.CompletableFuture<java.lang.Boolean> existsAsync(java.lang.String path)
-
getOperationTimeoutSec
public int getOperationTimeoutSec()
-
joinPath
protected static java.lang.String joinPath(java.lang.String... parts)
-
-