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/02/07 10:31:10 UTC

[GitHub] [pulsar] BewareMyPower opened a new pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

BewareMyPower opened a new pull request #9520:
URL: https://github.com/apache/pulsar/pull/9520


   Fixes #9449 
   
   ### Motivation
   
   This is a catchup work for https://github.com/apache/pulsar/pull/5716 that supports multiple topic subscriptions across multiple namespaces.
   
   ### Modifications
   
   - Move the check for namespace in `MultiTopicsConsumerImpl` to `PatternMultiTopicsConsumerImpl` that uses a regex subscription.
   - Fix the existed tests for subscription on topics across different namespaces.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is already covered by existing tests, such as *BasicEndToEndTest.testMultiTopicsConsumerDifferentNamespace*.


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

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



[GitHub] [pulsar] BewareMyPower commented on pull request #9520: [WIP][C++] Remove namespace check for MultiTopicsConsumerImpl

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


   I found there's an existed Python test for multiple topics, I'll fix the test.


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

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



[GitHub] [pulsar] BewareMyPower commented on a change in pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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



##########
File path: pulsar-client-cpp/lib/PatternMultiTopicsConsumerImpl.cc
##########
@@ -33,7 +33,9 @@ PatternMultiTopicsConsumerImpl::PatternMultiTopicsConsumerImpl(ClientImplPtr cli
       patternString_(pattern),
       pattern_(std::regex(pattern)),
       autoDiscoveryTimer_(),
-      autoDiscoveryRunning_(false) {}
+      autoDiscoveryRunning_(false) {
+    namespaceName_ = TopicName::get(pattern)->getNamespaceName();
+}

Review comment:
       Did you mean code format?




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

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



[GitHub] [pulsar] BewareMyPower commented on a change in pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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



##########
File path: pulsar-client-cpp/lib/PatternMultiTopicsConsumerImpl.cc
##########
@@ -33,7 +33,9 @@ PatternMultiTopicsConsumerImpl::PatternMultiTopicsConsumerImpl(ClientImplPtr cli
       patternString_(pattern),
       pattern_(std::regex(pattern)),
       autoDiscoveryTimer_(),
-      autoDiscoveryRunning_(false) {}
+      autoDiscoveryRunning_(false) {
+    namespaceName_ = TopicName::get(pattern)->getNamespaceName();
+}

Review comment:
       The C++ code format check automatically by CI, which uses `clang-format` and the `pulsar-client-cpp/.clang-format` to check the code style.




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

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



[GitHub] [pulsar] zymap commented on a change in pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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



##########
File path: pulsar-client-cpp/lib/PatternMultiTopicsConsumerImpl.cc
##########
@@ -33,7 +33,9 @@ PatternMultiTopicsConsumerImpl::PatternMultiTopicsConsumerImpl(ClientImplPtr cli
       patternString_(pattern),
       pattern_(std::regex(pattern)),
       autoDiscoveryTimer_(),
-      autoDiscoveryRunning_(false) {}
+      autoDiscoveryRunning_(false) {
+    namespaceName_ = TopicName::get(pattern)->getNamespaceName();
+}

Review comment:
       okay




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

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



[GitHub] [pulsar] BewareMyPower commented on pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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


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

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



[GitHub] [pulsar] zymap commented on a change in pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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



##########
File path: pulsar-client-cpp/lib/PatternMultiTopicsConsumerImpl.cc
##########
@@ -33,7 +33,9 @@ PatternMultiTopicsConsumerImpl::PatternMultiTopicsConsumerImpl(ClientImplPtr cli
       patternString_(pattern),
       pattern_(std::regex(pattern)),
       autoDiscoveryTimer_(),
-      autoDiscoveryRunning_(false) {}
+      autoDiscoveryRunning_(false) {
+    namespaceName_ = TopicName::get(pattern)->getNamespaceName();
+}

Review comment:
       Yes. The indent looks weird.




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

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



[GitHub] [pulsar] zymap commented on a change in pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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



##########
File path: pulsar-client-cpp/lib/PatternMultiTopicsConsumerImpl.cc
##########
@@ -33,7 +33,9 @@ PatternMultiTopicsConsumerImpl::PatternMultiTopicsConsumerImpl(ClientImplPtr cli
       patternString_(pattern),
       pattern_(std::regex(pattern)),
       autoDiscoveryTimer_(),
-      autoDiscoveryRunning_(false) {}
+      autoDiscoveryRunning_(false) {
+    namespaceName_ = TopicName::get(pattern)->getNamespaceName();
+}

Review comment:
       Wrong format?




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

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



[GitHub] [pulsar] BewareMyPower commented on pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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


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

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



[GitHub] [pulsar] BewareMyPower commented on pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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


   And I've a question. Should we also add tests for Python client? Since it only affects `Client::subscribe` API and there're no related tests in Python tests before. 


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

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



[GitHub] [pulsar] BewareMyPower commented on pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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


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

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



[GitHub] [pulsar] sijie merged pull request #9520: [C++] Remove namespace check for MultiTopicsConsumerImpl

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


   


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

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