[GitHub] [pulsar] codelipenghui commented on issue #4621: [PIP-38] Support batch receive in java client.

2019-06-30 Thread GitBox
codelipenghui commented on issue #4621: [PIP-38] Support batch receive in java 
client.
URL: https://github.com/apache/pulsar/pull/4621#issuecomment-507139860
 
 
   run java8 tests
   run Integration Tests 


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


With regards,
Apache Git Services


[GitHub] [pulsar] codelipenghui opened a new pull request #4645: Allows consumer retrieve the sequence id that the producer set.

2019-06-30 Thread GitBox
codelipenghui opened a new pull request #4645: Allows consumer retrieve the 
sequence id that the producer set.
URL: https://github.com/apache/pulsar/pull/4645
 
 
   Fixes #4643 
   
   ### Motivation
   
   Allows consumer retrieve the sequence id that the producer set while enable 
batch producing.
   
   ### Modifications
   
   Add sequence_id for SingleMessageMetadata in PulsarApi.proto
   
   ### Verifying this change
   
   Added new unit tests.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
 - Dependencies (does it add or upgrade a dependency): (no)
 - The public API: (yes)
 - The schema: (no)
 - The default values of configurations: (no)
 - The wire protocol: (yes)
 - The rest endpoints: (no)
 - The admin cli options: (no)
 - Anything that affects deployment: (no)
   
   ### Documentation
   
 - Does this pull request introduce a new feature? (no)
   


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


With regards,
Apache Git Services


[GitHub] [pulsar] codelipenghui commented on issue #4621: [PIP-38] Support batch receive in java client.

2019-06-30 Thread GitBox
codelipenghui commented on issue #4621: [PIP-38] Support batch receive in java 
client.
URL: https://github.com/apache/pulsar/pull/4621#issuecomment-507097324
 
 
   @sijie I have addressed your comments, please review again.


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


With regards,
Apache Git Services


[pulsar.wiki] branch master updated: Updated PIP 38: Batch Receiving Messages (markdown)

2019-06-30 Thread penghui
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 8c093a4  Updated PIP 38: Batch Receiving Messages (markdown)
8c093a4 is described below

commit 8c093a4466bcc781bbc09be40f8bbfd833dcdb0a
Author: lipenghui 
AuthorDate: Mon Jul 1 09:58:16 2019 +0800

Updated PIP 38: Batch Receiving Messages (markdown)
---
 PIP-38:-Batch-Receiving-Messages.md | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PIP-38:-Batch-Receiving-Messages.md 
