You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/06/11 18:10:12 UTC

[40/50] [abbrv] git commit: STORM-297: avoid call IConneciton.send() when there is no message in the iterator.

STORM-297: avoid call IConneciton.send() when there is no message in the iterator.


Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/b4422f13
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/b4422f13
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/b4422f13

Branch: refs/heads/security
Commit: b4422f13b6c609b5f68eb0a053f4bc08182f97d5
Parents: f6915d4
Author: Sean Zhong <cl...@gmail.com>
Authored: Sun Jun 8 01:03:05 2014 +0800
Committer: Sean Zhong <cl...@gmail.com>
Committed: Sun Jun 8 01:03:05 2014 +0800

----------------------------------------------------------------------
 storm-core/src/jvm/backtype/storm/utils/TransferDrainer.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/b4422f13/storm-core/src/jvm/backtype/storm/utils/TransferDrainer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/TransferDrainer.java b/storm-core/src/jvm/backtype/storm/utils/TransferDrainer.java
index c9f1b04..0e53632 100644
--- a/storm-core/src/jvm/backtype/storm/utils/TransferDrainer.java
+++ b/storm-core/src/jvm/backtype/storm/utils/TransferDrainer.java
@@ -50,7 +50,7 @@ public class TransferDrainer {
       if (null != connection) { 
         ArrayList<ArrayList<TaskMessage>> bundle = bundles.get(hostPort);
         Iterator<TaskMessage> iter = getBundleIterator(bundle);
-        if (null != iter) {
+        if (null != iter && iter.hasNext()) {
           connection.send(iter);
         }
       }