storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [3/5] storm git commit: Bring back removal of client from context on closing
Date Tue, 14 Jul 2015 19:06:02 GMT
Bring back removal of client from context on closing


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

Branch: refs/heads/0.10.x-branch
Commit: f5db06ce2809c3b66f2d797f979f8c40133c2f60
Parents: a2502c3
Author: Enno Shioji <eshioji@gmail.com>
Authored: Fri Jul 3 01:02:00 2015 +0100
Committer: Enno Shioji <eshioji@gmail.com>
Committed: Fri Jul 3 01:02:00 2015 +0100

----------------------------------------------------------------------
 storm-core/src/jvm/backtype/storm/messaging/netty/Client.java  | 6 ++++--
 storm-core/src/jvm/backtype/storm/messaging/netty/Context.java | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/f5db06ce/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
index 30a3ba7..5b130fa 100644
--- a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
+++ b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
@@ -116,15 +116,18 @@ public class Client extends ConnectionWithStatus implements IStatefulObject
{
      */
     private volatile boolean closing = false;
 
+    private final Context context;
+
     private final HashedWheelTimer scheduler;
 
     private final MessageBuffer batcher;
 
     @SuppressWarnings("rawtypes")
-    Client(Map stormConf, ChannelFactory factory, HashedWheelTimer scheduler, String host,
int port) {
+    Client(Map stormConf, ChannelFactory factory, HashedWheelTimer scheduler, String host,
int port, Context context) {
         this.stormConf = stormConf;
         closing = false;
         this.scheduler = scheduler;
+        this.context = context;
         int bufferSize = Utils.getInt(stormConf.get(Config.STORM_MESSAGING_NETTY_BUFFER_SIZE));
         LOG.info("creating Netty Client, connecting to {}:{}, bufferSize: {}", host, port,
bufferSize);
         int messageBatchSize = Utils.getInt(stormConf.get(Config.STORM_NETTY_MESSAGE_BATCH_SIZE),
262144);
@@ -360,7 +363,6 @@ public class Client extends ConnectionWithStatus implements IStatefulObject
{
         if (!closing) {
             LOG.info("closing Netty Client {}", dstAddressPrefixedName);
             context.removeClient(dstAddress.getHostName(),dstAddress.getPort());
-            context = null;
             // Set closing to true to prevent any further reconnection attempts.
             closing = true;
             waitForPendingMessagesToBeSent();

http://git-wip-us.apache.org/repos/asf/storm/blob/f5db06ce/storm-core/src/jvm/backtype/storm/messaging/netty/Context.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/messaging/netty/Context.java b/storm-core/src/jvm/backtype/storm/messaging/netty/Context.java
index 2baad0e..2edc804 100644
--- a/storm-core/src/jvm/backtype/storm/messaging/netty/Context.java
+++ b/storm-core/src/jvm/backtype/storm/messaging/netty/Context.java
@@ -86,7 +86,7 @@ public class Context implements IContext {
             return connection;
         }
         IConnection client =  new Client(storm_conf, clientChannelFactory, 
-                clientScheduleService, host, port);
+                clientScheduleService, host, port, this);
         connections.put(key(host, port), client);
         return client;
     }


Mime
View raw message