zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1160917 - in /zookeeper/bookkeeper/trunk: CHANGES.txt hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigPublisher.java
Date Tue, 23 Aug 2011 22:42:32 GMT
Author: breed
Date: Tue Aug 23 22:42:32 2011
New Revision: 1160917

URL: http://svn.apache.org/viewvc?rev=1160917&view=rev
Log:
BOOKKEEPER-44: Reuse publish channel to default server to avoid too many connect requests
to default server when lots of producers came in same time

Modified:
    zookeeper/bookkeeper/trunk/CHANGES.txt
    zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigPublisher.java

Modified: zookeeper/bookkeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/CHANGES.txt?rev=1160917&r1=1160916&r2=1160917&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/CHANGES.txt (original)
+++ zookeeper/bookkeeper/trunk/CHANGES.txt Tue Aug 23 22:42:32 2011
@@ -35,3 +35,9 @@ BUGFIXES:
  hedwig-server/
 
   BOOKKEEPER-43: NullPointException when releasing topic (Sijie Guo via breed)
+
+IMPROVEMENTS:
+
+ hedwig-client/
+
+  BOOKKEEPER-44: Reuse publish channel to default server to avoid too many connect requests
to default server when lots of producers came in same time (Sijie Guo via breed)

Modified: zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigPublisher.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigPublisher.java?rev=1160917&r1=1160916&r2=1160917&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigPublisher.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigPublisher.java
Tue Aug 23 22:42:32 2011
@@ -130,7 +130,13 @@ public class HedwigPublisher implements 
             // default server host/port as defined in the configs. This should
             // point to the server VIP which would redirect to a random server
             // (which might not be the server hosting the topic).
-            client.doConnect(pubSubData, cfg.getDefaultServerHost());
+            InetSocketAddress host = cfg.getDefaultServerHost();
+            if (host2Channel.containsKey(host)) {
+                // if there is a channel to default server, use it!
+                doPublish(pubSubData, host2Channel.get(host));
+                return;
+            }
+            client.doConnect(pubSubData, host);
         }
     }
 



Mime
View raw message