b/PIP-38:-Batch-Receiving-Messages.md
index ab0ef88..92a5001 100644
--- a/PIP-38:-Batch-Receiving-Messages.md
+++ b/PIP-38:-Batch-Receiving-Messages.md
@@ -213,13 +213,13 @@ public class BatchReceivePolicy {
  * Max size of messages: 10MB
  * Timeout: 100ms
  */
-   public static final BatchReceivePolicy DEFAULT_POLICY = new 
BatchReceivePolicy(
-100, 1024 * 1024 * 10, 100, TimeUnit.MILLISECONDS);
+public static final BatchReceivePolicy DEFAULT_POLICY = new 
BatchReceivePolicy(
+100, 1024 * 1024 * 10, 100, TimeUnit.MILLISECONDS);
   
-   /**
+/**
  * Max number of message for a single batch receive, 0 or negative means 
no limit.
  */
-   private int maxNumMessages;
+private int maxNumMessages;
   
 /**
  * Max size of message for a single batch receive, 0 or negative means no 
limit.



[pulsar.wiki] branch master updated: Updated PIP 38: Batch Receiving Messages (markdown)

2019-06-30 Thread penghui
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 0b9e6d9  Updated PIP 38: Batch Receiving Messages (markdown)
0b9e6d9 is described below

commit 0b9e6d91709f50a0bbb21f0b54518fa4fbbeb1b3
Author: lipenghui 
AuthorDate: Mon Jul 1 09:56:45 2019 +0800

Updated PIP 38: Batch Receiving Messages (markdown)
---
 PIP-38:-Batch-Receiving-Messages.md | 44 ++---
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/PIP-38:-Batch-Receiving-Messages.md 
b/PIP-38:-Batch-Receiving-Messages.md
index 94a030f..ab0ef88 100644
--- a/PIP-38:-Batch-Receiving-Messages.md
+++ b/PIP-38:-Batch-Receiving-Messages.md
@@ -5,7 +5,7 @@
 
 ## Motivation
 
-Batch processing is a commonly used to improve throughput, support batch 
receving in client can be better adapted to user's existing batch 
operations(batch insert data to database or other bulk APIs). At present, 
pulsar client provide the ability to receive a single message. If users want to 
take advantage of batch operating advantages, need to implement a message 
collector him self. 
+Batch processing is commonly used to improve throughput, support batch 
receiving in client can be better adapted to user's existing batch 
operations(batch insert data to database or other bulk APIs). At present, 
pulsar client provides the ability to receive a single message. If users want 
to take advantage of batch operating advantages, need to implement a message 
collector himself. 
 
 For throughput optimization in the future will benefit from batch receiving , 
it can allow lazy deserialization and object creation, can also reduce 
`incomingMessages` enqueue and dequeue times 
 
@@ -17,7 +17,7 @@ Batch receiving should have the following capabilities:
 
 - Multiple messages can be received at a time
 - Users can set the max number or size of messages received in batches for 
consumers
-- Provide an timeout mechanism to avoid waiting indefinitely
+- Provide a timeout mechanism to avoid waiting indefinitely
 
 ## Usage
 
@@ -41,11 +41,11 @@ Consumer consumer = 
pulsarClient.newConsumer(Schema.STRING)
 .subscribe();
 ```
 
-Batch receive policy can met multiple use cases:
+Batch receive policy can meet multiple use cases:
 
 **Fixed number of messages**
 
-Consumer will be blocked until has enough number of messages avaliable.
+Consumer will be blocked until has enough number of messages available.
 
 ```java
 BatchReceivePolicy.builder().maxNumMessages(10).build();
@@ -53,7 +53,7 @@ BatchReceivePolicy.builder().maxNumMessages(10).build();
 
 **Fixed bytes of messages**
 
-Consumer will be blocked until has enough bytes of messages avaliable.
+Consumer will be blocked until has enough bytes of messages available.
 
 ```java
 BatchReceivePolicy.builder().maxNumBytes(1024 * 1024 * 10).build();
@@ -73,7 +73,7 @@ BatchReceivePolicy.builder().timeout(1, 
TimeUnit.SECONDS).build();
 
 > Note:
 >
-> This way will not limit the number or bytes of a messages batch, ensure have 
enough memory resources to maintain the messages batch in a single time period.
+> This way will not limit the number or bytes of a message batch, ensure have 
enough memory resources to maintain the messages batch in a single time period.
 
 **Hybrid control**
 
@@ -115,7 +115,7 @@ public interface Messages extends Iterable> {
  * Batch receiving messages
  * 
  * This calls blocks until has enough messages or wait timeout, more details 
to see {@link BatchReceivePolicy}
- *
+ 
  * @return messages
  * @since 2.5.0
  * @throws PulsarClientException
@@ -140,7 +140,7 @@ CompletableFuture> batchReceiveAsync();
 
 /**
  * Acknowledge the consumption of {@link Messages}
- *
+ 
  * @param messages messages
  * @throws PulsarClientException.AlreadyClosedException
  *  if the consumer was already closed
@@ -155,16 +155,16 @@ void acknowledge(Messages messages) throws 
PulsarClientException;
  * with {@link ConsumerBuilder#negativeAckRedeliveryDelay(long, TimeUnit)}.
  * 
  * This call is not blocking.
- *
+ 
  * 
  * Example of usage:
  * 
  * while (true) {
  * Messages msgs = consumer.batchReceive();
- *
+ 
  * try {
  *  // Process message...
- *
+ 
  *  consumer.acknowledge(msgs);
  * } catch (Throwable t) {
  *  log.warn("Failed to process message");
@@ -172,7 +172,7 @@ void acknowledge(Messages messages) throws 
PulsarClientException;
  * }
  * }
  * 
- *
+ 
  * @param message
  *The {@code Message} to be acknowledged
  */
@@ -184,31 +184,31 @@ void negativeAcknowledge(Messages messages);
 ```java
 /**
  * Configuration for message batch receive {@link Consumer#batchReceive()} 
{@link Consumer#batchReceiveAsync()}.
- *
+ 
  * Batch receive policy can limit the number and size of messages in a sin

[GitHub] [pulsar] jerrypeng opened a new pull request #4644: Improve and add authorization to function download and upload

2019-06-30 Thread GitBox
jerrypeng opened a new pull request #4644:  Improve and add authorization to 
function download and upload
URL: https://github.com/apache/pulsar/pull/4644
 
 
   ### Motivation
   
   Currently, the download and upload function endpoints do not have any 
authorization which allows any authenticated user to download or upload 
anything.
   
   ### Modifications
   
   For the existing download or upload endpoints, only allow superUsers be able 
to access these endpoints. 
   
   Add a download endpoint with authorization that allows users to download 
function package.  The endpoint takes parameters tenant, namespace, and name.  
Then the latest function package will be returned.
   
   Allow pulsar-admin to use that endpoint as well.
   
   Change KubernetesRuntime to use that as well
   
   Not sure why we have an upload endpoint.  Not really used anywhere.  We 
should probably just remove it in the future.


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


With regards,
Apache Git Services


[GitHub] [pulsar] sijie commented on a change in pull request #4539: [Pulsar-Client] Add Producer Builder API Numeric Properties Validations

2019-06-30 Thread GitBox
sijie commented on a change in pull request #4539: [Pulsar-Client] Add Producer 
Builder API Numeric Properties Validations
URL: https://github.com/apache/pulsar/pull/4539#discussion_r298834733
 
 

 ##
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java
 ##
 @@ -213,18 +214,21 @@ private ProducerBuilderImpl(PulsarClientImpl client, 
ProducerConfigurationData c
 
 @Override
 public ProducerBuilder batchingMaxPublishDelay(long batchDelay, 
@NonNull TimeUnit timeUnit) {
+checkArgument(batchDelay >= 0, "batchDelay needs to be >= 0");
 
 Review comment:
   sgtm


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


With regards,
Apache Git Services


[GitHub] [pulsar] sijie commented on issue #4405: Why pulsar java client doesn't support batch message consuming?

2019-06-30 Thread GitBox
sijie commented on issue #4405: Why pulsar java client doesn't support batch 
message consuming?
URL: https://github.com/apache/pulsar/issues/4405#issuecomment-507032803
 
 
   @codelipenghui is working on adding the feature in #4621 


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


With regards,
Apache Git Services


[GitHub] [pulsar] erenavsarogullari commented on a change in pull request #4539: [Pulsar-Client] Add Producer Builder API Numeric Properties Validations

2019-06-30 Thread GitBox
erenavsarogullari commented on a change in pull request #4539: [Pulsar-Client] 
Add Producer Builder API Numeric Properties Validations
URL: https://github.com/apache/pulsar/pull/4539#discussion_r298832100
 
 

 ##
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java
 ##
 @@ -213,18 +214,21 @@ private ProducerBuilderImpl(PulsarClientImpl client, 
ProducerConfigurationData c
 
 @Override
 public ProducerBuilder batchingMaxPublishDelay(long batchDelay, 
@NonNull TimeUnit timeUnit) {
+checkArgument(batchDelay >= 0, "batchDelay needs to be >= 0");
 conf.setBatchingMaxPublishDelayMicros(timeUnit.toMicros(batchDelay));
 return this;
 }
 
 @Override
 public ProducerBuilder batchingMaxMessages(int 
batchMessagesMaxMessagesPerBatch) {
+checkArgument(batchMessagesMaxMessagesPerBatch >= 0, 
"batchMessagesMaxMessagesPerBatch needs to be >= 0");
 
 Review comment:
   Sure, will be addressing this as well.


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


With regards,
Apache Git Services


[GitHub] [pulsar] erenavsarogullari commented on a change in pull request #4539: [Pulsar-Client] Add Producer Builder API Numeric Properties Validations

2019-06-30 Thread GitBox
erenavsarogullari commented on a change in pull request #4539: [Pulsar-Client] 
Add Producer Builder API Numeric Properties Validations
URL: https://github.com/apache/pulsar/pull/4539#discussion_r298832075
 
 

 ##
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java
 ##
 @@ -213,18 +214,21 @@ private ProducerBuilderImpl(PulsarClientImpl client, 
ProducerConfigurationData c
 
 @Override
 public ProducerBuilder batchingMaxPublishDelay(long batchDelay, 
@NonNull TimeUnit timeUnit) {
+checkArgument(batchDelay >= 0, "batchDelay needs to be >= 0");
 
 Review comment:
   I agree to keep these kind of validation in single tier and support required 
APIs by avoiding code duplication. 
   
   So, currently, the following `setters` look like requiring alignment on 
`ProducerConfigurationData`.
   ```
   setProducerName
   setSendTimeoutMs
   setMaxPendingMessages
   setMaxPendingMessagesAcrossPartitions
   setBatchingMaxPublishDelayMicros
   setBatchingMaxMessages
   ```
   Will be submitting new patch if we do not have any concern.


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


With regards,
Apache Git Services


[pulsar] branch master updated: Dashboard filter out old namespace data from home screen (#4597)

2019-06-30 Thread sijie
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/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new cc022f1  Dashboard filter out old namespace data from home screen 
(#4597)
cc022f1 is described below

commit cc022f1691d23eebecd9fdfc3a2437d26dbbc208
Author: rshermanTHG <48561471+rsherman...@users.noreply.github.com>
AuthorDate: Sun Jun 30 12:59:29 2019 +0100

Dashboard filter out old namespace data from home screen (#4597)

### Motivation

Duplicate namespace information was being shown in the home page e.g. 
Number of namespaces in a tenant.

### Modifications

On the home screen filter to include data only from namespaces with the 
current timestamp.
---
 dashboard/django/stats/views.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dashboard/django/stats/views.py b/dashboard/django/stats/views.py
index fe6011b..b49994b 100644
--- a/dashboard/django/stats/views.py
+++ b/dashboard/django/stats/views.py
@@ -48,6 +48,7 @@ def home(request):
 numNamespaces = Subquery(
 Namespace.objects.filter(
 deleted=False,
+timestamp=ts,
 property=OuterRef('pk')
 ).values('property')
 .annotate(cnt=Count('pk'))



[GitHub] [pulsar] sijie merged pull request #4597: Dashboard filter out old namespace data from home screen

2019-06-30 Thread GitBox
sijie merged pull request #4597: Dashboard filter out old namespace data from 
home screen
URL: https://github.com/apache/pulsar/pull/4597
 
 
   


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


With regards,
Apache Git Services


[GitHub] [pulsar] sijie merged pull request #4616: [pulsar-broker] fix deadlock on get-status rest-api call

2019-06-30 Thread GitBox
sijie merged pull request #4616: [pulsar-broker] fix deadlock on get-status 
rest-api call
URL: https://github.com/apache/pulsar/pull/4616
 
 
   


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


With regards,
Apache Git Services


[pulsar] branch master updated: [pulsar-broker] fix deadlock on get-status rest-api call (#4616)

2019-06-30 Thread sijie
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/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
 new f272df9  [pulsar-broker] fix deadlock on get-status rest-api call 
(#4616)
f272df9 is described below

commit f272df9211b2d8acf77284ed3e00f6a68b173358
Author: Rajan Dhabalia 
AuthorDate: Sun Jun 30 04:58:35 2019 -0700

[pulsar-broker] fix deadlock on get-status rest-api call (#4616)

### Motivation

due to some issue if broker fails to complete topic-loading then getting 
stats of that topic blocks web-thread.

```
"pulsar-web-30-13" #242 prio=5 os_prio=0 tid=0x2b0b3c001000 nid=0x2540 
waiting on condition [0x2b0aa7d0a000]
   java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0x00072560a180> (a 
java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at 
java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1693)
at 
java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
at 
java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1729)
at 
java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1934)
at 
org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.getTopicReference(PersistentTopicsBase.java:1253)
at 
org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalGetStats(PersistentTopicsBase.java:592)
at 
org.apache.pulsar.broker.admin.v1.PersistentTopics.getStats(PersistentTopics.java:240)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
```
---
 .../pulsar/broker/admin/impl/PersistentTopicsBase.java   | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
index 29dc789..5ed35cf 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
@@ -39,7 +39,6 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
@@ -1339,8 +1338,15 @@ public class PersistentTopicsBase extends AdminResource {
  * Get the Topic object reference from the Pulsar broker
  */
 private Topic getTopicReference(TopicName topicName) {
-return 
pulsar().getBrokerService().getTopicIfExists(topicName.toString()).join()
-.orElseThrow(() -> topicNotFoundReason(topicName));
+try {
+return 
pulsar().getBrokerService().getTopicIfExists(topicName.toString())
+
.get(pulsar().getConfiguration().getZooKeeperSessionTimeoutMillis(), 
TimeUnit.MILLISECONDS)
+.orElseThrow(() -> topicNotFoundReason(topicName));
+} catch (RestException e) {
+throw e;
+} catch (Exception e) {
+throw new RestException(e);
+}
 }
 
 private RestException topicNotFoundReason(TopicName topicName) {



[GitHub] [pulsar] sijie opened a new issue #4643: Per message sequence id is lost in message batch

2019-06-30 Thread GitBox
sijie opened a new issue #4643: Per message sequence id is lost in message batch
URL: https://github.com/apache/pulsar/issues/4643
 
 
   **Describe the bug**
   
   Produce 10 messages using following code:
   
   ```
   for (int i = 1; i <= numMessages; i++) {
   producer.newMessage()
   .value("value-" + i)
   .sequenceId(i)
   .sendAsync();
   }
   producer.flush();
   ```
   
   The 10 messages will return the same sequence id `1`. Because currently we 
only store the sequence id for the first message in the message batch.
   
   **To Reproduce**
   
   Run the code example
   
   **Expected behavior**
   
   User might be using offset as sequence id when copying a file into pulsar 
topic. The sequence id will be dropped by Pulsar and the consumers can't 
retrieve the sequence id that the producer set.
   
   **Additional context**
   
   N/A


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


With regards,
Apache Git Services


[GitHub] [pulsar] sijie opened a new issue #4642: producer#flush doesn't work as expected

2019-06-30 Thread GitBox
sijie opened a new issue #4642: producer#flush doesn't work as expected
URL: https://github.com/apache/pulsar/issues/4642
 
 
   **Describe the bug**
   
   The following code example should produce two message batches. but only one 
message batch is produced.
   
   ```
   producer.sendAsync("message1");
   producer.sendAsync("message2");
   producer.flush();
   
   producer.sendAsync("message3");
   producer.sendAsync("message4");
   producer.flush();
   ```
   
   **To Reproduce**
   
   Use the example code to reproduce
   
   **Expected behavior**
   
   When `flush` is triggered, it should flush out all the messages.
   
   **Additional context**
   
   The problem is due to following logic. if the connection is not connected, 
it doesn't send the batch. 
   
   ```
   private void processOpSendMsg(OpSendMsg op) {
   try {
   batchMessageContainer.clear();
   pendingMessages.put(op);
   ClientCnx cnx = cnx();
   if (isConnected()) {
   // If we do have a connection, the message is sent 
immediately, otherwise we'll try again once a new
   // connection is established
   op.cmd.retain();
   
cnx.ctx().channel().eventLoop().execute(WriteInEventLoopCallback.create(this, 
cnx, op));
   stats.updateNumMsgsSent(op.numMessagesInBatch, 
op.batchSizeByte);
   } else {
   if (log.isDebugEnabled()) {
   log.debug("[{}] [{}] Connection is not ready -- 
sequenceId {}", topic, producerName,
   op.sequenceId);
   }
   }
   } catch (InterruptedException ie) {
   Thread.currentThread().interrupt();
   semaphore.release(op.numMessagesInBatch);
   if (op != null) {
   op.callback.sendComplete(new PulsarClientException(ie));
   }
   } catch (Throwable t) {
   semaphore.release(op.numMessagesInBatch);
   log.warn("[{}] [{}] error while closing out batch -- {}", topic, 
producerName, t);
   if (op != null) {
   op.callback.sendComplete(new PulsarClientException(t));
   }
   }
   }
   ```


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


With regards,
Apache Git Services


[GitHub] [pulsar] sijie commented on a change in pull request #4577: fix issue when submitting NAR via file url

2019-06-30 Thread GitBox
sijie commented on a change in pull request #4577: fix issue when submitting 
NAR via file url
URL: https://github.com/apache/pulsar/pull/4577#discussion_r298827578
 
 

 ##
 File path: 
pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java
 ##
 @@ -318,79 +322,89 @@ public static ExtractedSinkDetails validate(SinkConfig 
sinkConfig, Path archiveP
 throw new IllegalArgumentException("Sink timeout must be a 
positive number");
 }
 
-String sinkClassName;
-final Class typeArg;
-final ClassLoader classLoader;
-if (!isEmpty(sinkConfig.getClassName())) {
-sinkClassName = sinkConfig.getClassName();
-// We really don't know if we should use nar class loader or 
regular classloader
-ClassLoader jarClassLoader = null;
-ClassLoader narClassLoader = null;
-try {
-jarClassLoader = 
FunctionCommon.extractClassLoader(archivePath, uploadedInputStreamAsFile);
-} catch (Exception e) {
+
+Class typeArg;
+ClassLoader classLoader;
+String sinkClassName = sinkConfig.getClassName();
+ClassLoader jarClassLoader = null;
+ClassLoader narClassLoader = null;
+try {
+jarClassLoader = FunctionCommon.extractClassLoader(archivePath, 
sinkPackageFile);
+} catch (Exception e) {
 
 Review comment:
   I am not sure we should use suffix for this. These days more and more 
applications don't use suffix for checking if the file is the expected type. 


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


With regards,
Apache Git Services


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

2019-06-30 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 8b6c4df  Updated site at revision c0a57d0
8b6c4df is described below

commit 8b6c4dfec16b9a15ca61d8dbb8bc363d03fc78da
Author: jenkins 
AuthorDate: Sun Jun 30 08:40:55 2019 +

Updated site at revision c0a57d0
---
 content/swagger/2.5.0-SNAPSHOT/swagger.json| 34 -
 .../swagger/2.5.0-SNAPSHOT/swaggerfunctions.json   | 44 +++---
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/content/swagger/2.5.0-SNAPSHOT/swagger.json 
b/content/swagger/2.5.0-SNAPSHOT/swagger.json
index 4e73946..0728e7d 100644
--- a/content/swagger/2.5.0-SNAPSHOT/swagger.json
+++ b/content/swagger/2.5.0-SNAPSHOT/swagger.json
@@ -4777,7 +4777,7 @@
   "200" : {
 "description" : "successful operation",
 "schema" : {
-  "$ref" : "#/definitions/TopicStats"
+  "$ref" : "#/definitions/NonPersistentTopicStats"
 }
   },
   "401" : {
@@ -8638,14 +8638,14 @@
   "type" : "number",
   "format" : "double"
 },
-"overLoaded" : {
-  "type" : "boolean"
+"bandwidthIn" : {
+  "$ref" : "#/definitions/ResourceUsage"
 },
-"underLoaded" : {
-  "type" : "boolean"
+"bandwidthOut" : {
+  "$ref" : "#/definitions/ResourceUsage"
 },
-"loadReportType" : {
-  "type" : "string"
+"memory" : {
+  "$ref" : "#/definitions/ResourceUsage"
 },
 "cpu" : {
   "$ref" : "#/definitions/ResourceUsage"
@@ -8657,22 +8657,22 @@
   "type" : "integer",
   "format" : "int64"
 },
-"msgThroughputIn" : {
-  "type" : "number",
-  "format" : "double"
-},
 "msgThroughputOut" : {
   "type" : "number",
   "format" : "double"
 },
-"bandwidthIn" : {
-  "$ref" : "#/definitions/ResourceUsage"
+"underLoaded" : {
+  "type" : "boolean"
 },
-"bandwidthOut" : {
-  "$ref" : "#/definitions/ResourceUsage"
+"overLoaded" : {
+  "type" : "boolean"
 },
-"memory" : {
-  "$ref" : "#/definitions/ResourceUsage"
+"loadReportType" : {
+  "type" : "string"
+},
+"msgThroughputIn" : {
+  "type" : "number",
+  "format" : "double"
 }
   }
 },
diff --git a/content/swagger/2.5.0-SNAPSHOT/swaggerfunctions.json 
b/content/swagger/2.5.0-SNAPSHOT/swaggerfunctions.json
index ab9f196..286b05e 100644
--- a/content/swagger/2.5.0-SNAPSHOT/swaggerfunctions.json
+++ b/content/swagger/2.5.0-SNAPSHOT/swaggerfunctions.json
@@ -1348,19 +1348,11 @@
 "Message" : {
   "type" : "object",
   "properties" : {
-"messageId" : {
-  "$ref" : "#/definitions/MessageId"
-},
-"sequenceId" : {
-  "type" : "integer",
-  "format" : "int64"
+"replicated" : {
+  "type" : "boolean"
 },
-"keyBytes" : {
-  "type" : "array",
-  "items" : {
-"type" : "string",
-"format" : "byte"
-  }
+"replicatedFrom" : {
+  "type" : "string"
 },
 "orderingKey" : {
   "type" : "array",
@@ -1372,20 +1364,13 @@
 "encryptionCtx" : {
   "$ref" : "#/definitions/EncryptionContext"
 },
-"redeliveryCount" : {
-  "type" : "integer",
-  "format" : "int32"
-},
-"schemaVersion" : {
+"keyBytes" : {
   "type" : "array",
   "items" : {
 "type" : "string",
 "format" : "byte"
   }
 },
-"replicated" : {
-  "type" : "boolean"
-},
 "publishTime" : {
   "type" : "integer",
   "format" : "int64"
@@ -1397,8 +1382,23 @@
 "topicName" : {
   "type" : "string"
 },
-"replicatedFrom" : {
-  "type" : "string"
+"messageId" : {
+  "$ref" : "#/definitions/MessageId"
+},
+"sequenceId" : {
+  "type" : "integer",
+  "format" : "int64"
+},
+"redeliveryCount" : {
+  "type" : "integer",
+  "format" : "int32"
+},
+"schemaVersion" : {
+  "type" : "array",
+  "items" : {
+"type" : "string",
+"format" : "byte"
+  }
 },
 "producerName" : {
   "type" : "string"