Class OwnedBundle


  • public class OwnedBundle
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      NamespaceBundle getNamespaceBundle()
      Access to the namespace name.
      java.util.concurrent.CompletableFuture<java.lang.Void> handleUnloadRequest​(PulsarService pulsar, long timeout, java.util.concurrent.TimeUnit timeoutUnit)
      It unloads the bundle by closing all topics concurrently under this bundle.
      boolean isActive()
      Access method to the namespace state to check whether the namespace is active or not.
      void setActive​(boolean active)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OwnedBundle

        public OwnedBundle​(NamespaceBundle suName)
        constructor.
        Parameters:
        suName -
      • OwnedBundle

        public OwnedBundle​(NamespaceBundle suName,
                           boolean active)
        Constructor to allow set initial active flag.
        Parameters:
        suName -
        active -
    • Method Detail

      • getNamespaceBundle

        public NamespaceBundle getNamespaceBundle()
        Access to the namespace name.
        Returns:
        NamespaceName
      • handleUnloadRequest

        public java.util.concurrent.CompletableFuture<java.lang.Void> handleUnloadRequest​(PulsarService pulsar,
                                                                                          long timeout,
                                                                                          java.util.concurrent.TimeUnit timeoutUnit)
        It unloads the bundle by closing all topics concurrently under this bundle.
         a. disable bundle ownership in memory and not in zk
         b. close all the topics concurrently
         c. delete ownership znode from zookeeper.
         
        Parameters:
        pulsar -
        timeout - timeout for unloading bundle. It doesn't throw exception if it times out while waiting on closing all topics
        timeoutUnit -
        Throws:
        java.lang.Exception
      • isActive

        public boolean isActive()
        Access method to the namespace state to check whether the namespace is active or not.
        Returns:
        boolean value indicate that the namespace is active or not.
      • setActive

        public void setActive​(boolean active)