diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/DefaultNettyEventLoopConfig.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/DefaultNettyEventLoopConfig.java index 416e0caa210..87e554048f2 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/DefaultNettyEventLoopConfig.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/DefaultNettyEventLoopConfig.java @@ -22,6 +22,7 @@ import org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup; import org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup; import org.apache.hbase.thirdparty.io.netty.channel.socket.nio.NioSocketChannel; import org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultThreadFactory; + import org.apache.yetus.audience.InterfaceAudience; import org.apache.hadoop.hbase.util.Pair; @@ -30,16 +31,10 @@ import org.apache.hadoop.hbase.util.Pair; */ @InterfaceAudience.Private class DefaultNettyEventLoopConfig { - /** - * Name of system property to set to change default netty eventloop pool size. - * Default is 0. - */ - public static final String HBASE_NETTY_EVENTLOOP_DEFAULT_POOL_KEY = - "hbase.netty.eventloop.default.pool"; public static final Pair> GROUP_AND_CHANNEL_CLASS = Pair .> newPair( - new NioEventLoopGroup(Integer.getInteger(HBASE_NETTY_EVENTLOOP_DEFAULT_POOL_KEY, 0), - new DefaultThreadFactory("Default-IPC-NioEventLoopGroup", true, - Thread.NORM_PRIORITY)), NioSocketChannel.class); + new NioEventLoopGroup(0, + new DefaultThreadFactory("Default-IPC-NioEventLoopGroup", true, Thread.MAX_PRIORITY)), + NioSocketChannel.class); } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcClient.java index c4c614e188d..c4f70b05aaa 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcClient.java @@ -58,11 +58,8 @@ public class NettyRpcClient extends AbstractRpcClient { .getEventLoopConfig(conf); if (groupAndChannelClass == null) { // Use our own EventLoopGroup. - int count = - Integer.getInteger(DefaultNettyEventLoopConfig.HBASE_NETTY_EVENTLOOP_DEFAULT_POOL_KEY, 0); - System.out.println("COUNT="+ count); - this.group = new NioEventLoopGroup(count, - new DefaultThreadFactory("IPC-NioEventLoopGroup", true, Thread.NORM_PRIORITY)); + this.group = new NioEventLoopGroup(0, + new DefaultThreadFactory("IPC-NioEventLoopGroup", true, Thread.MAX_PRIORITY)); this.channelClass = NioSocketChannel.class; this.shutdownGroupWhenClose = true; } else { diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/client/example/HttpProxyExample.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/client/example/HttpProxyExample.java index 00d01a861d7..4ada5990cbc 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/client/example/HttpProxyExample.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/client/example/HttpProxyExample.java @@ -229,7 +229,6 @@ public class HttpProxyExample { channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); serverChannel = new ServerBootstrap().group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class).childOption(ChannelOption.TCP_NODELAY, true) - .childOption(ChannelOption.SO_REUSEADDR, true) .childHandler(new ChannelInitializer() { @Override diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java index a3acc8f8c01..bba1bede118 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java @@ -84,15 +84,13 @@ public class NettyRpcServer extends RpcServer { eventLoopGroup = config.group(); channelClass = config.serverChannelClass(); } else { - eventLoopGroup = new NioEventLoopGroup( - Integer.getInteger(DefaultNettyEventLoopConfig.HBASE_NETTY_EVENTLOOP_DEFAULT_POOL_KEY, 0), + eventLoopGroup = new NioEventLoopGroup(0, new DefaultThreadFactory("NettyRpcServer", true, Thread.MAX_PRIORITY)); channelClass = NioServerSocketChannel.class; } ServerBootstrap bootstrap = new ServerBootstrap().group(eventLoopGroup).channel(channelClass) .childOption(ChannelOption.TCP_NODELAY, tcpNoDelay) .childOption(ChannelOption.SO_KEEPALIVE, tcpKeepAlive) - .childOption(ChannelOption.SO_REUSEADDR, true) .childHandler(new ChannelInitializer() { @Override diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/NettyEventLoopGroupConfig.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/NettyEventLoopGroupConfig.java index 3e247f3061e..3e7b4882e31 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/NettyEventLoopGroupConfig.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/NettyEventLoopGroupConfig.java @@ -27,7 +27,9 @@ import org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup; import org.apache.hbase.thirdparty.io.netty.channel.socket.nio.NioServerSocketChannel; import org.apache.hbase.thirdparty.io.netty.channel.socket.nio.NioSocketChannel; import org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultThreadFactory; + import java.util.concurrent.ThreadFactory; + import org.apache.hadoop.conf.Configuration; import org.apache.yetus.audience.InterfaceAudience; @@ -36,6 +38,7 @@ import org.apache.yetus.audience.InterfaceAudience; */ @InterfaceAudience.Private public class NettyEventLoopGroupConfig { + private final EventLoopGroup group; private final Class serverChannelClass; diff --git a/hbase-server/src/test/resources/hbase-site.xml b/hbase-server/src/test/resources/hbase-site.xml index 5ba8b03578d..64a19644358 100644 --- a/hbase-server/src/test/resources/hbase-site.xml +++ b/hbase-server/src/test/resources/hbase-site.xml @@ -158,36 +158,4 @@ hbase.hconnection.threads.keepalivetime 3 - - hbase.netty.worker.count - 5 - Default is 0 - - - hbase.hconnection.threads.max - 6 - Default is 256 - - - hbase.htable.threads.max - 6 - Default is MAX_INTEGER - - - hbase.region.replica.replication.threads.max - 10 - Default is 256 - - - dfs.datanode.handler.count - 3 - Default is 10 - - - hbase.rest.threads.max - 5 - Default is 100 - - - diff --git a/pom.xml b/pom.xml index ef842964a0e..8886cc4c930 100755 --- a/pom.xml +++ b/pom.xml @@ -586,8 +586,6 @@ ${test.output.tofile} ${test.build.classes} - - 5