Class BaseResources<T>

    • 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 void create​(java.lang.String path, T data)  
      protected java.util.concurrent.CompletableFuture<java.lang.Void> createAsync​(java.lang.String path, T data)  
      protected void delete​(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 boolean exists​(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)  
      int getOperationTimeoutSec()  
      protected static java.lang.String joinPath​(java.lang.String... parts)  
      protected void set​(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 void setWithCreate​(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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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)