use of org.apache.hbase.thirdparty.io.netty.channel.Channel in project hbase by apache.
the class FanOutOneBlockAsyncDFSOutput method setupReceiver.
private void setupReceiver(int timeoutMs) {
AckHandler ackHandler = new AckHandler(timeoutMs);
for (Channel ch : datanodeInfoMap.keySet()) {
ch.pipeline().addLast(new IdleStateHandler(timeoutMs, timeoutMs / 2, 0, TimeUnit.MILLISECONDS), new ProtobufVarint32FrameDecoder(), new ProtobufDecoder(PipelineAckProto.getDefaultInstance()), ackHandler);
ch.config().setAutoRead(true);
}
}
use of org.apache.hbase.thirdparty.io.netty.channel.Channel in project hbase by apache.
the class NettyRpcClientConfigHelper method getDefaultEventLoopConfig.
private static Pair<EventLoopGroup, Class<? extends Channel>> getDefaultEventLoopConfig(Configuration conf) {
Pair<EventLoopGroup, Class<? extends Channel>> eventLoop = DEFAULT_EVENT_LOOP;
if (eventLoop != null) {
return eventLoop;
}
synchronized (NettyRpcClientConfigHelper.class) {
eventLoop = DEFAULT_EVENT_LOOP;
if (eventLoop != null) {
return eventLoop;
}
int threadCount = conf.getInt(HBASE_NETTY_EVENTLOOP_RPCCLIENT_THREADCOUNT_KEY, 0);
eventLoop = new Pair<>(new NioEventLoopGroup(threadCount, new DefaultThreadFactory("RPCClient-NioEventLoopGroup", true, Thread.NORM_PRIORITY)), NioSocketChannel.class);
DEFAULT_EVENT_LOOP = eventLoop;
}
return eventLoop;
}
Aggregations