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) |
NamespaceBundle |
getBundle(org.apache.pulsar.common.naming.TopicName topic) |
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 |
getBundleWithHighestThroughput(org.apache.pulsar.common.naming.NamespaceName nsName) |
NamespaceBundle |
getBundleWithHighestTopics(org.apache.pulsar.common.naming.NamespaceName nsname) |
CompletableFuture<NamespaceBundle> |
getBundleWithHighestTopicsAsync(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,
List<Long> splitBoundaries)
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 getBundleWithHighestTopics(org.apache.pulsar.common.naming.NamespaceName nsname)
public CompletableFuture<NamespaceBundle> getBundleWithHighestTopicsAsync(org.apache.pulsar.common.naming.NamespaceName nsname)
public NamespaceBundle getBundle(org.apache.pulsar.common.naming.TopicName topic)
public NamespaceBundle getBundleWithHighestThroughput(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, List<Long> splitBoundaries)
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 numBundlessplitBoundaries - split into multi numBundles by the given split boundaries. All these given split boundaries 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.