提交 169450e1 编写于 作者: S shroman 提交者: yukon

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

上级 8ff25b35
...@@ -326,11 +326,6 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti ...@@ -326,11 +326,6 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
} }
} }
@Override
public List<String> getNameServerAddressList() {
return this.namesrvAddrList.get();
}
@Override @Override
public RemotingCommand invokeSync(String addr, final RemotingCommand request, long timeoutMillis) public RemotingCommand invokeSync(String addr, final RemotingCommand request, long timeoutMillis)
throws InterruptedException, RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException { throws InterruptedException, RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException {
...@@ -540,6 +535,11 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti ...@@ -540,6 +535,11 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
return true; return true;
} }
@Override
public List<String> getNameServerAddressList() {
return this.namesrvAddrList.get();
}
@Override @Override
public ChannelEventListener getChannelEventListener() { public ChannelEventListener getChannelEventListener() {
return channelEventListener; return channelEventListener;
...@@ -555,14 +555,6 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti ...@@ -555,14 +555,6 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
return this.publicExecutor; return this.publicExecutor;
} }
public List<String> getNamesrvAddrList() {
return namesrvAddrList.get();
}
public RPCHook getRpcHook() {
return rpcHook;
}
static class ChannelWrapper { static class ChannelWrapper {
private final ChannelFuture channelFuture; private final ChannelFuture channelFuture;
...@@ -600,8 +592,8 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti ...@@ -600,8 +592,8 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
@Override @Override
public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress,
ChannelPromise promise) throws Exception { ChannelPromise promise) throws Exception {
final String local = localAddress == null ? "UNKNOW" : localAddress.toString(); final String local = localAddress == null ? "UNKNOWN" : localAddress.toString();
final String remote = remoteAddress == null ? "UNKNOW" : remoteAddress.toString(); final String remote = remoteAddress == null ? "UNKNOWN" : remoteAddress.toString();
log.info("NETTY CLIENT PIPELINE: CONNECT {} => {}", local, remote); log.info("NETTY CLIENT PIPELINE: CONNECT {} => {}", local, remote);
super.connect(ctx, remoteAddress, localAddress, promise); super.connect(ctx, remoteAddress, localAddress, promise);
...@@ -638,8 +630,8 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti ...@@ -638,8 +630,8 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
@Override @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof IdleStateEvent) { if (evt instanceof IdleStateEvent) {
IdleStateEvent evnet = (IdleStateEvent) evt; IdleStateEvent event = (IdleStateEvent) evt;
if (evnet.state().equals(IdleState.ALL_IDLE)) { if (event.state().equals(IdleState.ALL_IDLE)) {
final String remoteAddress = RemotingHelper.parseChannelRemoteAddr(ctx.channel()); final String remoteAddress = RemotingHelper.parseChannelRemoteAddr(ctx.channel());
log.warn("NETTY CLIENT PIPELINE: IDLE exception [{}]", remoteAddress); log.warn("NETTY CLIENT PIPELINE: IDLE exception [{}]", remoteAddress);
closeChannel(ctx.channel()); closeChannel(ctx.channel());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册