Class BundleRangeCache
java.lang.Object
org.apache.pulsar.broker.loadbalance.impl.BundleRangeCache
The cache for the bundle ranges.
The first key is the broker id and the second key is the namespace name, the value is the set of bundle ranges of
that namespace. When the broker key is accessed if the associated value is not present, an empty map will be created
as the initial value that will never be removed.
Therefore, for each broker, there could only be one internal map during the whole lifetime. Then it will be safe
to apply the synchronized key word on the value for thread safe operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGet the map whose key is the broker and value is the namespace that has at least 1 cached bundle range.intgetBundleRangeCount(String broker, String namespace) voidreloadFromBundles(String broker, Stream<String> bundles)
-
Constructor Details
-
BundleRangeCache
public BundleRangeCache()
-
-
Method Details
-
reloadFromBundles
-
add
-
getBundleRangeCount
-
getBrokerToNamespacesMap
Get the map whose key is the broker and value is the namespace that has at least 1 cached bundle range.
-