[GitHub] jiazhai commented on issue #2164: Offload: track jclouds release update for JCLOUDS-1166

2018-08-04 Thread GitBox
jiazhai commented on issue #2164: Offload: track jclouds release update for 
JCLOUDS-1166 
URL: 
https://github.com/apache/incubator-pulsar/issues/2164#issuecomment-410440848
 
 
   asked on twitter, jclouds will have a release 2.1.1 in next week.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-pulsar] branch asf-site updated: Updated site at revision 28fe0a1

2018-08-04 Thread mmerli
This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/asf-site by this push:
 new cf09773  Updated site at revision 28fe0a1
cf09773 is described below

commit cf0977389f922345ca20dadf598467652559949f
Author: jenkins 
AuthorDate: Sat Aug 4 08:33:16 2018 +

Updated site at revision 28fe0a1
---
 .../api/cpp/classpulsar_1_1_client-members.html|  6 +-
 content/api/cpp/classpulsar_1_1_client.html| 80 +-
 ...spulsar_1_1_consumer_configuration-members.html | 30 
 .../classpulsar_1_1_consumer_configuration.html| 28 
 content/api/cpp/functions.html |  9 +++
 content/api/cpp/functions_func.html|  9 +++
 content/api/cpp/search/all_c.js|  5 +-
 content/api/cpp/search/functions_b.js  |  5 +-
 content/css/main.css   |  2 +-
 .../docs/latest/adaptors/PulsarSpark/index.html|  8 +--
 .../docs/latest/adaptors/PulsarStorm/index.html|  6 +-
 content/docs/latest/admin-api/overview/index.html  | 10 +--
 content/docs/latest/clients/Cpp/index.html |  8 +--
 content/docs/latest/clients/Java/index.html| 14 ++--
 content/docs/latest/clients/Python/index.html  | 10 +--
 content/docs/latest/clients/WebSocket/index.html   |  8 +--
 content/docs/latest/clients/go/index.html  |  6 +-
 .../docs/latest/cookbooks/Encryption/index.html|  6 +-
 .../latest/cookbooks/PartitionedTopics/index.html  | 14 ++--
 .../latest/cookbooks/RetentionExpiry/index.html| 14 ++--
 .../docs/latest/cookbooks/compaction/index.html|  6 +-
 .../cookbooks/message-deduplication/index.html | 10 +--
 .../docs/latest/cookbooks/message-queue/index.html | 14 ++--
 .../latest/cookbooks/tiered-storage/index.html |  4 +-
 .../docs/latest/deployment/Kubernetes/index.html   |  4 +-
 .../docs/latest/deployment/aws-cluster/index.html  |  4 +-
 content/docs/latest/deployment/cluster/index.html  |  4 +-
 content/docs/latest/deployment/instance/index.html |  4 +-
 .../ConceptsAndArchitecture/index.html |  4 +-
 .../latest/getting-started/LocalCluster/index.html |  4 +-
 .../latest/getting-started/Pulsar-2.0/index.html   |  2 +-
 .../docs/latest/getting-started/docker/index.html  |  4 +-
 .../docs/latest/project/BinaryProtocol/index.html  |  4 +-
 content/docs/latest/project/CompileCpp/index.html  |  8 +--
 .../docs/latest/project/SimulationTools/index.html |  2 +-
 .../docs/latest/project/schema-storage/index.html  |  4 +-
 content/docs/latest/reference/CliTools/index.html  | 18 ++---
 .../docs/latest/security/authorization/index.html  | 10 +--
 content/docs/latest/security/encryption/index.html |  6 +-
 content/ja/adaptors/PulsarSpark/index.html |  8 +--
 content/ja/adaptors/PulsarStorm/index.html |  6 +-
 content/ja/admin/AdminInterface/index.html | 12 ++--
 content/ja/admin/Authz/index.html  | 12 ++--
 content/ja/admin/ClustersBrokers/index.html|  6 +-
 content/ja/admin/PropertiesNamespaces/index.html   |  6 +-
 content/ja/advanced/PartitionedTopics/index.html   | 12 ++--
 content/ja/advanced/RetentionExpiry/index.html | 12 ++--
 content/ja/clients/Cpp/index.html  |  6 +-
 content/ja/clients/Java/index.html |  8 +--
 content/ja/clients/Python/index.html   |  8 +--
 content/ja/clients/WebSocket/index.html|  8 +--
 content/ja/deployment/InstanceSetup/index.html |  6 +-
 content/ja/deployment/Kubernetes/index.html|  4 +-
 .../ConceptsAndArchitecture/index.html |  2 +-
 content/ja/getting-started/LocalCluster/index.html |  4 +-
 content/ja/project/BinaryProtocol/index.html   |  4 +-
 content/ja/project/SimulationTools/index.html  |  2 +-
 content/ja/reference/CliTools/index.html   | 18 ++---
 content/swagger/swagger.json   | 28 
 59 files changed, 350 insertions(+), 216 deletions(-)

