public class NamespaceBundleFactory extends Object
| Constructor and Description |
|---|
NamespaceBundleFactory(PulsarService pulsar,
com.google.common.hash.HashFunction hashFunc) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSplitBundle(NamespaceBundle bundle) |
static NamespaceBundleFactory |
createFactory(PulsarService pulsar,
com.google.common.hash.HashFunction hashFunc) |
NamespaceBundle |
getBundle(org.apache.pulsar.common.naming.NamespaceName nsname,
com.google.common.collect.Range<Long> hashRange) |
NamespaceBundle |
getBundle(String namespace,
String bundleRange) |
NamespaceBundles |
getBundles(org.apache.pulsar.common.naming.NamespaceName nsname) |
NamespaceBundles |
getBundles(org.apache.pulsar.common.naming.NamespaceName nsname,
org.apache.pulsar.common.policies.data.BundlesData bundleData) |
CompletableFuture<NamespaceBundles> |
getBundlesAsync(org.apache.pulsar.common.naming.NamespaceName nsname) |
Optional<NamespaceBundles> |
getBundlesIfPresent(org.apache.pulsar.common.naming.NamespaceName nsname) |
NamespaceBundle |
getBundlesWithHighestTopics(org.apache.pulsar.common.naming.NamespaceName nsname) |
CompletableFuture<NamespaceBundle> |
getBundlesWithHighestTopicsAsync(org.apache.pulsar.common.naming.NamespaceName nsname) |
static String |
getDefaultBundleRange() |
NamespaceBundle |
getFullBundle(org.apache.pulsar.common.naming.NamespaceName fqnn) |
CompletableFuture<NamespaceBundle> |
getFullBundleAsync(org.apache.pulsar.common.naming.NamespaceName fqnn) |
long |
getLongHashCode(String name) |
static String |
getNamespaceFromPoliciesPath(String path) |
void |
invalidateBundleCache(org.apache.pulsar.common.naming.NamespaceName namespace) |
static boolean |
isFullBundle(String bundleRange) |
CompletableFuture<org.apache.commons.lang3.tuple.Pair<NamespaceBundles,List<NamespaceBundle>>> |
splitBundles(NamespaceBundle targetBundle,
int argNumBundles,
Long splitBoundary)
Fetches
NamespaceBundles from cache for a given namespace. |
static void |
validateFullRange(SortedSet<String> partitions) |
public NamespaceBundleFactory(PulsarService pulsar, com.google.common.hash.HashFunction hashFunc)
public void invalidateBundleCache(org.apache.pulsar.common.naming.NamespaceName namespace)
public CompletableFuture<NamespaceBundles> getBundlesAsync(org.apache.pulsar.common.naming.NamespaceName nsname)
public NamespaceBundle getBundlesWithHighestTopics(org.apache.pulsar.common.naming.NamespaceName nsname)
public CompletableFuture<NamespaceBundle> getBundlesWithHighestTopicsAsync(org.apache.pulsar.common.naming.NamespaceName nsname)
public NamespaceBundles getBundles(org.apache.pulsar.common.naming.NamespaceName nsname)
public Optional<NamespaceBundles> getBundlesIfPresent(org.apache.pulsar.common.naming.NamespaceName nsname)
public NamespaceBundle getBundle(org.apache.pulsar.common.naming.NamespaceName nsname, com.google.common.collect.Range<Long> hashRange)
public NamespaceBundle getBundle(String namespace, String bundleRange)
public NamespaceBundle getFullBundle(org.apache.pulsar.common.naming.NamespaceName fqnn) throws Exception
Exceptionpublic CompletableFuture<NamespaceBundle> getFullBundleAsync(org.apache.pulsar.common.naming.NamespaceName fqnn)
public long getLongHashCode(String name)
public NamespaceBundles getBundles(org.apache.pulsar.common.naming.NamespaceName nsname, org.apache.pulsar.common.policies.data.BundlesData bundleData)
public CompletableFuture<org.apache.commons.lang3.tuple.Pair<NamespaceBundles,List<NamespaceBundle>>> splitBundles(NamespaceBundle targetBundle, int argNumBundles, Long splitBoundary)
NamespaceBundles from cache for a given namespace. finds target bundle, split into numBundles and
returns new NamespaceBundles with newly split bundles into it.targetBundle - NamespaceBundle needs to be splitargNumBundles - split into numBundlessplitBoundary - split into 2 numBundles by the given split key. The given split key must between the key range of the
given split bundle.NamespaceBundle and NamespaceBundles that contains final bundles including
split bundles for a given namespacepublic boolean canSplitBundle(NamespaceBundle bundle)
public static NamespaceBundleFactory createFactory(PulsarService pulsar, com.google.common.hash.HashFunction hashFunc)
public static boolean isFullBundle(String bundleRange)
public static String getDefaultBundleRange()
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.