Repository: incubator-rocketmq
Updated Branches:
  refs/heads/master 8ff25b359 -> 169450e1f


[ROCKETMQ-70] Duplicate methods in NettyRemotingClient, closes 
apache/incubator-rocketmq#48


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

Branch: refs/heads/master
Commit: 169450e1f946951d18c17e3f86b988b46c4c8672
Parents: 8ff25b3
Author: shroman <[email protected]>
Authored: Mon Jan 23 16:01:10 2017 +0800
Committer: yukon <[email protected]>
Committed: Mon Jan 23 16:01:10 2017 +0800

----------------------------------------------------------------------
 .../remoting/netty/NettyRemotingClient.java     | 26 +++++++-------------
 1 file changed, 9 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/169450e1/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
----------------------------------------------------------------------
diff --git 
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
 
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
index 9fdaccf..d84f2a8 100644
--- 
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
+++ 
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
@@ -327,11 +327,6 @@ public class NettyRemotingClient extends 
NettyRemotingAbstract implements Remoti
     }
 
     @Override
-    public List<String> getNameServerAddressList() {
-        return this.namesrvAddrList.get();
-    }
-
-    @Override
     public RemotingCommand invokeSync(String addr, final RemotingCommand 
request, long timeoutMillis)
         throws InterruptedException, RemotingConnectException, 
RemotingSendRequestException, RemotingTimeoutException {
         final Channel channel = this.getAndCreateChannel(addr);
@@ -541,6 +536,11 @@ public class NettyRemotingClient extends 
NettyRemotingAbstract implements Remoti
     }
 
     @Override
+    public List<String> getNameServerAddressList() {
+        return this.namesrvAddrList.get();
+    }
+
+    @Override
     public ChannelEventListener getChannelEventListener() {
         return channelEventListener;
     }
@@ -555,14 +555,6 @@ public class NettyRemotingClient extends 
NettyRemotingAbstract implements Remoti
         return this.publicExecutor;
     }
 
-    public List<String> getNamesrvAddrList() {
-        return namesrvAddrList.get();
-    }
-
-    public RPCHook getRpcHook() {
-        return rpcHook;
-    }
-
     static class ChannelWrapper {
         private final ChannelFuture channelFuture;
 
@@ -600,8 +592,8 @@ public class NettyRemotingClient extends 
NettyRemotingAbstract implements Remoti
         @Override
         public void connect(ChannelHandlerContext ctx, SocketAddress 
remoteAddress, SocketAddress localAddress,
             ChannelPromise promise) throws Exception {
-            final String local = localAddress == null ? "UNKNOW" : 
localAddress.toString();
-            final String remote = remoteAddress == null ? "UNKNOW" : 
remoteAddress.toString();
+            final String local = localAddress == null ? "UNKNOWN" : 
localAddress.toString();
+            final String remote = remoteAddress == null ? "UNKNOWN" : 
remoteAddress.toString();
             log.info("NETTY CLIENT PIPELINE: CONNECT  {} => {}", local, 
remote);
 
             super.connect(ctx, remoteAddress, localAddress, promise);
@@ -638,8 +630,8 @@ public class NettyRemotingClient extends 
NettyRemotingAbstract implements Remoti
         @Override
         public void userEventTriggered(ChannelHandlerContext ctx, Object evt) 
throws Exception {
             if (evt instanceof IdleStateEvent) {
-                IdleStateEvent evnet = (IdleStateEvent) evt;
-                if (evnet.state().equals(IdleState.ALL_IDLE)) {
+                IdleStateEvent event = (IdleStateEvent) evt;
+                if (event.state().equals(IdleState.ALL_IDLE)) {
                     final String remoteAddress = 
RemotingHelper.parseChannelRemoteAddr(ctx.channel());
                     log.warn("NETTY CLIENT PIPELINE: IDLE exception [{}]", 
remoteAddress);
                     closeChannel(ctx.channel());

Reply via email to