diff --git a/content/api/cpp/classpulsar_1_1_client-members.html 
b/content/api/cpp/classpulsar_1_1_client-members.html
index 6fd4fb8..e44348f 100644
--- a/content/api/cpp/classpulsar_1_1_client-members.html
+++ b/content/api/cpp/classpulsar_1_1_client-members.html
@@ -110,12 +110,16 @@ var searchBox = new SearchBox("searchBox", 
"search",false,'Search');
   shutdown() 
(defined in pulsar::Client)pulsar::Client
   subscribe(const std::string 
topic, const std::string consumerName, Consumer consumer) 
(defined in pulsar::Client)pulsar::Client
   subscribe(const 
std::string topic, const std::string consumerName, const 
ConsumerConfiguration conf, Consumer consumer) (defined in pulsar::Client)pulsar::Client
-  subscribe(const 
std::vector std::string  topics, const std::string 
subscriptionName, Consumer consumer) (defined in 

[GitHub] jiazhai opened a new issue #2312: python client support for multi-topics-consumer

2018-08-04 Thread GitBox
jiazhai opened a new issue #2312: python client support for 
multi-topics-consumer
URL: https://github.com/apache/incubator-pulsar/issues/2312
 
 
   Since we have already provide cpp client support for multi-topics-consumer 
and regex-topics support, we should add the support in python


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jiazhai opened a new pull request #2311: Catch up receiver queue size config in multi-topics-consumer

2018-08-04 Thread GitBox
jiazhai opened a new pull request #2311: Catch up receiver queue size config in 
multi-topics-consumer
URL: https://github.com/apache/incubator-pulsar/pull/2311
 
 
   ### Motivation
   
   In PR #1123, we add a configuration of  max producer/consumer queue size 
enforced across partitions
   This is an catch up work to support in multi-topics-consumer.
   
   ### Modifications
   
   Apply total limit of receiver queue size across partitions
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jiazhai removed a comment on issue #2308: [blog] Enable blog in website and add one for 2.1.0 release

2018-08-04 Thread GitBox
jiazhai removed a comment on issue #2308: [blog] Enable blog in website and add 
one for 2.1.0 release
URL: https://github.com/apache/incubator-pulsar/pull/2308#issuecomment-410429911
 
 
   rerun java tests


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jiazhai commented on issue #2308: [blog] Enable blog in website and add one for 2.1.0 release

2018-08-04 Thread GitBox
jiazhai commented on issue #2308: [blog] Enable blog in website and add one for 
2.1.0 release
URL: https://github.com/apache/incubator-pulsar/pull/2308#issuecomment-410429911
 
 
   rerun java tests


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jiazhai commented on issue #2308: [blog] Enable blog in website and add one for 2.1.0 release

2018-08-04 Thread GitBox
jiazhai commented on issue #2308: [blog] Enable blog in website and add one for 
2.1.0 release
URL: https://github.com/apache/incubator-pulsar/pull/2308#issuecomment-410429942
 
 
   retest this please


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-pulsar] branch master updated: [website] fix css problem on languages menu (#2306)

2018-08-04 Thread zhaijia
This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new 28fe0a1  [website] fix css problem on languages menu (#2306)
28fe0a1 is described below

commit 28fe0a174c38bb57e11e0ca9706893c294b4df42
Author: Sijie Guo 
AuthorDate: Sat Aug 4 00:12:59 2018 -0700

[website] fix css problem on languages menu (#2306)

### Problem

The languages menu is not displayed properly.

### Changes

Add language menu to custom css file.
---
 site2/website/static/css/custom.css | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/site2/website/static/css/custom.css 
b/site2/website/static/css/custom.css
index 2830e81..fc89652 100644
--- a/site2/website/static/css/custom.css
+++ b/site2/website/static/css/custom.css
@@ -62,25 +62,29 @@
 
 /* for drop down menus */
 #community-dropdown.hide,
-#apache-dropdown.hide {
+#apache-dropdown.hide,
+#languages-dropdown.hide {
   display: none;
 }
 
 
 #community-dropdown.visible,
-#apache-dropdown.visible {
+#apache-dropdown.visible,
+#languages-dropdown.visible {
   display: flex;
 }
 
 #community-dropdown,
-#apache-dropdown {
+#apache-dropdown,
+#languages-dropdown {
   pointer-events: none;
   position: absolute;
   width: 100%;
 }
 
 #community-dropdown-items,
