You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/05/25 04:07:17 UTC
[jira] [Commented] (STORM-835) Netty Client hold batch object until
io operation complete
[ https://issues.apache.org/jira/browse/STORM-835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14557928#comment-14557928 ]
ASF GitHub Bot commented on STORM-835:
--------------------------------------
GitHub user Hailei opened a pull request:
https://github.com/apache/storm/pull/563
STORM-835 Netty Client hold batch object until io operation complete
STORM-835 Netty Client hold batch object until io operation complete
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Hailei/storm-1 storm-netty-client-improve
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/563.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #563
----
commit f3d5aca8c6eaf3057abe43dccea42b509de70987
Author: zhanghailei <zh...@youku.com>
Date: 2015-05-25T02:00:12Z
STORM-835 Netty Client hold batch object until io operation complete
----
> Netty Client hold batch object until io operation complete
> ----------------------------------------------------------
>
> Key: STORM-835
> URL: https://issues.apache.org/jira/browse/STORM-835
> Project: Apache Storm
> Issue Type: Improvement
> Affects Versions: 0.10.0
> Reporter: zhanghailei
> Priority: Minor
>
> Netty Client hold batch object until IO operation complete.
> Following code:
> {code:title=Client.java|borderStyle=solid}
> final int numMessages = batch.size();
> pendingMessages.getAndAdd(numMessages);
> LOG.debug("writing {} messages to channel {}", batch.size(), channel.toString());
> ChannelFuture future = channel.write(batch);
> future.addListener(new ChannelFutureListener() {
> public void operationComplete(ChannelFuture future) throws Exception {
> pendingMessages.getAndAdd(0 - numMessages);
> if (future.isSuccess()) {
> LOG.debug("sent {} messages to {}", numMessages, dstAddressPrefixedName);
> messagesSent.getAndAdd(batch.size());
> }
> {code}
> batch will be a field of anonymous inner classes.don't release after channel.write() invoked,until IO operation complete.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)