[GitHub] jerrypeng commented on a change in pull request #1636: Rename Connect `Message` interface to `Record`
jerrypeng commented on a change in pull request #1636: Rename Connect `Message` interface to `Record` URL: https://github.com/apache/incubator-pulsar/pull/1636#discussion_r183611828 ## File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageRecordImpl.java ## @@ -0,0 +1,49 @@ +/** + * 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.client.impl; + +import org.apache.pulsar.client.api.Consumer; +import org.apache.pulsar.client.api.Message; +import org.apache.pulsar.client.api.MessageId; +import org.apache.pulsar.connect.core.Record; + +/** + * Abstract class that implements message api and connect record api. + */ +public abstract class MessageRecordImplimplements Message, Record { + +protected M messageId; +private Consumer consumer; + +public void setConsumer(Consumer consumer) { +this.consumer = consumer; +} + +@Override +public void ack() { +if (null != consumer && null != messageId) { +consumer.acknowledgeAsync(messageId); Review comment: we can have a setAckFunction(Runnable runnable) method and the source will set that runnable and ack() with run the runnable. Same for fail(). What do you think? 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] jerrypeng commented on a change in pull request #1636: Rename Connect `Message` interface to `Record`
jerrypeng commented on a change in pull request #1636: Rename Connect `Message` interface to `Record` URL: https://github.com/apache/incubator-pulsar/pull/1636#discussion_r183611320 ## File path: pulsar-connect/core/src/main/java/org/apache/pulsar/connect/core/Sink.java ## @@ -42,8 +42,8 @@ /** * Attempt to publish a type safe collection of messages * - * @param message Object to publish to the sink + * @param outputValue output value * @return Completable future fo async publish request */ -CompletableFuture write(final Message message); +CompletableFuture write(T outputValue); Review comment: The Source will always return Record from read though. Now the generic T in the sink can represent Record. Isn't that inconsistent from the Source interface. Users might find that confusing. And in what circumstance is the outputValue in the sink write method not a Record object? 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] sijie commented on a change in pull request #1636: Rename Connect `Message` interface to `Record`
sijie commented on a change in pull request #1636: Rename Connect `Message` interface to `Record` URL: https://github.com/apache/incubator-pulsar/pull/1636#discussion_r183609303 ## File path: pulsar-connect/core/src/main/java/org/apache/pulsar/connect/core/Sink.java ## @@ -42,8 +42,8 @@ /** * Attempt to publish a type safe collection of messages * - * @param message Object to publish to the sink + * @param outputValue output value * @return Completable future fo async publish request */ -CompletableFuture write(final Message message); +CompletableFuture write(T outputValue); Review comment: Record should be something from source only. T is the value passed on to the sink, sink can convert it to the format that it can use to write. 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] sijie commented on a change in pull request #1636: Rename Connect `Message` interface to `Record`
sijie commented on a change in pull request #1636: Rename Connect `Message` interface to `Record` URL: https://github.com/apache/incubator-pulsar/pull/1636#discussion_r183609200 ## File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageRecordImpl.java ## @@ -0,0 +1,49 @@ +/** + * 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.client.impl; + +import org.apache.pulsar.client.api.Consumer; +import org.apache.pulsar.client.api.Message; +import org.apache.pulsar.client.api.MessageId; +import org.apache.pulsar.connect.core.Record; + +/** + * Abstract class that implements message api and connect record api. + */ +public abstract class MessageRecordImplimplements Message, Record { + +protected M messageId; +private Consumer consumer; + +public void setConsumer(Consumer consumer) { +this.consumer = consumer; +} + +@Override +public void ack() { +if (null != consumer && null != messageId) { +consumer.acknowledgeAsync(messageId); Review comment: good question. I think for effectively-once, we might have to wrap in another object, so I leave the default behavior here for at-least-once/at-most-once. or do you have any other suggestions? 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] jerrypeng commented on a change in pull request #1636: Rename Connect `Message` interface to `Record`
jerrypeng commented on a change in pull request #1636: Rename Connect `Message` interface to `Record` URL: https://github.com/apache/incubator-pulsar/pull/1636#discussion_r183587224 ## File path: pulsar-connect/core/src/main/java/org/apache/pulsar/connect/core/Sink.java ## @@ -42,8 +42,8 @@ /** * Attempt to publish a type safe collection of messages * - * @param message Object to publish to the sink + * @param outputValue output value * @return Completable future fo async publish request */ -CompletableFuture write(final Message message); +CompletableFuture write(T outputValue); Review comment: Shouldn't this be wrapped around the a Record object? 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] jerrypeng commented on a change in pull request #1636: Rename Connect `Message` interface to `Record`
jerrypeng commented on a change in pull request #1636: Rename Connect `Message` interface to `Record` URL: https://github.com/apache/incubator-pulsar/pull/1636#discussion_r183586587 ## File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageRecordImpl.java ## @@ -0,0 +1,49 @@ +/** + * 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.client.impl; + +import org.apache.pulsar.client.api.Consumer; +import org.apache.pulsar.client.api.Message; +import org.apache.pulsar.client.api.MessageId; +import org.apache.pulsar.connect.core.Record; + +/** + * Abstract class that implements message api and connect record api. + */ +public abstract class MessageRecordImplimplements Message, Record { + +protected M messageId; +private Consumer consumer; + +public void setConsumer(Consumer consumer) { +this.consumer = consumer; +} + +@Override +public void ack() { +if (null != consumer && null != messageId) { +consumer.acknowledgeAsync(messageId); Review comment: Do we want an implementation here? What about effectively once when we need to ack cumulative? 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: Also look for the '_static' suffix when searching for libjsoncpp.a (#1635)
This is an automated email from the ASF dual-hosted git repository. sijie 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 dd601b7 Also look for the '_static' suffix when searching for libjsoncpp.a (#1635) dd601b7 is described below commit dd601b7cd9b39ecc07862950735451e598a3ce42 Author: Matteo MerliAuthorDate: Mon Apr 23 17:47:14 2018 -0700 Also look for the '_static' suffix when searching for libjsoncpp.a (#1635) *Motivation* Newer versions of Homebrew have the JSONCpp static library installed as libjsoncpp_static.a --- pulsar-client-cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulsar-client-cpp/CMakeLists.txt b/pulsar-client-cpp/CMakeLists.txt index d99f7a8..d71590e 100644 --- a/pulsar-client-cpp/CMakeLists.txt +++ b/pulsar-client-cpp/CMakeLists.txt @@ -56,7 +56,7 @@ if (LINK_STATIC) find_library(ZLIB_LIBRARY_PATH REQUIRED NAMES libz.a z) find_library(PROTOBUF_LIBRARIES NAMES libprotobuf.a) find_library(CURL_LIBRARY_PATH NAMES libcurl.a curl) -find_library(LIB_JSON NAMES libjsoncpp.a) +find_library(LIB_JSON NAMES libjsoncpp.a libjsoncpp_static.a) find_library(LOG4CXX_LIBRARY_PATH NAMES liblog4cxx.a) # Libraries needed by log4cxx to link statically with -- To stop receiving notification emails like this one, please contact si...@apache.org.
[GitHub] sijie closed pull request #1635: Also look for the '_static' suffix when searching for libjsoncpp.a
sijie closed pull request #1635: Also look for the '_static' suffix when searching for libjsoncpp.a URL: https://github.com/apache/incubator-pulsar/pull/1635 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/CMakeLists.txt b/pulsar-client-cpp/CMakeLists.txt index d99f7a8ee..d71590e12 100644 --- a/pulsar-client-cpp/CMakeLists.txt +++ b/pulsar-client-cpp/CMakeLists.txt @@ -56,7 +56,7 @@ if (LINK_STATIC) find_library(ZLIB_LIBRARY_PATH REQUIRED NAMES libz.a z) find_library(PROTOBUF_LIBRARIES NAMES libprotobuf.a) find_library(CURL_LIBRARY_PATH NAMES libcurl.a curl) -find_library(LIB_JSON NAMES libjsoncpp.a) +find_library(LIB_JSON NAMES libjsoncpp.a libjsoncpp_static.a) find_library(LOG4CXX_LIBRARY_PATH NAMES liblog4cxx.a) # Libraries needed by log4cxx to link statically with 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] sijie commented on issue #1636: Rename Connect `Message` interface to `Record`
sijie commented on issue #1636: Rename Connect `Message` interface to `Record` URL: https://github.com/apache/incubator-pulsar/pull/1636#issuecomment-383766743 @jerrypeng @srkukarni - please review this @zhaijack - please also review this, since I am touching `TopicMessageImpl` which I think it is related to a change you made before. just to make sure the change will not affect that one. 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] sijie opened a new pull request #1636: Rename Connect `Message` interface to `Record`
sijie opened a new pull request #1636: Rename Connect `Message` interface to `Record` URL: https://github.com/apache/incubator-pulsar/pull/1636 *Motivation* Having two different `Message` interfaces is a bit confusing and also introduced unnecessary object allocation. *Solution* - rename connect `Message` interface to `Record` interface - introduce an abstract base implementation for both `api.Message` and `connect.Record` - change the places to the new class 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] zhaijack commented on issue #1593: PIP-17: the part of index block for offload.
zhaijack commented on issue #1593: PIP-17: the part of index block for offload. URL: https://github.com/apache/incubator-pulsar/pull/1593#issuecomment-383760988 retest this please for `org.apache.pulsar.broker.service.PersistentFailoverE2ETest.testSimpleConsumerEventsWithoutPartition` 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] zhaijack commented on issue #1593: PIP-17: the part of index block for offload.
zhaijack commented on issue #1593: PIP-17: the part of index block for offload. URL: https://github.com/apache/incubator-pulsar/pull/1593#issuecomment-383760988 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: Fixed typo in ConsumerBuilder acknowledgmentGroupTime option (#1608)
This is an automated email from the ASF dual-hosted git repository. mmerli 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 9947f74 Fixed typo in ConsumerBuilder acknowledgmentGroupTime option (#1608) 9947f74 is described below commit 9947f748e01f6cd8596e9fb49e16c090c6fda769 Author: Matteo MerliAuthorDate: Mon Apr 23 13:35:20 2018 -0700 Fixed typo in ConsumerBuilder acknowledgmentGroupTime option (#1608) --- .../apache/pulsar/broker/admin/AdminApiTest.java | 6 +++--- .../pulsar/broker/admin/v1/V1_AdminApiTest.java| 6 +++--- .../pulsar/broker/service/BrokerServiceTest.java | 4 ++-- .../broker/service/PersistentFailoverE2ETest.java | 4 ++-- .../broker/service/PersistentQueueE2ETest.java | 2 +- .../pulsar/broker/service/ResendRequestTest.java | 2 +- .../client/api/DispatcherBlockConsumerTest.java| 14 ++--- .../client/api/SimpleProducerConsumerTest.java | 24 +++--- .../stats/client/PulsarBrokerStatsClientTest.java | 2 +- .../kafka/compat/PulsarConsumerKafkaConfig.java| 2 +- .../apache/pulsar/client/api/ConsumerBuilder.java | 2 +- .../pulsar/client/impl/ConsumerBuilderImpl.java| 2 +- .../pulsar/testclient/PerformanceConsumer.java | 2 +- 13 files changed, 36 insertions(+), 36 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java index 0afe36d..675bd1c 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java @@ -1421,7 +1421,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest { // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); assertEquals(admin.persistentTopics().getSubscriptions(topicName), Lists.newArrayList("my-sub")); @@ -1472,7 +1472,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest { // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); assertEquals(admin.persistentTopics().getSubscriptions(topicName), Lists.newArrayList("my-sub")); @@ -1543,7 +1543,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest { // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); List topics = admin.persistentTopics().getList("prop-xyz/ns1"); assertEquals(topics.size(), 4); diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java index c7a26ff..2ca1e08 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java @@ -1441,7 +1441,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest { // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); assertEquals(admin.persistentTopics().getSubscriptions(topicName), Lists.newArrayList("my-sub")); @@ -1492,7 +1492,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest { // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); +
[GitHub] merlimat closed pull request #1608: Fixed typo in ConsumerBuilder acknowledgmentGroupTime option
merlimat closed pull request #1608: Fixed typo in ConsumerBuilder acknowledgmentGroupTime option URL: https://github.com/apache/incubator-pulsar/pull/1608 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-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java index 0afe36d3a..675bd1ccc 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java @@ -1421,7 +1421,7 @@ public void persistentTopicsCursorReset(String topicName) throws Exception { // create consumer and subscription Consumerconsumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); assertEquals(admin.persistentTopics().getSubscriptions(topicName), Lists.newArrayList("my-sub")); @@ -1472,7 +1472,7 @@ public void persistentTopicsCursorResetAfterReset(String topicName) throws Excep // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); assertEquals(admin.persistentTopics().getSubscriptions(topicName), Lists.newArrayList("my-sub")); @@ -1543,7 +1543,7 @@ public void partitionedTopicsCursorReset(String topicName) throws Exception { // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); List topics = admin.persistentTopics().getList("prop-xyz/ns1"); assertEquals(topics.size(), 4); diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java index c7a26ffa3..2ca1e0869 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java @@ -1441,7 +1441,7 @@ public void persistentTopicsCursorReset(String topicName) throws Exception { // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); assertEquals(admin.persistentTopics().getSubscriptions(topicName), Lists.newArrayList("my-sub")); @@ -1492,7 +1492,7 @@ public void persistentTopicsCursorResetAfterReset(String topicName) throws Excep // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); assertEquals(admin.persistentTopics().getSubscriptions(topicName), Lists.newArrayList("my-sub")); @@ -1563,7 +1563,7 @@ public void partitionedTopicsCursorReset(String topicName) throws Exception { // create consumer and subscription Consumer consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("my-sub") - .subscriptionType(SubscriptionType.Exclusive).acknowledmentGroupTime(0, TimeUnit.SECONDS).subscribe(); + .subscriptionType(SubscriptionType.Exclusive).acknowledgmentGroupTime(0, TimeUnit.SECONDS).subscribe(); List topics = admin.persistentTopics().getList("prop-xyz/use/ns1"); assertEquals(topics.size(), 4); diff --git
[GitHub] merlimat opened a new pull request #1635: Also look for the '_static' suffix when searching for libjsoncpp.a
merlimat opened a new pull request #1635: Also look for the '_static' suffix when searching for libjsoncpp.a URL: https://github.com/apache/incubator-pulsar/pull/1635 ### Motivation Newer versions of Homebrew have the JSONCpp static library installed as `libjsoncpp_static.a` 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] merlimat opened a new pull request #1634: In pulsar admin Java API, unified persistent vs non-persistent into "topics()"
merlimat opened a new pull request #1634: In pulsar admin Java API, unified persistent vs non-persistent into "topics()" URL: https://github.com/apache/incubator-pulsar/pull/1634 ### Motivation There's a split in the Java admin API between `persistent` and `non-persistent` topics which is not required because both branches have almost the same methods. Unified into `admin.topics()`. Next step is to unify the CLI tool as well. 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: Add a integration test for create subscription CLI command (#1613)
This is an automated email from the ASF dual-hosted git repository. mmerli 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 2ac2b5c Add a integration test for create subscription CLI command (#1613) 2ac2b5c is described below commit 2ac2b5c751fb2e102fc1b9b9cdd9bf20f850a478 Author: Sijie GuoAuthorDate: Mon Apr 23 11:36:33 2018 -0700 Add a integration test for create subscription CLI command (#1613) * Add a integration test for create subscription CLI command * - Pulsar Admin exception casting issue - Handle redirects * - print more details about response * Dump location * return the original response --- .../apache/pulsar/broker/web/RestException.java| 3 +- .../pulsar/client/admin/internal/BaseResource.java | 42 +++--- .../java/org/apache/pulsar/admin/cli/CmdBase.java | 15 ++-- .../apache/pulsar/tests/integration/TestCLI.java | 22 4 files changed, 57 insertions(+), 25 deletions(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java index 06b1e97..9305b53 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java @@ -66,8 +66,7 @@ public class RestException extends WebApplicationException { if (t instanceof RestException || t instanceof WebApplicationException) { WebApplicationException e = (WebApplicationException) t; -return Response.status(e.getResponse().getStatus()).entity(e.getResponse().getEntity()) -.type(e.getResponse().getMediaType()).build(); +return e.getResponse(); } else { return Response .status(Status.INTERNAL_SERVER_ERROR) diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java index 3ad4059..a0f747c 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java @@ -160,26 +160,28 @@ public abstract class BaseResource { if (e instanceof ServerErrorException) { ServerErrorException see = (ServerErrorException) e; return new ServerSideErrorException(see); -} - -// Handle 4xx exceptions -ClientErrorException cee = (ClientErrorException) e; -int statusCode = cee.getResponse().getStatus(); -switch (statusCode) { -case 401: -case 403: -return new NotAuthorizedException(cee); -case 404: -return new NotFoundException(cee); -case 405: -return new NotAllowedException(cee); -case 409: -return new ConflictException(cee); -case 412: -return new PreconditionFailedException(cee); - -default: -return new PulsarAdminException(cee); +} else if (e instanceof ClientErrorException) { +// Handle 4xx exceptions +ClientErrorException cee = (ClientErrorException) e; +int statusCode = cee.getResponse().getStatus(); +switch (statusCode) { +case 401: +case 403: +return new NotAuthorizedException(cee); +case 404: +return new NotFoundException(cee); +case 405: +return new NotAllowedException(cee); +case 409: +return new ConflictException(cee); +case 412: +return new PreconditionFailedException(cee); + +default: +return new PulsarAdminException(cee); +} +} else { +return new PulsarAdminException(e); } } else { return new PulsarAdminException(e); diff --git a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java index f20cb2e..4601c89 100644 --- a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java +++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java @@ -18,6 +18,7 @@ */ package org.apache.pulsar.admin.cli; +import javax.ws.rs.WebApplicationException; import
[GitHub] merlimat closed pull request #1613: Add a integration test for create subscription CLI command
merlimat closed pull request #1613: Add a integration test for create subscription CLI command URL: https://github.com/apache/incubator-pulsar/pull/1613 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-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java index 06b1e97b9..9305b5331 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java @@ -66,8 +66,7 @@ private static Response getResponse(Throwable t) { if (t instanceof RestException || t instanceof WebApplicationException) { WebApplicationException e = (WebApplicationException) t; -return Response.status(e.getResponse().getStatus()).entity(e.getResponse().getEntity()) -.type(e.getResponse().getMediaType()).build(); +return e.getResponse(); } else { return Response .status(Status.INTERNAL_SERVER_ERROR) diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java index 3ad4059e0..a0f747c6a 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java @@ -160,26 +160,28 @@ public PulsarAdminException getApiException(Throwable e) { if (e instanceof ServerErrorException) { ServerErrorException see = (ServerErrorException) e; return new ServerSideErrorException(see); -} - -// Handle 4xx exceptions -ClientErrorException cee = (ClientErrorException) e; -int statusCode = cee.getResponse().getStatus(); -switch (statusCode) { -case 401: -case 403: -return new NotAuthorizedException(cee); -case 404: -return new NotFoundException(cee); -case 405: -return new NotAllowedException(cee); -case 409: -return new ConflictException(cee); -case 412: -return new PreconditionFailedException(cee); - -default: -return new PulsarAdminException(cee); +} else if (e instanceof ClientErrorException) { +// Handle 4xx exceptions +ClientErrorException cee = (ClientErrorException) e; +int statusCode = cee.getResponse().getStatus(); +switch (statusCode) { +case 401: +case 403: +return new NotAuthorizedException(cee); +case 404: +return new NotFoundException(cee); +case 405: +return new NotAllowedException(cee); +case 409: +return new ConflictException(cee); +case 412: +return new PreconditionFailedException(cee); + +default: +return new PulsarAdminException(cee); +} +} else { +return new PulsarAdminException(e); } } else { return new PulsarAdminException(e); diff --git a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java index f20cb2e1d..4601c89c8 100644 --- a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java +++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java @@ -18,6 +18,7 @@ */ package org.apache.pulsar.admin.cli; +import javax.ws.rs.WebApplicationException; import org.apache.pulsar.client.admin.PulsarAdmin; import org.apache.pulsar.client.admin.PulsarAdminException; import org.apache.pulsar.client.admin.PulsarAdminException.ConnectException; @@ -71,9 +72,17 @@ public boolean run(String[] args) { System.err.println("Error connecting to: " + admin.getServiceUrl()); return false; } catch (PulsarAdminException e) { -System.err.println(e.getHttpError()); -System.err.println(); -System.err.println("Reason: " + e.getMessage()); +if (e.getCause() instanceof WebApplicationException) { +WebApplicationException wae = (WebApplicationException)
[GitHub] lucperkins closed pull request #1263: FAQ page template (WIP)
lucperkins closed pull request #1263: FAQ page template (WIP) URL: https://github.com/apache/incubator-pulsar/pull/1263 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/site/_data/faqs.yaml b/site/_data/faqs.yaml new file mode 100644 index 0..1d0a149fa --- /dev/null +++ b/site/_data/faqs.yaml @@ -0,0 +1,4 @@ +- question: Why? + answer: Why not? +- question: Why not? + answer: y tho \ No newline at end of file diff --git a/site/_data/sidebar.yaml b/site/_data/sidebar.yaml index 91028b2cf..fd0d96d21 100644 --- a/site/_data/sidebar.yaml +++ b/site/_data/sidebar.yaml @@ -158,3 +158,5 @@ groups: endpoint: CliTools - title: Pulsar configuration endpoint: Configuration + - title: FAQ +endpoint: faq diff --git a/site/_includes/faq.html b/site/_includes/faq.html new file mode 100644 index 0..8f2bd3571 --- /dev/null +++ b/site/_includes/faq.html @@ -0,0 +1,31 @@ + + + {% for faq in site.data.faqs %} + {{ faq.question }} + {% endfor %} + + +{% for faq in site.data.faqs %} +## {{ faq.question }} + +{{ faq.answer | markdownify }} +{% endfor %} \ No newline at end of file diff --git a/site/docs/latest/reference/faq.md b/site/docs/latest/reference/faq.md new file mode 100644 index 0..cdeaf7703 --- /dev/null +++ b/site/docs/latest/reference/faq.md @@ -0,0 +1,27 @@ +--- +title: Frequently asked questions (FAQs) +layout: docs +--- + + + +{% include faq.html %} \ No newline at end of file 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] lucperkins commented on issue #1263: FAQ page template (WIP)
lucperkins commented on issue #1263: FAQ page template (WIP) URL: https://github.com/apache/incubator-pulsar/pull/1263#issuecomment-383673086 I'm going to close this for now. If we decided we want to templating the FAQ page later on I'm happy to revive this. 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] jai1 commented on issue #1631: Fixes for patch release 1.22.1
jai1 commented on issue #1631: Fixes for patch release 1.22.1 URL: https://github.com/apache/incubator-pulsar/issues/1631#issuecomment-383667217 Closing this issue - using a new project to track the tasks. 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] jai1 closed issue #1631: Fixes for patch release 1.22.1
jai1 closed issue #1631: Fixes for patch release 1.22.1 URL: https://github.com/apache/incubator-pulsar/issues/1631 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] lucperkins commented on issue #1632: Avoid creating different message object for pulsar sink connector
lucperkins commented on issue #1632: Avoid creating different message object for pulsar sink connector URL: https://github.com/apache/incubator-pulsar/pull/1632#issuecomment-383661997 Big +1 to this. I was working on an example connector last week and found the doubled implementation odd. 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] zhaijack commented on issue #1593: PIP-17: the part of index block for offload.
zhaijack commented on issue #1593: PIP-17: the part of index block for offload. URL: https://github.com/apache/incubator-pulsar/pull/1593#issuecomment-383623164 Thanks @ivankelly for the comments, changed following your comments and add the logic for reading back. 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] maskit commented on issue #1266: Pass all Apache Podling Website Checks
maskit commented on issue #1266: Pass all Apache Podling Website Checks URL: https://github.com/apache/incubator-pulsar/issues/1266#issuecomment-383565282 @lucperkins As I wrote on my last comment, we have an event page but we haven't passed the check because the check is a bit strict. It would be great if you could add a link for ApacheCon page with the logo. Then we probably be able to dodge the check. 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] zhaijack commented on issue #1059: Issue 1014: Rename "global zookeeper" to "configuration-store"(change in code, conf and cli)
zhaijack commented on issue #1059: Issue 1014: Rename "global zookeeper" to "configuration-store"(change in code, conf and cli) URL: https://github.com/apache/incubator-pulsar/pull/1059#issuecomment-383371863 retest this please for Integration 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] zhaijack commented on issue #1059: Issue 1014: Rename "global zookeeper" to "configuration-store"(change in code, conf and cli)
zhaijack commented on issue #1059: Issue 1014: Rename "global zookeeper" to "configuration-store"(change in code, conf and cli) URL: https://github.com/apache/incubator-pulsar/pull/1059#issuecomment-383442060 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
[GitHub] HaraldGustafsson opened a new issue #1633: Admin REST-API from a python client
HaraldGustafsson opened a new issue #1633: Admin REST-API from a python client URL: https://github.com/apache/incubator-pulsar/issues/1633 Expected behavior I set up a standalone pulsar broker with SSL authentication and authorisation. I'm trying to write a python 3 admin-client using aiohttp. This works for get operations and other that don't need non-path arguments. But for a post operation the JSON seems to be malformed for the server. As an example: import asyncio import aiohttp import ssl import os async def go(loop): current_dir = os.path.abspath(os.path.dirname(__file__)) sslcontext = ssl.create_default_context(cafile=os.path.join(current_dir, 'cacert.pem')) sslcontext.load_cert_chain(os.path.join(current_dir, 'super-cert.pem'), os.path.join(current_dir, 'super-key.pem')) async with aiohttp.ClientSession(loop=loop) as session: async with session.post('https://localhost:8081/admin/namespaces/sample/standalone/ns1/permissions/testrole', json={'actions': ['consume', 'produce']}, ssl=sslcontext) as resp: print(resp.status) print(await resp.text()) async with session.get('https://localhost:8081/admin/persistent/sample/standalone/ns1', ssl=sslcontext) as resp: print(resp.status) print(await resp.text()) loop = asyncio.get_event_loop() loop.run_until_complete(go(loop)) loop.close() Expected response is that it accepts the change as it does when from the pulsar-admin client. Also the documentation on the web don't include the non-path (i.e. body) parameters that should be included. Just got them from this line in the source code: request(path).post(Entity.entity(actions, MediaType.APPLICATION_JSON), ErrorData.class); Actual behavior Got this error on server: 2018-04-23 09:09:26,082 - WARN - [pulsar-web-70-21:ServletHandler@623] - javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.HashSet` out of START_OBJECT token at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 1] at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689) at org.apache.pulsar.broker.web.ResponseHandlerFilter.doFilter(ResponseHandlerFilter.java:53) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676) at org.apache.pulsar.broker.web.AuthenticationFilter.doFilter(AuthenticationFilter.java:75) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at org.eclipse.jetty.server.Server.handle(Server.java:524) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:202) at