-#apache-dropdown-items {
+#apache-dropdown-items,
+#languages-dropdown-items {
   background-color: white;
   display: flex;
   flex-direction: column;



[incubator-pulsar] branch master updated: Add Example functions (#2305)

2018-08-04 Thread zhaijia
This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new 04d6234  Add Example functions (#2305)
04d6234 is described below

commit 04d62345bc4db147ef262b0be07524a57b11fa60
Author: Ali Ahmed 
AuthorDate: Sat Aug 4 00:10:49 2018 -0700

Add Example functions (#2305)

We add 2 more examples pulsar functions.
---
 .../api/examples/InstanceIdAppenderFunction.java   | 34 ++
 .../api/examples/IntegerAdditionFunction.java  | 34 ++
 2 files changed, 68 insertions(+)

diff --git 
a/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/InstanceIdAppenderFunction.java
 
b/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/InstanceIdAppenderFunction.java
new file mode 100644
index 000..0a56386
--- /dev/null
+++ 
b/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/InstanceIdAppenderFunction.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.functions.api.examples;
+
+import org.apache.pulsar.functions.api.Context;
+import org.apache.pulsar.functions.api.Function;
+
+/**
+ * Function that appends the instance id to the payload message
+ */
+public class InstanceIdAppenderFunction implements Function {
+
+@Override
+public String process(String input, Context context) {
+return input + context.getInstanceId();
+}
+}
+
diff --git 
a/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/IntegerAdditionFunction.java
 
b/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/IntegerAdditionFunction.java
new file mode 100644
index 000..d6e8276
--- /dev/null
+++ 
b/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/IntegerAdditionFunction.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.functions.api.examples;
+
+import org.apache.pulsar.functions.api.Context;
+import org.apache.pulsar.functions.api.Function;
+
+/**
+ * Function that appends to an integer input value and outputs the new value
+ */
+public class IntegerAdditionFunction implements Function {
+
+@Override
+public Integer process(Integer input, Context context) {
+return input + 100;
+}
+}
+



[GitHub] jiazhai closed pull request #2305: Add Example functions

2018-08-04 Thread GitBox
jiazhai closed pull request #2305: Add Example functions
URL: https://github.com/apache/incubator-pulsar/pull/2305
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/InstanceIdAppenderFunction.java
 
b/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/InstanceIdAppenderFunction.java
new file mode 100644
index 00..0a5638670c
--- /dev/null
+++ 
b/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/InstanceIdAppenderFunction.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.functions.api.examples;
+
+import org.apache.pulsar.functions.api.Context;
+import org.apache.pulsar.functions.api.Function;
+
+/**
+ * Function that appends the instance id to the payload message
+ */
+public class InstanceIdAppenderFunction implements Function {
+
+@Override
+public String process(String input, Context context) {
+return input + context.getInstanceId();
+}
+}
+
diff --git 
a/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/IntegerAdditionFunction.java
 
b/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/IntegerAdditionFunction.java
new file mode 100644
index 00..d6e8276255
--- /dev/null
+++ 
b/pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/IntegerAdditionFunction.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.functions.api.examples;
+
+import org.apache.pulsar.functions.api.Context;
+import org.apache.pulsar.functions.api.Function;
+
+/**
+ * Function that appends to an integer input value and outputs the new value
+ */
+public class IntegerAdditionFunction implements Function {
+
+@Override
+public Integer process(Integer input, Context context) {
+return input + 100;
+}
+}
+


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jiazhai closed pull request #2219: Cpp client: add PatternMultiTopicsConsumerImpl to support regex subscribe

2018-08-04 Thread GitBox
jiazhai closed pull request #2219: Cpp client: add 
PatternMultiTopicsConsumerImpl to support regex subscribe
URL: https://github.com/apache/incubator-pulsar/pull/2219
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-client-cpp/include/pulsar/Client.h 
b/pulsar-client-cpp/include/pulsar/Client.h
index 6a9e4878b7..1913851323 100644
--- a/pulsar-client-cpp/include/pulsar/Client.h
+++ b/pulsar-client-cpp/include/pulsar/Client.h
@@ -99,6 +99,9 @@ class Client {
 void subscribeAsync(const std::string& topic, const std::string& 
consumerName,
 const ConsumerConfiguration& conf, SubscribeCallback 
callback);
 
+/**
+ * subscribe for multiple topics under the same namespace.
+ */
 Result subscribe(const std::vector& topics, const 
std::string& subscriptionName,
  Consumer& consumer);
 Result subscribe(const std::vector& topics, const 
std::string& subscriptionName,
@@ -108,6 +111,19 @@ class Client {
 void subscribeAsync(const std::vector& topics, const 
std::string& subscriptionName,
 const ConsumerConfiguration& conf, SubscribeCallback 
callback);
 
+/**
+ * subscribe for multiple topics, which match given regexPattern, under 
the same namespace.
+ */
+Result subscribeWithRegex(const std::string& regexPattern, const 
std::string& consumerName,
+  Consumer& consumer);
+Result subscribeWithRegex(const std::string& regexPattern, const 
std::string& consumerName,
+  const ConsumerConfiguration& conf, Consumer& 
consumer);
+
+void subscribeWithRegexAsync(const std::string& regexPattern, const 
std::string& consumerName,
+ SubscribeCallback callback);
+void subscribeWithRegexAsync(const std::string& regexPattern, const 
std::string& consumerName,
+ const ConsumerConfiguration& conf, 
SubscribeCallback callback);
+
 /**
  * Create a topic reader with given {@code ReaderConfiguration} for 
reading messages from the specified
  * topic.
diff --git a/pulsar-client-cpp/include/pulsar/ConsumerConfiguration.h 
b/pulsar-client-cpp/include/pulsar/ConsumerConfiguration.h
index c9584e38f2..36e580897b 100644
--- a/pulsar-client-cpp/include/pulsar/ConsumerConfiguration.h
+++ b/pulsar-client-cpp/include/pulsar/ConsumerConfiguration.h
@@ -152,6 +152,16 @@ class ConsumerConfiguration {
 bool isReadCompacted() const;
 void setReadCompacted(bool compacted);
 
+/**
+ * Set the time duration in minutes, for which the 
PatternMultiTopicsConsumer will do a pattern auto
+ * discovery.
+ * The default value is 60 seconds. less than 0 will disable auto 
discovery.
+ *
+ * @param periodInSeconds   period in seconds to do an auto discovery
+ */
+void setPatternAutoDiscoveryPeriod(int periodInSeconds);
+int getPatternAutoDiscoveryPeriod() const;
+
 friend class PulsarWrapper;
 
private:
diff --git a/pulsar-client-cpp/lib/BinaryProtoLookupService.cc 
b/pulsar-client-cpp/lib/BinaryProtoLookupService.cc
index c4bef3070d..296faee6cf 100644
--- a/pulsar-client-cpp/lib/BinaryProtoLookupService.cc
+++ b/pulsar-client-cpp/lib/BinaryProtoLookupService.cc
@@ -152,4 +152,46 @@ uint64_t BinaryProtoLookupService::newRequestId() {
 Lock lock(mutex_);
 return ++requestIdGenerator_;
 }
+
+Future 
BinaryProtoLookupService::getTopicsOfNamespaceAsync(
+const NamespaceNamePtr& nsName) {
+NamespaceTopicsPromisePtr promise = boost::make_shared>();
+if (!nsName) {
+promise->setFailed(ResultInvalidTopicName);
+return promise->getFuture();
+}
+std::string namespaceName = nsName->toString();
+Future future = 
cnxPool_.getConnectionAsync(serviceUrl_, serviceUrl_);
+
future.addListener(boost::bind(::sendGetTopicsOfNamespaceRequest,
 this,
+   namespaceName, _1, _2, promise));
+return promise->getFuture();
+}
+
+void BinaryProtoLookupService::sendGetTopicsOfNamespaceRequest(const 
std::string& nsName, Result result,
+   const 
ClientConnectionWeakPtr& clientCnx,
+   
NamespaceTopicsPromisePtr promise) {
+if (result != ResultOk) {
+promise->setFailed(ResultConnectError);
+return;
+}
+
+ClientConnectionPtr conn = clientCnx.lock();
+uint64_t requestId = newRequestId();
+LOG_DEBUG("sendGetTopicsOfNamespaceRequest. requestId: " << requestId << " 
nsName: " << nsName);
+
+conn->newGetTopicsOfNamespace(nsName, requestId)
+.addListener(
+

[incubator-pulsar] branch master updated: Cpp client: add PatternMultiTopicsConsumerImpl to support regex subscribe (#2219)

2018-08-04 Thread zhaijia
This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new 93e192f  Cpp client: add PatternMultiTopicsConsumerImpl to support 
regex subscribe (#2219)
93e192f is described below

commit 93e192f7b8ce6273c2d906edf0a19726fe7d455a
Author: Jia Zhai 
AuthorDate: Sat Aug 4 14:56:56 2018 +0800

Cpp client: add PatternMultiTopicsConsumerImpl to support regex subscribe 
(#2219)

In PR #1279 and #1298 we added regex based subscription. This is a catch up 
work to add `PatternMultiTopicsConsumerImpl` in cpp client.
---
 pulsar-client-cpp/include/pulsar/Client.h  |  16 ++
 .../include/pulsar/ConsumerConfiguration.h |  10 +
 pulsar-client-cpp/lib/BinaryProtoLookupService.cc  |  42 
 pulsar-client-cpp/lib/BinaryProtoLookupService.h   |   9 +
 pulsar-client-cpp/lib/Client.cc|  24 ++
 pulsar-client-cpp/lib/ClientConnection.cc  |  86 ++-
 pulsar-client-cpp/lib/ClientConnection.h   |  13 +-
 pulsar-client-cpp/lib/ClientImpl.cc|  58 +
 pulsar-client-cpp/lib/ClientImpl.h |   8 +
 pulsar-client-cpp/lib/Commands.cc  |  18 ++
 pulsar-client-cpp/lib/Commands.h   |   1 +
 pulsar-client-cpp/lib/ConsumerConfiguration.cc |   6 +
 pulsar-client-cpp/lib/ConsumerConfigurationImpl.h  |   4 +-
 pulsar-client-cpp/lib/HTTPLookupService.cc | 112 +++--
 pulsar-client-cpp/lib/HTTPLookupService.h  |   9 +-
 pulsar-client-cpp/lib/LookupService.h  |  11 +
 pulsar-client-cpp/lib/MultiTopicsConsumerImpl.h|   2 +-
 .../lib/PatternMultiTopicsConsumerImpl.cc  | 235 +++
 .../lib/PatternMultiTopicsConsumerImpl.h   |  76 ++
 pulsar-client-cpp/tests/BasicEndToEndTest.cc   | 257 +
 pulsar-client-cpp/tests/BinaryLookupServiceTest.cc |  67 ++
 21 files changed, 1032 insertions(+), 32 deletions(-)

diff --git a/pulsar-client-cpp/include/pulsar/Client.h 
b/pulsar-client-cpp/include/pulsar/Client.h
index 6a9e487..1913851 100644
--- a/pulsar-client-cpp/include/pulsar/Client.h
+++ b/pulsar-client-cpp/include/pulsar/Client.h
@@ -99,6 +99,9 @@ class Client {
 void subscribeAsync(const std::string& topic, const std::string& 
consumerName,
 const ConsumerConfiguration& conf, SubscribeCallback 
callback);
 
+/**
+ * subscribe for multiple topics under the same namespace.
+ */
 Result subscribe(const std::vector& topics, const 
std::string& subscriptionName,
  Consumer& consumer);
 Result subscribe(const std::vector& topics, const 
std::string& subscriptionName,
@@ -109,6 +112,19 @@ class Client {
 const ConsumerConfiguration& conf, SubscribeCallback 
callback);
 
 /**
+ * subscribe for multiple topics, which match given regexPattern, under 
the same namespace.
+ */
+Result subscribeWithRegex(const std::string& regexPattern, const 
std::string& consumerName,
+  Consumer& consumer);
+Result subscribeWithRegex(const std::string& regexPattern, const 
std::string& consumerName,
+  const ConsumerConfiguration& conf, Consumer& 
consumer);
+
+void subscribeWithRegexAsync(const std::string& regexPattern, const 
std::string& consumerName,
+ SubscribeCallback callback);
+void subscribeWithRegexAsync(const std::string& regexPattern, const 
std::string& consumerName,
+ const ConsumerConfiguration& conf, 
SubscribeCallback callback);
+
+/**
  * Create a topic reader with given {@code ReaderConfiguration} for 
reading messages from the specified
  * topic.
  * 
diff --git a/pulsar-client-cpp/include/pulsar/ConsumerConfiguration.h 
b/pulsar-client-cpp/include/pulsar/ConsumerConfiguration.h
index c9584e3..36e5808 100644
--- a/pulsar-client-cpp/include/pulsar/ConsumerConfiguration.h
+++ b/pulsar-client-cpp/include/pulsar/ConsumerConfiguration.h
@@ -152,6 +152,16 @@ class ConsumerConfiguration {
 bool isReadCompacted() const;
 void setReadCompacted(bool compacted);
 
+/**
+ * Set the time duration in minutes, for which the 
PatternMultiTopicsConsumer will do a pattern auto
+ * discovery.
+ * The default value is 60 seconds. less than 0 will disable auto 
discovery.
+ *
+ * @param periodInSeconds   period in seconds to do an auto discovery
+ */
+void setPatternAutoDiscoveryPeriod(int periodInSeconds);
+int getPatternAutoDiscoveryPeriod() const;
+
 friend class PulsarWrapper;
 
private:
diff --git a/pulsar-client-cpp/lib/BinaryProtoLookupService.cc 
b/pulsar-client-cpp/lib/BinaryProtoLookupService.cc
index c4bef30..296faee 100644
---