Technoboy- commented on a change in pull request #14671:
URL: https://github.com/apache/pulsar/pull/14671#discussion_r825568455



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -2781,8 +2782,30 @@ private AutoSubscriptionCreationOverride 
getAutoSubscriptionCreationOverride(fin
         log.debug("No autoSubscriptionCreateOverride policy found for {}", 
topicName);
         return null;
     }
-    private boolean isSystemTopic(String topic) {
-        return SystemTopicClient.isSystemTopic(TopicName.get(topic));
+
+    public boolean isSystemTopic(String topic) {
+        return isSystemTopic(TopicName.get(topic));
+    }
+
+    public boolean isSystemTopic(TopicName topicName) {
+        if 
(topicName.getNamespaceObject().equals(NamespaceName.SYSTEM_NAMESPACE)) {
+            return true;
+        }
+
+        TopicName nonePartitionedTopicName = 
TopicName.get(topicName.getPartitionedTopicName());
+
+        // event topic
+        if 
(EventsTopicNames.checkTopicIsEventsNames(nonePartitionedTopicName)) {
+            return true;
+        }
+
+        String localName = nonePartitionedTopicName.getLocalName();
+        // transaction pending ack topic
+        if (StringUtils.endsWith(localName, 
MLPendingAckStore.PENDING_ACK_STORE_SUFFIX)) {
+            return true;
+        }
+        return 
topicName.getNamespaceObject().equals(pulsar.getHeartbeatNamespaceV1())

Review comment:
       Yes, right. Updated.




-- 
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]


Reply via email to