Class NamespaceBundleFactory

java.lang.Object
org.apache.pulsar.common.naming.NamespaceBundleFactory

public class NamespaceBundleFactory extends Object
  • Constructor Details

    • NamespaceBundleFactory

      public NamespaceBundleFactory(PulsarService pulsar, com.google.common.hash.HashFunction hashFunc)
  • Method Details

    • invalidateBundleCache

      public void invalidateBundleCache(org.apache.pulsar.common.naming.NamespaceName namespace)
    • getBundlesAsync

      public CompletableFuture<NamespaceBundles> getBundlesAsync(org.apache.pulsar.common.naming.NamespaceName nsname)
    • getBundleWithHighestTopics

      public NamespaceBundle getBundleWithHighestTopics(org.apache.pulsar.common.naming.NamespaceName nsname)
    • getBundleWithHighestTopicsAsync

      public CompletableFuture<NamespaceBundle> getBundleWithHighestTopicsAsync(org.apache.pulsar.common.naming.NamespaceName nsname)
    • getBundle

      public NamespaceBundle getBundle(org.apache.pulsar.common.naming.TopicName topic)
    • getBundleWithHighestThroughput

      public NamespaceBundle getBundleWithHighestThroughput(org.apache.pulsar.common.naming.NamespaceName nsName)
    • getBundles

      public NamespaceBundles getBundles(org.apache.pulsar.common.naming.NamespaceName nsname)
    • getBundlesIfPresent

      public Optional<NamespaceBundles> getBundlesIfPresent(org.apache.pulsar.common.naming.NamespaceName nsname)
    • getBundle

      public NamespaceBundle getBundle(org.apache.pulsar.common.naming.NamespaceName nsname, com.google.common.collect.Range<Long> hashRange)
    • getBundle

      public NamespaceBundle getBundle(String namespace, String bundleRange)
    • getFullBundle

      public NamespaceBundle getFullBundle(org.apache.pulsar.common.naming.NamespaceName fqnn) throws Exception
      Throws:
      Exception
    • getFullBundleAsync

      public CompletableFuture<NamespaceBundle> getFullBundleAsync(org.apache.pulsar.common.naming.NamespaceName fqnn)
    • getLongHashCode

      public long getLongHashCode(String name)
    • getBundles

      public NamespaceBundles getBundles(org.apache.pulsar.common.naming.NamespaceName nsname, org.apache.pulsar.common.policies.data.BundlesData bundleData)
    • splitBundles

      public CompletableFuture<org.apache.commons.lang3.tuple.Pair<NamespaceBundles,List<NamespaceBundle>>> splitBundles(NamespaceBundle targetBundle, int argNumBundles, List<Long> splitBoundaries)
      Fetches NamespaceBundles from cache for a given namespace. finds target bundle, split into numBundles and returns new NamespaceBundles with newly split bundles into it.
      Parameters:
      targetBundle - NamespaceBundle needs to be split
      argNumBundles - split into numBundles
      splitBoundaries - split into multi numBundles by the given split boundaries. All these given split boundaries must between the key range of the given split bundle.
      Returns:
      List of split NamespaceBundle and NamespaceBundles that contains final bundles including split bundles for a given namespace
    • canSplitBundle

      public boolean canSplitBundle(NamespaceBundle bundle)
    • validateFullRange

      public static void validateFullRange(SortedSet<String> partitions)
    • createFactory

      public static NamespaceBundleFactory createFactory(PulsarService pulsar, com.google.common.hash.HashFunction hashFunc)
    • isFullBundle

      public static boolean isFullBundle(String bundleRange)
    • getDefaultBundleRange

      public static String getDefaultBundleRange()
    • getNamespaceFromPoliciesPath

      public static String getNamespaceFromPoliciesPath(String path)