[pulsar] branch asf-site updated: Updated site at revision 30f6935

2018-09-27 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/pulsar.git


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

commit 09498584a1414a841519db503ad0d587fb09b1f1
Author: jenkins 
AuthorDate: Thu Sep 27 09:07:58 2018 +

Updated site at revision 30f6935
---
 content/api/client/index-all.html  | 12 +
 .../org/apache/pulsar/client/api/Message.html  | 59 ++
 .../pulsar/client/api/TypedMessageBuilder.html | 35 ++---
 .../docs/latest/project/BinaryProtocol/index.html  | 20 
 content/ja/project/BinaryProtocol/index.html   | 20 
 content/swagger/swagger.json   | 34 ++---
 6 files changed, 147 insertions(+), 33 deletions(-)

diff --git a/content/api/client/index-all.html 
b/content/api/client/index-all.html
index 444b630..ef7030e 100644
--- a/content/api/client/index-all.html
+++ b/content/api/client/index-all.html
@@ -710,6 +710,10 @@
 
 Get the key of the message
 
+getKeyBytes()
 - Method in interface org.apache.pulsar.client.api.Message
+
+Get bytes in key.
+
 getLastSequenceId()
 - Method in interface org.apache.pulsar.client.api.Producer
 
 Get the last sequence id that was published by this 
producer.
@@ -972,6 +976,10 @@
 
 H
 
+hasBase64EncodedKey()
 - Method in interface org.apache.pulsar.client.api.Message
+
+Check whether the key has been base64 encoded.
+
 hasDataForHttp()
 - Method in interface org.apache.pulsar.client.api.AuthenticationDataProvider
 
 Check if data for HTTP are available.
@@ -1089,6 +1097,10 @@
 
 Sets the key of the message for routing policy
 
+keyBytes(byte[])
 - Method in interface org.apache.pulsar.client.api.TypedMessageBuilder
+
+Sets the bytes of the key of the message for routing 
policy.
+
 
 
 
diff --git a/content/api/client/org/apache/pulsar/client/api/Message.html 
b/content/api/client/org/apache/pulsar/client/api/Message.html
index 5b5ab6d..674ff7a 100644
--- a/content/api/client/org/apache/pulsar/client/api/Message.html
+++ b/content/api/client/org/apache/pulsar/client/api/Message.html
@@ -17,7 +17,7 @@
 catch(err) {
 }
 //-->
