You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/01/17 15:52:59 UTC

[GitHub] [pulsar] mattisonchao opened a new issue #13794: [ PIP-137 ] Add ``SystemTopicNameManager`` to manage system topic names.

mattisonchao opened a new issue #13794:
URL: https://github.com/apache/pulsar/issues/13794


   ## Motivation
   
   - The current system topic names are scattered and difficult to maintain and dynamically configure.
   
   See SystemTopicClient.class 193 line.
   
   ```java
   public interface SystemTopicClient<T> {
     //   omit some code
       static 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;
           }
           // health check topic
           if (StringUtils.endsWith(localName, BrokersBase.HEALTH_CHECK_TOPIC_SUFFIX)){
               return true;
           }
           return false;
       }
   
   }
   ```
   Every time a SystemTopic is added, it must be defined here.
   
    - Some **Apache Pulsar** extensions such as ``Protocol Handler`` cannot create namespace-level SystemTopic.
   
   ## Goal
   
   Add ``SystemTopicNameManager``  to manage all system topic names. And can accept dynamic registration.
   
   ## API Changes
   
   none.
   
   ## Implementation
   
   > SystemTopicNameManager
   
   ```java
   
   package org.apache.pulsar.broker.service;
   
   public interface SystemTopicNameManager {
   
       // The default is full quality topicName
       void register(TopicName topicName);
   
       // judgement this topic name if is a system topic
       boolean isSystemTopic(TopicName topicName);
   
   }
   ```
   This manager can be used for dynamic registration.
   
   ## Reject Alternatives
   
   none.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] mattisonchao closed issue #13794: [ PIP-137 ] Add ``SystemTopicNameManager`` to manage system topic names.

Posted by GitBox <gi...@apache.org>.
mattisonchao closed issue #13794:
URL: https://github.com/apache/pulsar/issues/13794


   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org