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 2021/08/03 13:04:29 UTC

[GitHub] [pulsar] wuzhanpeng opened a new pull request #11545: add test for auto-created partitioned system topic

wuzhanpeng opened a new pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545


   ### Motivations
   When I tried to enable topic-level policy, I found that the tests for interacting with partitioned system topic (e.g. `__change_events`) was not very sufficient, so I added a test for using auto-created partitioned system topic.
   
   ### Modifications
   - add a test for partitioned system topic
   - make a small optimization in `EventsTopicNames#checkTopicIsEventsNames` to avoid unnecessary inspections (based on #10850 )


-- 
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] wuzhanpeng commented on pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
wuzhanpeng commented on pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#issuecomment-892294822


   /pulsarbot run-failure-checks


-- 
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] wuzhanpeng commented on pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
wuzhanpeng commented on pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#issuecomment-893126079


   > Thanks for your contribution. For this PR, do we need to update docs?
   > 
   > (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
   
   Sorry for missing some descriptions. This PR does not need to update docs.
   
   Dependencies (does it add or upgrade a dependency): no
   The public API: no
   The schema: no
   The default values of configurations: no
   The wire protocol: no
   The rest endpoints: no
   The admin cli options: no
   Anything that affects deployment: no


-- 
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] wuzhanpeng commented on pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
wuzhanpeng commented on pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#issuecomment-892320076


   /pulsarbot run-failure-checks


-- 
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] wuzhanpeng commented on pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
wuzhanpeng commented on pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#issuecomment-893126079


   > Thanks for your contribution. For this PR, do we need to update docs?
   > 
   > (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
   
   Sorry for missing some descriptions. This PR does not need to update docs.
   
   Dependencies (does it add or upgrade a dependency): no
   The public API: no
   The schema: no
   The default values of configurations: no
   The wire protocol: no
   The rest endpoints: no
   The admin cli options: no
   Anything that affects deployment: no


-- 
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] codelipenghui merged pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545


   


-- 
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] wuzhanpeng commented on a change in pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
wuzhanpeng commented on a change in pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#discussion_r682259194



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/events/EventsTopicNames.java
##########
@@ -45,12 +45,6 @@
             Collections.unmodifiableSet(Sets.newHashSet(NAMESPACE_EVENTS_LOCAL_NAME, TRANSACTION_BUFFER_SNAPSHOT));
 
     public static boolean checkTopicIsEventsNames(TopicName topicName) {
-        String name;
-        if (topicName.isPartitioned()) {
-            name = TopicName.get(topicName.getPartitionedTopicName()).getLocalName();
-        } else {
-            name = topicName.getLocalName();
-        }
-        return EVENTS_TOPIC_NAMES.contains(name);
+        return EVENTS_TOPIC_NAMES.contains(TopicName.get(topicName.getPartitionedTopicName()).getLocalName());

Review comment:
       `TopicName#getPartitionedTopicName` will check whether `topic` is partitioned and give the corresponding solution to handle these two situations. That’s why I did this simplification.




-- 
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] Anonymitaet commented on pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#issuecomment-893057027


   Thanks for your contribution. For this PR, do we need to update docs?
   
   (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks) 
   


-- 
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] codelipenghui commented on pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#issuecomment-893382253


   @315157973 Could you please check the @wuzhanpeng's comment?


-- 
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] Anonymitaet commented on pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#issuecomment-893057027


   Thanks for your contribution. For this PR, do we need to update docs?
   
   (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks) 
   


-- 
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] 315157973 commented on a change in pull request #11545: add test for auto-created partitioned system topic

Posted by GitBox <gi...@apache.org>.
315157973 commented on a change in pull request #11545:
URL: https://github.com/apache/pulsar/pull/11545#discussion_r682255373



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/events/EventsTopicNames.java
##########
@@ -45,12 +45,6 @@
             Collections.unmodifiableSet(Sets.newHashSet(NAMESPACE_EVENTS_LOCAL_NAME, TRANSACTION_BUFFER_SNAPSHOT));
 
     public static boolean checkTopicIsEventsNames(TopicName topicName) {
-        String name;
-        if (topicName.isPartitioned()) {
-            name = TopicName.get(topicName.getPartitionedTopicName()).getLocalName();
-        } else {
-            name = topicName.getLocalName();
-        }
-        return EVENTS_TOPIC_NAMES.contains(name);
+        return EVENTS_TOPIC_NAMES.contains(TopicName.get(topicName.getPartitionedTopicName()).getLocalName());

Review comment:
       Please add a unit test to cover partitionedTopic and non-partitionedTopic




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