-var methods = 
{"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6};
+var methods = 
{"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6};
 var tabs = {65535:["t0","All Methods"],2:["t2","Instance 
Methods"],4:["t3","Abstract Methods"]};
 var altColor = "altColor";
 var rowColor = "rowColor";
@@ -145,52 +145,64 @@ var activeTableTab = "activeTableTab";
 
 
 
+byte[]
+getKeyBytes()
+Get bytes in key.
+
+
+
 MessageId
 getMessageId()
 Get the unique message ID associated with this 
message.
 
 
-
+
 String
 getProducerName()
 Get the producer name who produced this message.
 
 
-
+
 Map
 getProperties()
 Return the properties attached to the message.
 
 
-
+
 String
 getProperty(String name)
 Get the value of a specific property
 
 
-
+
 long
 getPublishTime()
 Get the publish time of this message.
 
 
-
+
 long
 getSequenceId()
 Get the sequence id associated with this message.
 
 
-
+
 T
 getValue() 
 
-
+
+boolean
+hasBase64EncodedKey()
+Check whether the key has been base64 encoded.
+
+
+
 boolean
 hasKey()
 Check whether the message has a key
 
 
-
+
 boolean
 hasProperty(String name)
 Check whether the message has a specific property 
attached.
@@ -398,6 +410,35 @@ var activeTableTab = "activeTableTab";
 
 
 
+
+
+
+
+
+hasBase64EncodedKey
+boolean hasBase64EncodedKey()
+Check whether the key has been base64 encoded.
+
+Returns:
+true if the key is base64 encoded, false otherwise
+
+
+
+
+
+
+
+
+getKeyBytes
+byte[] getKeyBytes()
+Get bytes in key. If the key has been base64 encoded, it is 
decoded before being returned.
+ Otherwise, if the key is a plain string, this method returns the UTF_8 
encoded bytes of the string.
+
+Returns:
+the key in byte[] form
+
+
+
 
 
 
diff --git 
a/content/api/client/org/apache/pulsar/client/api/TypedMessageBuilder.html 
b/content/api/client/org/apache/pulsar/client/api/TypedMessageBuilder.html
index 16d7518..252018b 100644
--- a/content/api/client/org/apache/pulsar/client/api/TypedMessageBuilder.html
+++ b/content/api/client/org/apache/pulsar/client/api/TypedMessageBuilder.html
@@ -17,7 +17,7 @@
 catch(err) {
 }
 //-->
-var methods = 
{"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6};
+var methods = 
{"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6};
 var tabs = {65535:["t0","All Methods"],2:["t2","Instance 
Methods"],4:["t3","Abstract Methods"]};
 var altColor = "altColor";
 var rowColor = "rowColor";
@@ -150,42 +150,48 @@ extends Serializable
 
 
 TypedMessageBuilder
+keyBytes(byte[] key)
+Sets the byte

[GitHub] massakam commented on issue #2666: Specific topic becomes unavailable due to failure of cursor recovery

2018-09-27 Thread GitBox
massakam commented on issue #2666: Specific topic becomes unavailable due to 
failure of cursor recovery
URL: https://github.com/apache/pulsar/issues/2666#issuecomment-425056258
 
 
   If ManagedCursorImpl has been modified as follows, the cursor recovery is 
successfully completed and the topic become available. Is this change 
appropriate?
   ```diff
   --- 
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
   +++ 
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
   @@ -353,6 +353,9 @@ public class ManagedCursorImpl implements ManagedCursor {
}
position = nextExistingLedger != null ? 
PositionImpl.get(nextExistingLedger, -1) : position;
}
   +if (position.compareTo(ledger.getLastPosition()) > 0) {
   +position = PositionImpl.get(ledger.getLastPosition());
   +}
log.info("[{}] Cursor {} recovered to position {}", 
ledger.getName(), name, position);
   
messagesConsumedCounter = 
-getNumberOfEntries(Range.openClosed(position, ledger.getLastPosition()));
   ```


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 issue #2667: Intermittent test failure in ManagedLedgerTest.testAsyncAddEntryAndSyncClose()

2018-09-27 Thread GitBox
merlimat opened a new issue #2667: Intermittent test failure in 
ManagedLedgerTest.testAsyncAddEntryAndSyncClose()
URL: https://github.com/apache/pulsar/issues/2667
 
 
   In `ManagedLedgerTest.testAsyncAddEntryAndSyncClose()` : 
   
   Test fails with timeout : 
   
   ```
   org.testng.internal.thread.ThreadTimeoutException: Method 
org.apache.bookkeeper.mledger.impl.ManagedLedgerTest.testAsyncAddEntryAndSyncClose()
 didn't finish within the time-out 2
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   ```
   
   Cause seems to be assertion failed in callback thread: 
   
   ```
   1:58:08.368 
[bookkeeper-ml-workers-OrderedExecutor-3-0:org.apache.bookkeeper.mledger.impl.OpAddEntry@164]
 INFO  org.apache.bookkeeper.mledger.impl.OpAddEntry - [my_test_ledger] Closing 
ledger 6 for being full
   01:58:08.372 
[test-OrderedScheduler-0-0:org.apache.bookkeeper.client.PulsarMockBookKeeper@94]
 INFO  org.apache.bookkeeper.client.PulsarMockBookKeeper - Creating ledger 7
   01:58:08.373 
[test-OrderedScheduler-0-0:org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl@1178]
 INFO  org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl - [my_test_ledger] 
Created new ledger 7
   01:58:08.420 
[bookkeeper-ml-workers-OrderedExecutor-3-0:org.apache.bookkeeper.mledger.impl.OpAddEntry@164]
 INFO  org.apache.bookkeeper.mledger.impl.OpAddEntry - [my_test_ledger] Closing 
ledger 7 for being full
   01:58:08.424 
[test-OrderedScheduler-0-0:org.apache.bookkeeper.client.PulsarMockBookKeeper@94]
 INFO  org.apache.bookkeeper.client.PulsarMockBookKeeper - Creating ledger 8
   01:58:08.425 
[test-OrderedScheduler-0-0:org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl@1178]
 INFO  org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl - [my_test_ledger] 
Created new ledger 8
   01:58:08.460 
[bookkeeper-ml-workers-OrderedExecutor-3-0:org.apache.bookkeeper.common.util.SafeRunnable@38]
 ERROR org.apache.bookkeeper.common.util.SafeRunnable - Unexpected throwable 
caught 
   java.lang.IllegalArgumentException: null
at 
com.google.common.base.Preconditions.checkArgument(Preconditions.java:108) 
~[guava-21.0.jar:?]
at 
org.apache.bookkeeper.mledger.impl.OpAddEntry.safeRun(OpAddEntry.java:143) 
~[classes/:?]
at 
org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) 
[bookkeeper-common-4.7.2.jar:4.7.2]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
[?:1.8.0_172]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
[?:1.8.0_172]
at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 [netty-all-4.1.22.Final.jar:4.1.22.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
   01:58:08.461 
[bookkeeper-ml-workers-OrderedExecutor-3-0:org.apache.bookkeeper.common.util.SafeRunnable@38]
 ERROR org.apache.bookkeeper.common.util.SafeRunnable - Unexpected throwable 
caught 
   java.lang.IllegalArgumentException: null
at 
com.google.common.base.Preconditions.checkArgument(Preconditions.java:108) 
~[guava-21.0.jar:?]
at 
org.apache.bookkeeper.mledger.impl.OpAddEntry.safeRun(OpAddEntry.java:143) 
~[classes/:?]
at 
org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) 
[bookkeeper-common-4.7.2.jar:4.7.2]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
[?:1.8.0_172]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
[?:1.8.0_172]
at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 [netty-all-4.1.22.Final.jar:4.1.22.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
   01:58:08.480 
[bookkeeper-ml-workers-OrderedExecutor-3-0:org.apache.bookkeeper.mledger.impl.OpAddEntry@164]
 INFO  org.apache.bookkeeper.mledger.impl.OpAddEntry - [my_test_ledger] Closing 
ledger 8 for being full
   01:58:08.484 
[test-OrderedScheduler-0-0:org.apache.bookkeeper.client.PulsarMockBookKeeper@94]
 INFO  org.apache.bookkeeper.client.PulsarMockBookKeeper - Creating ledger 9
   01:58:08.485 
[test-OrderedScheduler-0-0:org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl@1178]
 INFO  org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl - [my_test_ledger] 
Created new ledger 9
   01:58:08.528 
[bookkeeper-ml-workers-OrderedExecutor-3-0:org.apache.bookkeeper.mledger.impl.OpAddEntry@164]
 INFO  org.apache.bookkeeper.mledger.impl.OpAddEntry - [my_test_ledger] Closing 
ledger 9 for being full
   01:58:08.532 
[test-OrderedScheduler-0-0:org.apache.bookkeeper.client.PulsarMockBookKeeper@94]
 INFO  org.apache.bookkeeper.client.PulsarMockBookKeeper - Creating ledger 10
   01:58:08.533 
[test-OrderedScheduler-0-0:org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl@1178]
 INFO  org.apache.bookkeeper.mled

[GitHub] srkukarni opened a new pull request #2668: Python Functions support topic pattern, so removing this check

2018-09-27 Thread GitBox
srkukarni opened a new pull request #2668: Python Functions support topic 
pattern, so removing this check
URL: https://github.com/apache/pulsar/pull/2668
 
 
   ### Motivation
   
   Explain here the context, and why you're making that change.
   What is the problem you're trying to solve.
   
   ### Modifications
   
   Describe the modifications you've done.
   
   ### Result
   
   After your change, what will change.
   


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] srkukarni commented on a change in pull request #1950: Enable Pulsar Functions to be deployed on a kubernetes cluster

2018-09-27 Thread GitBox
srkukarni commented on a change in pull request #1950: Enable Pulsar Functions 
to be deployed on a kubernetes cluster
URL: https://github.com/apache/pulsar/pull/1950#discussion_r220989434
 
 

 ##
 File path: 
pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
 ##
 @@ -68,18 +72,12 @@ public void start() throws Exception {
 log.info("{}/{}/{}-{} RuntimeSpawner starting function", 
details.getTenant(), details.getNamespace(),
 details.getName(), this.instanceConfig.getInstanceId());
 
-if (instanceConfig.getFunctionDetails().getRuntime() == PYTHON
 
 Review comment:
   created https://github.com/apache/pulsar/pull/2668 for 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] srkukarni commented on a change in pull request #1950: Enable Pulsar Functions to be deployed on a kubernetes cluster

2018-09-27 Thread GitBox
srkukarni commented on a change in pull request #1950: Enable Pulsar Functions 
to be deployed on a kubernetes cluster
URL: https://github.com/apache/pulsar/pull/1950#discussion_r221000501
 
 

 ##
 File path: 
pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/KubernetesRuntime.java
 ##
 @@ -0,0 +1,507 @@
+/**
+ * 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.runtime;
+
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.protobuf.Empty;
+import com.squareup.okhttp.Response;
+import io.grpc.ManagedChannel;
+import io.grpc.ManagedChannelBuilder;
+import io.kubernetes.client.apis.AppsV1Api;
+import io.kubernetes.client.apis.CoreV1Api;
+import io.kubernetes.client.custom.Quantity;
+import io.kubernetes.client.models.*;
+import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.pulsar.functions.instance.AuthenticationConfig;
+import org.apache.pulsar.functions.instance.InstanceConfig;
+import org.apache.pulsar.functions.proto.Function;
+import org.apache.pulsar.functions.proto.InstanceCommunication;
+import org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus;
+import org.apache.pulsar.functions.proto.InstanceControlGrpc;
+
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static java.net.HttpURLConnection.HTTP_CONFLICT;
+
+/**
+ * A function container implemented using java thread.
+ */
+@Slf4j
+class KubernetesRuntime implements Runtime {
+
+private static final String ENV_SHARD_ID = "SHARD_ID";
+private static final Integer GRPC_PORT = 9093;
+public static final Pattern VALID_POD_NAME_REGEX =
+
Pattern.compile("[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*",
+Pattern.CASE_INSENSITIVE);
+
+private final AppsV1Api appsClient;
+private final CoreV1Api coreClient;
+static final List TOLERATIONS = Collections.unmodifiableList(
+Arrays.asList(
+"node.kubernetes.io/not-ready",
+"node.alpha.kubernetes.io/notReady",
+"node.alpha.kubernetes.io/unreachable"
+)
+);
+
+// The thread that invokes the function
+@Getter
+private List processArgs;
+@Getter
+private ManagedChannel[] channel;
+private InstanceControlGrpc.InstanceControlFutureStub[] stub;
+private InstanceConfig instanceConfig;
+private final String jobNamespace;
+private final String pulsarDockerImageName;
+private final String pulsarRootDir;
+private final String userCodePkgUrl;
+private final String originalCodeFileName;
+private final String pulsarAdminUrl;
+private boolean running;
+
+
+KubernetesRuntime(AppsV1Api appsClient,
+  CoreV1Api coreClient,
+  String jobNamespace,
+  String pulsarDockerImageName,
+  String pulsarRootDir,
+  InstanceConfig instanceConfig,
+  String instanceFile,
+  String logDirectory,
+  String userCodePkgUrl,
+  String originalCodeFileName,
+  String pulsarServiceUrl,
+  String pulsarAdminUrl,
+  String stateStorageServiceUrl,
+  AuthenticationConfig authConfig) throws Exception {
+this.appsClient = appsClient;
+this.coreClient = coreClient;
+this.instanceConfig = instanceConfig;
+this.jobNamespace = jobNamespace;
+this.pulsarDockerImageName = pulsarDockerImageName;
+this.pulsarRootDir = pulsarRootDir;
+this.userCodePkgUrl = userCodePkgUrl;
+this.originalCodeFileName = originalCodeFileName;
+this.pulsarAdminUrl = pulsarAdminUrl;
+this.processArgs = RuntimeUtils.composeArgs(instanceConfig, 
instanceFile, logDirectory, originalCodeFileName, pulsarServiceUrl, 
stateStorageServiceUrl

[GitHub] srkukarni commented on issue #2668: Python Functions support topic pattern, so removing this check

2018-09-27 Thread GitBox
srkukarni commented on issue #2668: Python Functions support topic pattern, so 
removing this check
URL: https://github.com/apache/pulsar/pull/2668#issuecomment-425177628
 
 
   run cpp tests
   run java8 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] srkukarni commented on issue #2668: Python Functions support topic pattern, so removing this check

2018-09-27 Thread GitBox
srkukarni commented on issue #2668: Python Functions support topic pattern, so 
removing this check
URL: https://github.com/apache/pulsar/pull/2668#issuecomment-425197039
 
 
   run cpp 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] ivankelly opened a new pull request #2669: Clarify and add tests for schema change scenarios

2018-09-27 Thread GitBox
ivankelly opened a new pull request #2669: Clarify and add tests for schema 
change scenarios
URL: https://github.com/apache/pulsar/pull/2669
 
 
   A producer with a schema can attach to a topic if
   - the topic does not exist
   - the topic exists but currently has no schema
   - the topic exists and the schema is compatible with the producer
 schema
   
   A consumer with a schema can attach to a topic if
   - the topic does not exist (the schema from the consumer is added to
 the topic)
   - the topic exists and the schema is compactible with the consumer
 schema
   
   A producer without a schema can attach if
   - the topic does not exist
   - the topic exists and has no schema
   
   A consumer without a schema can attach if
   - the topic exists, either with or without a schema
   


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] aahmed-se commented on issue #2504: Add Presto Sql Test

2018-09-27 Thread GitBox
aahmed-se commented on issue #2504: Add Presto Sql Test
URL: https://github.com/apache/pulsar/pull/2504#issuecomment-425236769
 
 
   run java8 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] srkukarni commented on issue #2668: Python Functions support topic pattern, so removing this check

2018-09-27 Thread GitBox
srkukarni commented on issue #2668: Python Functions support topic pattern, so 
removing this check
URL: https://github.com/apache/pulsar/pull/2668#issuecomment-425240076
 
 
   run java8 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] jerrypeng commented on issue #2642: Duplicate classes caught by maven-enforcer-plugin

2018-09-27 Thread GitBox
jerrypeng commented on issue #2642: Duplicate classes caught by 
maven-enforcer-plugin
URL: https://github.com/apache/pulsar/issues/2642#issuecomment-425245685
 
 
   @MarkAddison let me look into 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] jerrypeng commented on issue #2642: Duplicate classes caught by maven-enforcer-plugin

2018-09-27 Thread GitBox
jerrypeng commented on issue #2642: Duplicate classes caught by 
maven-enforcer-plugin
URL: https://github.com/apache/pulsar/issues/2642#issuecomment-425254004
 
 
   The reason this happens if because in Pulsar different modules depend on 
different version of the same dependencies.  While I think there is a way to 
fix it, I am not sure how much benefit it will actually bring.  @MarkAddison is 
this a critical issue for you?


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 #2670: Fixed HTTP redirects with proxy handler

2018-09-27 Thread GitBox
merlimat opened a new pull request #2670: Fixed HTTP redirects with proxy 
handler
URL: https://github.com/apache/pulsar/pull/2670
 
 
   ### Motivation
   
   Fixes #2660 
   
   There is a problem with the Jetty proxy servlet configuration that it makes 
it to not transparently follow HTTP redirects from brokers. This results in 
clients being redirected to a broker hostname that they cannot reach.
   
   ### Modifications
   
   Completely override the `createHttpClient()` from `AbstractProxyServlet` in 
order to ensure that `RedirectProtocolHandler` is always in the list of 
handlers for the client.
   
   ### Result
   
   Proxy will internally handle 307 redirection and will send a 200 to client.
   


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] ivankelly commented on issue #2669: Clarify and add tests for schema change scenarios

2018-09-27 Thread GitBox
ivankelly commented on issue #2669: Clarify and add tests for schema change 
scenarios
URL: https://github.com/apache/pulsar/pull/2669#issuecomment-425257751
 
 
   rerun java8 tests
   rerun cpp 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] aahmed-se commented on issue #2504: Add Presto Sql Test

2018-09-27 Thread GitBox
aahmed-se commented on issue #2504: Add Presto Sql Test
URL: https://github.com/apache/pulsar/pull/2504#issuecomment-425261128
 
 
   run java8 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] srkukarni closed pull request #2668: Python Functions support topic pattern, so removing this check

2018-09-27 Thread GitBox
srkukarni closed pull request #2668: Python Functions support topic pattern, so 
removing this check
URL: https://github.com/apache/pulsar/pull/2668
 
 
   

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/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
 
b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
index 030a5a7125..adb4578109 100644
--- 
a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
+++ 
b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
@@ -68,12 +68,6 @@ public void start() throws Exception {
 log.info("{}/{}/{}-{} RuntimeSpawner starting function", 
details.getTenant(), details.getNamespace(),
 details.getName(), this.instanceConfig.getInstanceId());
 
-if (instanceConfig.getFunctionDetails().getRuntime() == PYTHON
-&& instanceConfig.getFunctionDetails().getSource() != null
-&& 
StringUtils.isNotBlank(instanceConfig.getFunctionDetails().getSource().getTopicsPattern()))
 {
-throw new IllegalArgumentException("topics-pattern is not 
supported for python function");
-}
-
 runtime = runtimeFactory.createContainer(this.instanceConfig, codeFile,
 instanceLivenessCheckFreqMs * 1000);
 runtime.start();


 


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] srkukarni commented on issue #2660: Can not get topic stats from the admin API

2018-09-27 Thread GitBox
srkukarni commented on issue #2660: Can not get topic stats from the admin API
URL: https://github.com/apache/pulsar/issues/2660#issuecomment-425261260
 
 
   #2670 


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


[pulsar] branch master updated: Python Functions support topic pattern, so removing this check (#2668)

2018-09-27 Thread sanjeevrk
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new edd4bed  Python Functions support topic pattern, so removing this 
check (#2668)
edd4bed is described below

commit edd4bedb975cdcb95f1343efcc26cf82af24d422
Author: Sanjeev Kulkarni 
AuthorDate: Thu Sep 27 15:21:44 2018 -0700

Python Functions support topic pattern, so removing this check (#2668)
---
 .../java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java| 6 --
 1 file changed, 6 deletions(-)

diff --git 
a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
 
b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
index 030a5a7..adb4578 100644
--- 
a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
+++ 
b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeSpawner.java
@@ -68,12 +68,6 @@ public class RuntimeSpawner implements AutoCloseable {
 log.info("{}/{}/{}-{} RuntimeSpawner starting function", 
details.getTenant(), details.getNamespace(),
 details.getName(), this.instanceConfig.getInstanceId());
 
-if (instanceConfig.getFunctionDetails().getRuntime() == PYTHON
-&& instanceConfig.getFunctionDetails().getSource() != null
-&& 
StringUtils.isNotBlank(instanceConfig.getFunctionDetails().getSource().getTopicsPattern()))
 {
-throw new IllegalArgumentException("topics-pattern is not 
supported for python function");
-}
-
 runtime = runtimeFactory.createContainer(this.instanceConfig, codeFile,
 instanceLivenessCheckFreqMs * 1000);
 runtime.start();



[GitHub] srkukarni commented on issue #1950: Enable Pulsar Functions to be deployed on a kubernetes cluster

2018-09-27 Thread GitBox
srkukarni commented on issue #1950: Enable Pulsar Functions to be deployed on a 
kubernetes cluster
URL: https://github.com/apache/pulsar/pull/1950#issuecomment-425271825
 
 
   run cpp 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] srkukarni commented on issue #1950: Enable Pulsar Functions to be deployed on a kubernetes cluster

2018-09-27 Thread GitBox
srkukarni commented on issue #1950: Enable Pulsar Functions to be deployed on a 
kubernetes cluster
URL: https://github.com/apache/pulsar/pull/1950#issuecomment-425275787
 
 
   run java8 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] srkukarni commented on issue #2670: Fixed HTTP redirects with proxy handler

2018-09-27 Thread GitBox
srkukarni commented on issue #2670: Fixed HTTP redirects with proxy handler
URL: https://github.com/apache/pulsar/pull/2670#issuecomment-425275922
 
 
   run cpp 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] srkukarni commented on issue #1950: Enable Pulsar Functions to be deployed on a kubernetes cluster

2018-09-27 Thread GitBox
srkukarni commented on issue #1950: Enable Pulsar Functions to be deployed on a 
kubernetes cluster
URL: https://github.com/apache/pulsar/pull/1950#issuecomment-425281983
 
 
   run cpp 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] srkukarni commented on issue #2670: Fixed HTTP redirects with proxy handler

2018-09-27 Thread GitBox
srkukarni commented on issue #2670: Fixed HTTP redirects with proxy handler
URL: https://github.com/apache/pulsar/pull/2670#issuecomment-425284755
 
 
   run cpp 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] aahmed-se commented on issue #2504: Add Presto Sql Test

2018-09-27 Thread GitBox
aahmed-se commented on issue #2504: Add Presto Sql Test
URL: https://github.com/apache/pulsar/pull/2504#issuecomment-425284906
 
 
   run java8 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] srkukarni closed pull request #2670: Fixed HTTP redirects with proxy handler

2018-09-27 Thread GitBox
srkukarni closed pull request #2670: Fixed HTTP redirects with proxy handler
URL: https://github.com/apache/pulsar/pull/2670
 
 
   

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-proxy/src/main/java/org/apache/pulsar/proxy/server/AdminProxyHandler.java
 
b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/AdminProxyHandler.java
index d6c32df2ff..461c544dd7 100644
--- 
a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/AdminProxyHandler.java
+++ 
b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/AdminProxyHandler.java
@@ -24,8 +24,10 @@
 import java.net.URI;
 import java.security.cert.X509Certificate;
 import java.util.Objects;
+import java.util.concurrent.Executor;
 
 import javax.net.ssl.SSLContext;
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 
@@ -37,9 +39,13 @@
 import org.apache.pulsar.common.util.SecurityUtility;
 import org.apache.pulsar.policies.data.loadbalancer.ServiceLookupData;
 import org.eclipse.jetty.client.HttpClient;
-import org.eclipse.jetty.proxy.AsyncProxyServlet;
+import org.eclipse.jetty.client.ProtocolHandlers;
+import org.eclipse.jetty.client.RedirectProtocolHandler;
 import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.proxy.AsyncProxyServlet;
+import org.eclipse.jetty.util.HttpCookieStore;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,9 +68,66 @@
 
 @Override
 protected HttpClient createHttpClient() throws ServletException {
-HttpClient client = super.createHttpClient();
+ServletConfig config = getServletConfig();
+
+HttpClient client = newHttpClient();
+
 client.setFollowRedirects(true);
-return client;
+
+// Must not store cookies, otherwise cookies of different clients will 
mix.
+client.setCookieStore(new HttpCookieStore.Empty());
+
+Executor executor;
+String value = config.getInitParameter("maxThreads");
+if (value == null || "-".equals(value)) {
+executor = (Executor) 
getServletContext().getAttribute("org.eclipse.jetty.server.Executor");
+if (executor == null)
+throw new IllegalStateException("No server executor for 
proxy");
+} else {
+QueuedThreadPool qtp = new 
QueuedThreadPool(Integer.parseInt(value));
+String servletName = config.getServletName();
+int dot = servletName.lastIndexOf('.');
+if (dot >= 0)
+servletName = servletName.substring(dot + 1);
+qtp.setName(servletName);
+executor = qtp;
+}
+
+client.setExecutor(executor);
+
+value = config.getInitParameter("maxConnections");
+if (value == null)
+value = "256";
+client.setMaxConnectionsPerDestination(Integer.parseInt(value));
+
+value = config.getInitParameter("idleTimeout");
+if (value == null)
+value = "3";
+client.setIdleTimeout(Long.parseLong(value));
+
+value = config.getInitParameter("requestBufferSize");
+if (value != null)
+client.setRequestBufferSize(Integer.parseInt(value));
+
+value = config.getInitParameter("responseBufferSize");
+if (value != null)
+client.setResponseBufferSize(Integer.parseInt(value));
+
+try {
+client.start();
+
+// Content must not be decoded, otherwise the client gets confused.
+client.getContentDecoderFactories().clear();
+
+// Pass traffic to the client, only intercept what's necessary.
+ProtocolHandlers protocolHandlers = client.getProtocolHandlers();
+protocolHandlers.clear();
+protocolHandlers.put(new RedirectProtocolHandler(client));
+
+return client;
+} catch (Exception x) {
+throw new ServletException(x);
+}
 }
 
 @Override
diff --git 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/proxy/TestProxy.java
 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/proxy/TestProxy.java
new file mode 100644
index 00..aa2a5f62b2
--- /dev/null
+++ 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/proxy/TestProxy.java
@@ -0,0 +1,83 @@
+/**
+ * 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, Versi

[pulsar] branch master updated: Fixed HTTP redirects with proxy handler (#2670)

2018-09-27 Thread sanjeevrk
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 2c2e0dd  Fixed HTTP redirects with proxy handler (#2670)
2c2e0dd is described below

commit 2c2e0ddaad1db5a928df45ed2f44a4e40103638a
Author: Matteo Merli 
AuthorDate: Thu Sep 27 23:14:26 2018 -0400

Fixed HTTP redirects with proxy handler (#2670)
---
 .../pulsar/proxy/server/AdminProxyHandler.java | 69 +-
 .../pulsar/tests/integration/proxy/TestProxy.java  | 83 ++
 2 files changed, 149 insertions(+), 3 deletions(-)

diff --git 
a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/AdminProxyHandler.java
 
b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/AdminProxyHandler.java
index d6c32df..461c544 100644
--- 
a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/AdminProxyHandler.java
+++ 
b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/AdminProxyHandler.java
@@ -24,8 +24,10 @@ import java.io.IOException;
 import java.net.URI;
 import java.security.cert.X509Certificate;
 import java.util.Objects;
+import java.util.concurrent.Executor;
 
 import javax.net.ssl.SSLContext;
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 
@@ -37,9 +39,13 @@ import org.apache.pulsar.client.api.PulsarClientException;
 import org.apache.pulsar.common.util.SecurityUtility;
 import org.apache.pulsar.policies.data.loadbalancer.ServiceLookupData;
 import org.eclipse.jetty.client.HttpClient;
-import org.eclipse.jetty.proxy.AsyncProxyServlet;
+import org.eclipse.jetty.client.ProtocolHandlers;
+import org.eclipse.jetty.client.RedirectProtocolHandler;
 import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.proxy.AsyncProxyServlet;
+import org.eclipse.jetty.util.HttpCookieStore;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,9 +68,66 @@ class AdminProxyHandler extends AsyncProxyServlet {
 
 @Override
 protected HttpClient createHttpClient() throws ServletException {
-HttpClient client = super.createHttpClient();
+ServletConfig config = getServletConfig();
+
+HttpClient client = newHttpClient();
+
 client.setFollowRedirects(true);
-return client;
+
+// Must not store cookies, otherwise cookies of different clients will 
mix.
+client.setCookieStore(new HttpCookieStore.Empty());
+
+Executor executor;
+String value = config.getInitParameter("maxThreads");
+if (value == null || "-".equals(value)) {
+executor = (Executor) 
getServletContext().getAttribute("org.eclipse.jetty.server.Executor");
+if (executor == null)
+throw new IllegalStateException("No server executor for 
proxy");
+} else {
+QueuedThreadPool qtp = new 
QueuedThreadPool(Integer.parseInt(value));
+String servletName = config.getServletName();
+int dot = servletName.lastIndexOf('.');
+if (dot >= 0)
+servletName = servletName.substring(dot + 1);
+qtp.setName(servletName);
+executor = qtp;
+}
+
+client.setExecutor(executor);
+
+value = config.getInitParameter("maxConnections");
+if (value == null)
+value = "256";
+client.setMaxConnectionsPerDestination(Integer.parseInt(value));
+
+value = config.getInitParameter("idleTimeout");
+if (value == null)
+value = "3";
+client.setIdleTimeout(Long.parseLong(value));
+
+value = config.getInitParameter("requestBufferSize");
+if (value != null)
+client.setRequestBufferSize(Integer.parseInt(value));
+
+value = config.getInitParameter("responseBufferSize");
+if (value != null)
+client.setResponseBufferSize(Integer.parseInt(value));
+
+try {
+client.start();
+
+// Content must not be decoded, otherwise the client gets confused.
+client.getContentDecoderFactories().clear();
+
+// Pass traffic to the client, only intercept what's necessary.
+ProtocolHandlers protocolHandlers = client.getProtocolHandlers();
+protocolHandlers.clear();
+protocolHandlers.put(new RedirectProtocolHandler(client));
+
+return client;
+} catch (Exception x) {
+throw new ServletException(x);
+}
 }
 
 @Override
diff --git 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/proxy/TestProxy.java
 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/proxy/TestProxy.java
new file mode 100644
ind

[GitHub] srkukarni closed issue #2660: Can not get topic stats from the admin API

2018-09-27 Thread GitBox
srkukarni closed issue #2660: Can not get topic stats from the admin API
URL: https://github.com/apache/pulsar/issues/2660
 
 
   


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] aahmed-se commented on issue #2504: Add Presto Sql Test

2018-09-27 Thread GitBox
aahmed-se commented on issue #2504: Add Presto Sql Test
URL: https://github.com/apache/pulsar/pull/2504#issuecomment-425308098
 
 
   run java8 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] aahmed-se commented on a change in pull request #2578: Add support for schema extraction from a jar

2018-09-27 Thread GitBox
aahmed-se commented on a change in pull request #2578: Add support for schema 
extraction from a jar
URL: https://github.com/apache/pulsar/pull/2578#discussion_r221137689
 
 

 ##
 File path: 
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSchemas.java
 ##
 @@ -34,6 +38,7 @@ public CmdSchemas(PulsarAdmin admin) {
 jcommander.addCommand("get", new GetSchema());
 jcommander.addCommand("delete", new DeleteSchema());
 jcommander.addCommand("upload", new UploadSchema());
+jcommander.addCommand("pojo", new PojoSchema());
 
 Review comment:
   we can probably rename it extract if that makes more sense if we combine it 
with it upload the parameters combinations they will have to be manually 
managed since there we no longer have required parameter annotations as they 
will be two distinct groups of params.
   @srkukarni 


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] aahmed-se commented on a change in pull request #2578: Add support for schema extraction from a jar

2018-09-27 Thread GitBox
aahmed-se commented on a change in pull request #2578: Add support for schema 
extraction from a jar
URL: https://github.com/apache/pulsar/pull/2578#discussion_r221139684
 
 

 ##
 File path: 
tests/integration/src/test/java/org/apache/pulsar/tests/integration/schema/TestSchema.java
 ##
 @@ -0,0 +1,93 @@
+/**
+ * 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.tests.integration.schema;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.pulsar.tests.integration.docker.ContainerExecResult;
+import org.apache.pulsar.tests.integration.topologies.PulsarCluster;
+import org.apache.pulsar.tests.integration.topologies.PulsarClusterSpec;
+import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase;
+import org.testng.Assert;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.util.stream.Stream;
+
+import static java.util.stream.Collectors.joining;
+
+/**
+ * Test schema operations
+ */
+@Slf4j
+public class TestSchema extends PulsarClusterTestBase {
+
+@BeforeSuite
+@Override
+public void setupCluster() throws Exception {
+final String clusterName = Stream.of(this.getClass().getSimpleName(), 
randomName(5))
+.filter(s -> s != null && !s.isEmpty())
+.collect(joining("-"));
+
+PulsarClusterSpec spec = PulsarClusterSpec.builder()
+.numBookies(2)
+.numBrokers(1)
+.clusterName(clusterName)
+.build();
+
+log.info("Setting up cluster {} with {} bookies, {} brokers",
+spec.clusterName(), spec.numBookies(), spec.numBrokers());
+
+pulsarCluster = PulsarCluster.forSpec(spec);
+pulsarCluster.start();
+
+log.info("Cluster {} is setup", spec.clusterName());
+}
+
+@AfterSuite
+@Override
+public void tearDownCluster() {
+super.tearDownCluster();
+}
+
+@Test(dataProvider = "ServiceAndAdminUrls")
+public void testJarPojoSchemaUploadAvro(String serviceUrl, String 
adminUrl) throws Exception {
+
+ContainerExecResult containerExecResult = 
pulsarCluster.runAdminCommandOnAnyBroker(
+"schemas",
+"pojo", "--jar", "/pulsar/examples/api-examples.jar", 
"--type", "avro",
+"--class-name", 
"org.apache.pulsar.functions.api.examples.pojo.Tick",
+"persistent://public/default/pojo-avro");
+
+Assert.assertEquals(containerExecResult.getExitCode(), 0);
 
 Review comment:
   I will write is as part of the pr


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] aahmed-se commented on a change in pull request #2578: Add support for schema extraction from a jar

2018-09-27 Thread GitBox
aahmed-se commented on a change in pull request #2578: Add support for schema 
extraction from a jar
URL: https://github.com/apache/pulsar/pull/2578#discussion_r221139684
 
 

 ##
 File path: 
tests/integration/src/test/java/org/apache/pulsar/tests/integration/schema/TestSchema.java
 ##
 @@ -0,0 +1,93 @@
+/**
+ * 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.tests.integration.schema;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.pulsar.tests.integration.docker.ContainerExecResult;
+import org.apache.pulsar.tests.integration.topologies.PulsarCluster;
+import org.apache.pulsar.tests.integration.topologies.PulsarClusterSpec;
+import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase;
+import org.testng.Assert;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.util.stream.Stream;
+
+import static java.util.stream.Collectors.joining;
+
+/**
+ * Test schema operations
+ */
+@Slf4j
+public class TestSchema extends PulsarClusterTestBase {
+
+@BeforeSuite
+@Override
+public void setupCluster() throws Exception {
+final String clusterName = Stream.of(this.getClass().getSimpleName(), 
randomName(5))
+.filter(s -> s != null && !s.isEmpty())
+.collect(joining("-"));
+
+PulsarClusterSpec spec = PulsarClusterSpec.builder()
+.numBookies(2)
+.numBrokers(1)
+.clusterName(clusterName)
+.build();
+
+log.info("Setting up cluster {} with {} bookies, {} brokers",
+spec.clusterName(), spec.numBookies(), spec.numBrokers());
+
+pulsarCluster = PulsarCluster.forSpec(spec);
+pulsarCluster.start();
+
+log.info("Cluster {} is setup", spec.clusterName());
+}
+
+@AfterSuite
+@Override
+public void tearDownCluster() {
+super.tearDownCluster();
+}
+
+@Test(dataProvider = "ServiceAndAdminUrls")
+public void testJarPojoSchemaUploadAvro(String serviceUrl, String 
adminUrl) throws Exception {
+
+ContainerExecResult containerExecResult = 
pulsarCluster.runAdminCommandOnAnyBroker(
+"schemas",
+"pojo", "--jar", "/pulsar/examples/api-examples.jar", 
"--type", "avro",
+"--class-name", 
"org.apache.pulsar.functions.api.examples.pojo.Tick",
+"persistent://public/default/pojo-avro");
+
+Assert.assertEquals(containerExecResult.getExitCode(), 0);
 
 Review comment:
   I will write is as part of this pr


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 #2671: Simplify ServiceUrlProvider related APIs

2018-09-27 Thread GitBox
merlimat opened a new pull request #2671: Simplify ServiceUrlProvider related 
APIs
URL: https://github.com/apache/pulsar/pull/2671
 
 
   ### Motivation
   
   I have seen few issues with ee5afa5007e260891140956d244a865d73368321: 
   
1. There are 3 new methods in the `PulsarClient` interface which are meant 
to be used together. We should reduce
   the public API to the minimum possible. So I propose to just have a 
`Pulsar.updateServiceUrl()` which internally
   will perform all the needed operations in order to reconnect the client 
to new endpoint.
   
2. We shouldn't be exposing `ClientConfigurationData` in the API since it 
belongs to `impl` package

3. There is a leak of resources when the `LookupService` gets replaced with 
the new one since the existing
   is not closed.
   
   ### Modifications
   
   Refactored to simplify API for adding `ServiceUrlProvider`
   
   cc/ @codelipenghui 
   
   It would be good to get this into 2.2 since it's changing the API for this 
new feature.


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] codelipenghui commented on issue #2671: Simplify ServiceUrlProvider related APIs

2018-09-27 Thread GitBox
codelipenghui commented on issue #2671: Simplify ServiceUrlProvider related APIs
URL: https://github.com/apache/pulsar/pull/2671#issuecomment-425325363
 
 
   👍
   
   Matteo Merli  于2018年9月28日周五 下午1:09写道:
   
   > Motivation
   >
   > I have seen few issues with ee5afa5
   > 

   > :
   >
   >1.
   >
   >There are 3 new methods in the PulsarClient interface which are meant
   >to be used together. We should reduce
   >the public API to the minimum possible. So I propose to just have a
   >Pulsar.updateServiceUrl() which internally
   >will perform all the needed operations in order to reconnect the
   >client to new endpoint.
   >2.
   >
   >We shouldn't be exposing ClientConfigurationData in the API since it
   >belongs to impl package
   >3.
   >
   >There is a leak of resources when the LookupService gets replaced with
   >the new one since the existing
   >is not closed.
   >
   > Modifications
   >
   > Refactored to simplify API for adding ServiceUrlProvider
   >
   > cc/ @codelipenghui 
   >
   > It would be good to get this into 2.2 since it's changing the API for this
   > new feature.
   > --
   > You can view, comment on, or merge this pull request online at:
   >
   >   https://github.com/apache/pulsar/pull/2671
   > Commit Summary
   >
   >- Simplify ServiceUrlProvider related APIs
   >
   > File Changes
   >
   >- *M*
   >
pulsar-broker/src/test/java/org/apache/pulsar/client/api/ServiceUrlProviderTest.java
   > (8)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/api/PulsarClient.java
   > (35)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/api/ServiceUrlProvider.java
   > (25)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/impl/BinaryProtoLookupService.java
   > (8)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientBuilderImpl.java
   > (2)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java
   > (20)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpClient.java
   > (18)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpLookupService.java
   > (5)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/impl/LookupService.java
   > (6)
   >- *M*
   >
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
   > (22)
   >
   > Patch Links:
   >
   >- https://github.com/apache/pulsar/pull/2671.patch
   >- https://github.com/apache/pulsar/pull/2671.diff
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > , or mute the thread
   > 

   > .
   >
   


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] aahmed-se commented on issue #2578: Add support for schema extraction from a jar

2018-09-27 Thread GitBox
aahmed-se commented on issue #2578: Add support for schema extraction from a jar
URL: https://github.com/apache/pulsar/pull/2578#issuecomment-425332086
 
 
   added producer consumer test


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