HBASE-23987 NettyRpcClientConfigHelper will not share event loop by default which is incorrect (#1288)
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
30607308db
commit
2d27e8d2d5
@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.util.Pair;
|
import org.apache.hadoop.hbase.util.Pair;
|
||||||
import org.apache.yetus.audience.InterfaceAudience;
|
import org.apache.yetus.audience.InterfaceAudience;
|
||||||
|
|
||||||
import org.apache.hbase.thirdparty.com.google.common.base.Preconditions;
|
import org.apache.hbase.thirdparty.com.google.common.base.Preconditions;
|
||||||
import org.apache.hbase.thirdparty.io.netty.channel.Channel;
|
import org.apache.hbase.thirdparty.io.netty.channel.Channel;
|
||||||
import org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup;
|
import org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup;
|
||||||
@ -106,10 +107,7 @@ public final class NettyRpcClientConfigHelper {
|
|||||||
static Pair<EventLoopGroup, Class<? extends Channel>> getEventLoopConfig(Configuration conf) {
|
static Pair<EventLoopGroup, Class<? extends Channel>> getEventLoopConfig(Configuration conf) {
|
||||||
String name = conf.get(EVENT_LOOP_CONFIG);
|
String name = conf.get(EVENT_LOOP_CONFIG);
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
int threadCount = conf.getInt(HBASE_NETTY_EVENTLOOP_RPCCLIENT_THREADCOUNT_KEY, 0);
|
return getDefaultEventLoopConfig(conf);
|
||||||
return new Pair<>(new NioEventLoopGroup(threadCount,
|
|
||||||
new DefaultThreadFactory("RPCClient-NioEventLoopGroup", true,
|
|
||||||
Thread.NORM_PRIORITY)), NioSocketChannel.class);
|
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(name)) {
|
if (StringUtils.isBlank(name)) {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user