Example usage for io.netty.util.concurrent DefaultThreadFactory DefaultThreadFactory

List of usage examples for io.netty.util.concurrent DefaultThreadFactory DefaultThreadFactory

Introduction

In this page you can find the example usage for io.netty.util.concurrent DefaultThreadFactory DefaultThreadFactory.

Prototype

public DefaultThreadFactory(String poolName, boolean daemon, int priority) 

Source Link

Usage

From source file:org.apache.hadoop.hbase.ipc.NettyRpcClient.java

License:Apache License

public NettyRpcClient(Configuration configuration, String clusterId, SocketAddress localAddress,
        MetricsConnection metrics) {/*www  . ja  va  2  s . c o m*/
    super(configuration, clusterId, localAddress, metrics);
    Pair<EventLoopGroup, Class<? extends Channel>> groupAndChannelClass = NettyRpcClientConfigHelper
            .getEventLoopConfig(conf);
    if (groupAndChannelClass == null) {
        // Use our own EventLoopGroup.
        this.group = new NioEventLoopGroup(0,
                new DefaultThreadFactory("IPC-NioEventLoopGroup", true, Thread.MAX_PRIORITY));
        this.channelClass = NioSocketChannel.class;
        this.shutdownGroupWhenClose = true;
    } else {
        this.group = groupAndChannelClass.getFirst();
        this.channelClass = groupAndChannelClass.getSecond();
        this.shutdownGroupWhenClose = false;
    }
}