Search in sources :

Example 1 with NioEventLoopGroup

use of org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup in project hbase by apache.

the class TestSaslFanOutOneBlockAsyncDFSOutput method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws Exception {
    EVENT_LOOP_GROUP = new NioEventLoopGroup();
    CHANNEL_CLASS = NioSocketChannel.class;
    UTIL.getConfiguration().setInt(DFS_CLIENT_SOCKET_TIMEOUT_KEY, READ_TIMEOUT_MS);
    KDC = setupMiniKdc(KEYTAB_FILE);
    USERNAME = UserGroupInformation.getLoginUser().getShortUserName();
    PRINCIPAL = USERNAME + "/" + HOST;
    HTTP_PRINCIPAL = "HTTP/" + HOST;
    KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL, HTTP_PRINCIPAL);
    setUpKeyProvider(UTIL.getConfiguration());
    HBaseKerberosUtils.setSecuredConfiguration(UTIL.getConfiguration(), PRINCIPAL + "@" + KDC.getRealm(), HTTP_PRINCIPAL + "@" + KDC.getRealm());
    HBaseKerberosUtils.setSSLConfiguration(UTIL, TestSaslFanOutOneBlockAsyncDFSOutput.class);
    MONITOR = StreamSlowMonitor.create(UTIL.getConfiguration(), "testMonitor");
}
Also used : NioEventLoopGroup(org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup) BeforeClass(org.junit.BeforeClass)

Example 2 with NioEventLoopGroup

use of org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup in project hbase by apache.

the class TestFanOutOneBlockAsyncDFSOutputHang method setUp.

@BeforeClass
public static void setUp() throws Exception {
    startMiniDFSCluster(2);
    FS = CLUSTER.getFileSystem();
    EVENT_LOOP_GROUP = new NioEventLoopGroup();
    CHANNEL_CLASS = NioSocketChannel.class;
    MONITOR = StreamSlowMonitor.create(UTIL.getConfiguration(), "testMonitor");
    Path f = new Path("/testHang");
    EventLoop eventLoop = EVENT_LOOP_GROUP.next();
    OUT = FanOutOneBlockAsyncDFSOutputHelper.createOutput(FS, f, true, false, (short) 2, FS.getDefaultBlockSize(), eventLoop, CHANNEL_CLASS, MONITOR);
}
Also used : Path(org.apache.hadoop.fs.Path) EventLoop(org.apache.hbase.thirdparty.io.netty.channel.EventLoop) NioEventLoopGroup(org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup) BeforeClass(org.junit.BeforeClass)

Example 3 with NioEventLoopGroup

use of org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup in project hbase by apache.

the class TestFanOutOneBlockAsyncDFSOutput method setUp.

@BeforeClass
public static void setUp() throws Exception {
    UTIL.getConfiguration().setInt(DFS_CLIENT_SOCKET_TIMEOUT_KEY, READ_TIMEOUT_MS);
    startMiniDFSCluster(3);
    FS = CLUSTER.getFileSystem();
    EVENT_LOOP_GROUP = new NioEventLoopGroup();
    CHANNEL_CLASS = NioSocketChannel.class;
    MONITOR = StreamSlowMonitor.create(UTIL.getConfiguration(), "testMonitor");
}
Also used : NioEventLoopGroup(org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup) BeforeClass(org.junit.BeforeClass)

Example 4 with NioEventLoopGroup

use of org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup 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;
}
Also used : DefaultThreadFactory(org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultThreadFactory) NioSocketChannel(org.apache.hbase.thirdparty.io.netty.channel.socket.nio.NioSocketChannel) EventLoopGroup(org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup) NioEventLoopGroup(org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup) Channel(org.apache.hbase.thirdparty.io.netty.channel.Channel) NioSocketChannel(org.apache.hbase.thirdparty.io.netty.channel.socket.nio.NioSocketChannel) NioEventLoopGroup(org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup)

Example 5 with NioEventLoopGroup

use of org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup in project hbase by apache.

the class TestAsyncFSWAL method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws Exception {
    GROUP = new NioEventLoopGroup(1, new ThreadFactoryBuilder().setNameFormat("TestAsyncFSWAL-pool-%d").setDaemon(true).setUncaughtExceptionHandler(Threads.LOGGING_EXCEPTION_HANDLER).build());
    CHANNEL_CLASS = NioSocketChannel.class;
    AbstractTestFSWAL.setUpBeforeClass();
}
Also used : ThreadFactoryBuilder(org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder) NioEventLoopGroup(org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup) BeforeClass(org.junit.BeforeClass)

Aggregations

NioEventLoopGroup (org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoopGroup)8 BeforeClass (org.junit.BeforeClass)7 ThreadFactoryBuilder (org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder)2 Configuration (org.apache.hadoop.conf.Configuration)1 Path (org.apache.hadoop.fs.Path)1 WALFactory (org.apache.hadoop.hbase.wal.WALFactory)1 Channel (org.apache.hbase.thirdparty.io.netty.channel.Channel)1 EventLoop (org.apache.hbase.thirdparty.io.netty.channel.EventLoop)1 EventLoopGroup (org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup)1 NioSocketChannel (org.apache.hbase.thirdparty.io.netty.channel.socket.nio.NioSocketChannel)1 DefaultThreadFactory (org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultThreadFactory)1