Package org.apache.pulsar.common.naming
Class NamespaceBundleFactory
java.lang.Object
org.apache.pulsar.common.naming.NamespaceBundleFactory
-
Constructor Summary
ConstructorsConstructorDescriptionNamespaceBundleFactory(PulsarService pulsar, com.google.common.hash.HashFunction hashFunc) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSplitBundle(NamespaceBundle bundle) static NamespaceBundleFactorycreateFactory(PulsarService pulsar, com.google.common.hash.HashFunction hashFunc) getBundle(org.apache.pulsar.common.naming.NamespaceName nsname, com.google.common.collect.Range<Long> hashRange) getBundle(org.apache.pulsar.common.naming.TopicName topic) getBundles(org.apache.pulsar.common.naming.NamespaceName nsname) getBundles(org.apache.pulsar.common.naming.NamespaceName nsname, org.apache.pulsar.common.policies.data.BundlesData bundleData) getBundlesAsync(org.apache.pulsar.common.naming.NamespaceName nsname) getBundlesIfPresent(org.apache.pulsar.common.naming.NamespaceName nsname) getBundleWithHighestThroughput(org.apache.pulsar.common.naming.NamespaceName nsName) getBundleWithHighestTopics(org.apache.pulsar.common.naming.NamespaceName nsname) getBundleWithHighestTopicsAsync(org.apache.pulsar.common.naming.NamespaceName nsname) static StringgetFullBundle(org.apache.pulsar.common.naming.NamespaceName fqnn) getFullBundleAsync(org.apache.pulsar.common.naming.NamespaceName fqnn) longgetLongHashCode(String name) static StringvoidinvalidateBundleCache(org.apache.pulsar.common.naming.NamespaceName namespace) static booleanisFullBundle(String bundleRange) CompletableFuture<org.apache.commons.lang3.tuple.Pair<NamespaceBundles,List<NamespaceBundle>>> splitBundles(NamespaceBundle targetBundle, int argNumBundles, List<Long> splitBoundaries) FetchesNamespaceBundlesfrom cache for a given namespace.static voidvalidateFullRange(SortedSet<String> partitions)
-
Constructor Details
-
NamespaceBundleFactory
-
-
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
-
getBundleWithHighestThroughput
public NamespaceBundle getBundleWithHighestThroughput(org.apache.pulsar.common.naming.NamespaceName nsName) -
getBundles
-
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
-
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
-
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) FetchesNamespaceBundlesfrom cache for a given namespace. finds target bundle, split into numBundles and returns newNamespaceBundleswith newly split bundles into it.- Parameters:
targetBundle-NamespaceBundleneeds 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.- Returns:
- List of split
NamespaceBundleandNamespaceBundlesthat contains final bundles including split bundles for a given namespace
-
canSplitBundle
-
validateFullRange
-
createFactory
public static NamespaceBundleFactory createFactory(PulsarService pulsar, com.google.common.hash.HashFunction hashFunc) -
isFullBundle
-
getDefaultBundleRange
-
getNamespaceFromPoliciesPath
-