Skip to content

Commit

Permalink
[ROCKETMQ-70] Duplicate methods in NettyRemotingClient, closes apache#48
Browse files Browse the repository at this point in the history
  • Loading branch information
shroman authored and zhouxinyu committed Jan 23, 2017
1 parent 8ff25b3 commit 169450e
Showing 1 changed file with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,6 @@ public void updateNameServerAddressList(List<String> addrs) {
}
}

@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 {
Expand Down Expand Up @@ -540,6 +535,11 @@ public boolean isChannelWriteable(String addr) {
return true;
}

@Override
public List<String> getNameServerAddressList() {
return this.namesrvAddrList.get();
}

@Override
public ChannelEventListener getChannelEventListener() {
return channelEventListener;
Expand All @@ -555,14 +555,6 @@ public ExecutorService getCallbackExecutor() {
return this.publicExecutor;
}

public List<String> getNamesrvAddrList() {
return namesrvAddrList.get();
}

public RPCHook getRpcHook() {
return rpcHook;
}

static class ChannelWrapper {
private final ChannelFuture channelFuture;

Expand Down Expand Up @@ -600,8 +592,8 @@ class NettyConnectManageHandler extends ChannelDuplexHandler {
@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);
Expand Down Expand Up @@ -638,8 +630,8 @@ public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exce
@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());
Expand Down

0 comments on commit 169450e

Please sign in to comment.