未验证 提交 182ca623 编写于 作者: H Heng Du 提交者: GitHub

Merge pull request #682 from zongtanghu/snode

resolve the codestyle issue.
...@@ -17,16 +17,13 @@ ...@@ -17,16 +17,13 @@
package org.apache.rocketmq.remoting; package org.apache.rocketmq.remoting;
import java.util.Map; import java.util.Map;
import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.logging.InternalLoggerFactory;
import org.apache.rocketmq.remoting.common.RemotingHelper;
import org.apache.rocketmq.remoting.common.RemotingUtil; import org.apache.rocketmq.remoting.common.RemotingUtil;
import org.apache.rocketmq.remoting.util.ServiceProvider; import org.apache.rocketmq.remoting.util.ServiceProvider;
public class RemotingClientFactory { public class RemotingClientFactory {
private static RemotingClientFactory instance = new RemotingClientFactory(); private static RemotingClientFactory instance = new RemotingClientFactory();
public static RemotingClientFactory getInstance(){ public static RemotingClientFactory getInstance() {
return instance; return instance;
} }
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
package org.apache.rocketmq.remoting; package org.apache.rocketmq.remoting;
import java.util.Map; import java.util.Map;
import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.logging.InternalLoggerFactory;
import org.apache.rocketmq.remoting.common.RemotingHelper;
import org.apache.rocketmq.remoting.common.RemotingUtil; import org.apache.rocketmq.remoting.common.RemotingUtil;
import org.apache.rocketmq.remoting.util.ServiceProvider; import org.apache.rocketmq.remoting.util.ServiceProvider;
......
...@@ -17,18 +17,11 @@ ...@@ -17,18 +17,11 @@
package org.apache.rocketmq.remoting.common; package org.apache.rocketmq.remoting.common;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import org.apache.rocketmq.remoting.exception.RemotingConnectException;
import org.apache.rocketmq.remoting.exception.RemotingSendRequestException;
import org.apache.rocketmq.remoting.exception.RemotingTimeoutException;
import org.apache.rocketmq.logging.InternalLogger; import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.logging.InternalLoggerFactory; import org.apache.rocketmq.logging.InternalLoggerFactory;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;
import java.io.IOException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
public class RemotingHelper { public class RemotingHelper {
public static final String ROCKETMQ_REMOTING = "RocketmqRemoting"; public static final String ROCKETMQ_REMOTING = "RocketmqRemoting";
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rocketmq.remoting.netty; package org.apache.rocketmq.remoting.netty;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
...@@ -10,8 +26,6 @@ import org.apache.rocketmq.remoting.CommandCustomHeader; ...@@ -10,8 +26,6 @@ import org.apache.rocketmq.remoting.CommandCustomHeader;
import org.apache.rocketmq.remoting.annotation.CFNotNull; import org.apache.rocketmq.remoting.annotation.CFNotNull;
import org.apache.rocketmq.remoting.exception.RemotingCommandException; import org.apache.rocketmq.remoting.exception.RemotingCommandException;
import org.apache.rocketmq.remoting.protocol.RemotingCommand; import org.apache.rocketmq.remoting.protocol.RemotingCommand;
import org.apache.rocketmq.remoting.serialize.RemotingSerializable;
import org.apache.rocketmq.remoting.serialize.RocketMQSerializable;
import org.apache.rocketmq.remoting.serialize.SerializeType; import org.apache.rocketmq.remoting.serialize.SerializeType;
import org.apache.rocketmq.remoting.serialize.Serializer; import org.apache.rocketmq.remoting.serialize.Serializer;
import org.apache.rocketmq.remoting.serialize.SerializerFactory; import org.apache.rocketmq.remoting.serialize.SerializerFactory;
......
...@@ -296,7 +296,7 @@ public abstract class NettyRemotingAbstract { ...@@ -296,7 +296,7 @@ public abstract class NettyRemotingAbstract {
responseFuture.release(); responseFuture.release();
} }
} else { } else {
log.warn("receive response, but not matched any request: {} cmd: {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()), cmd); log.warn("receive response, but not matched any request: {}, cmd: {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()), cmd);
} }
} }
......
...@@ -75,7 +75,7 @@ public class Http2ClientImpl extends NettyRemotingClientAbstract implements Remo ...@@ -75,7 +75,7 @@ public class Http2ClientImpl extends NettyRemotingClientAbstract implements Remo
init(clientConfig, channelEventListener); init(clientConfig, channelEventListener);
} }
public Http2ClientImpl(){ public Http2ClientImpl() {
super(); super();
} }
......
...@@ -208,26 +208,23 @@ public class Http2ServerImpl extends NettyRemotingServerAbstract implements Remo ...@@ -208,26 +208,23 @@ public class Http2ServerImpl extends NettyRemotingServerAbstract implements Remo
final ChannelGroup channels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); final ChannelGroup channels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
this.serverBootstrap.group(this.bossGroup, this.ioGroup). this.serverBootstrap.group(this.bossGroup, this.ioGroup).
channel(socketChannelClass).childHandler(new ChannelInitializer<SocketChannel>() { channel(socketChannelClass).childHandler(new ChannelInitializer<SocketChannel>() {
@Override @Override
public void initChannel(SocketChannel ch) throws Exception { public void initChannel(SocketChannel ch) throws Exception {
channels.add(ch); channels.add(ch);
ChannelPipeline cp = ch.pipeline();
cp.addLast(ChannelStatisticsHandler.NAME, new ChannelStatisticsHandler(channels));
cp.addLast(workerGroup,
Http2Handler.newHandler(true),
new NettyEncoder(),
new NettyDecoder(),
new IdleStateHandler(serverConfig.getConnectionChannelReaderIdleSeconds(),
serverConfig.getConnectionChannelWriterIdleSeconds(),
serverConfig.getServerChannelMaxIdleTimeSeconds()),
new NettyConnectManageHandler(),
new NettyServerHandler());
}
});
ChannelPipeline cp = ch.pipeline();
cp.addLast(ChannelStatisticsHandler.NAME, new ChannelStatisticsHandler(channels));
cp.addLast(workerGroup,
Http2Handler.newHandler(true),
new NettyEncoder(),
new NettyDecoder(),
new IdleStateHandler(serverConfig.getConnectionChannelReaderIdleSeconds(),
serverConfig.getConnectionChannelWriterIdleSeconds(),
serverConfig.getServerChannelMaxIdleTimeSeconds()),
new NettyConnectManageHandler(),
new NettyServerHandler());
}
});
applyOptions(serverBootstrap); applyOptions(serverBootstrap);
ChannelFuture channelFuture = this.serverBootstrap.bind(this.port).syncUninterruptibly(); ChannelFuture channelFuture = this.serverBootstrap.bind(this.port).syncUninterruptibly();
......
...@@ -19,7 +19,6 @@ import java.util.ArrayList; ...@@ -19,7 +19,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.rocketmq.logging.InternalLogger; import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.logging.InternalLoggerFactory; import org.apache.rocketmq.logging.InternalLoggerFactory;
import org.apache.rocketmq.remoting.common.RemotingHelper; import org.apache.rocketmq.remoting.common.RemotingHelper;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册