eolivelli commented on code in PR #18949:
URL: https://github.com/apache/pulsar/pull/18949#discussion_r1051893596
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadData.java:
##########
@@ -64,11 +66,22 @@ public Map<String, BundleData> getBundleData() {
public Map<String, BundleData> getBundleDataForLoadShedding() {
return bundleData.entrySet().stream()
- .filter(e -> !NamespaceService.isSystemServiceNamespace(
+ .filter(e -> !filterNamespaceForShedding(
NamespaceBundle.getBundleNamespace(e.getKey())))
.collect(Collectors.toMap(Map.Entry::getKey,
Map.Entry::getValue));
}
+ /**
+ * used for filtering bundles in special namespace.
+ * @param namespace Namespace
+ * @return True if namespace is HEARTBEAT_NAMESPACE or SLA_NAMESPACE
+ */
+ public static boolean filterNamespaceForShedding(String namespace) {
Review Comment:
we should keep this logic near to NamespaceService.isSystemServiceNamespace
otherwise if we add other special namespaces it will be easy to forget
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]