You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/07/14 00:50:36 UTC

[GitHub] [hbase] Apache9 commented on a diff in pull request #4619: HBASE-27195 Clean up netty worker/thread pool configuration

Apache9 commented on code in PR #4619:
URL: https://github.com/apache/hbase/pull/4619#discussion_r920619299


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java:
##########
@@ -97,21 +85,16 @@ public NettyRpcServer(Server server, String name, List<BlockingServiceAndInterfa
     super(server, name, services, bindAddress, conf, scheduler, reservoirEnabled);
     this.bindAddress = bindAddress;
     this.channelAllocator = getChannelAllocator(conf);
-    EventLoopGroup eventLoopGroup;
-    Class<? extends ServerChannel> channelClass;
-    if (server instanceof HRegionServer) {
-      NettyEventLoopGroupConfig config = ((HBaseServerBase) server).getEventLoopGroupConfig();
-      eventLoopGroup = config.group();
-      channelClass = config.serverChannelClass();
-    } else {
-      int threadCount = server == null
-        ? EVENTLOOP_THREADCOUNT_DEFAULT
-        : server.getConfiguration().getInt(HBASE_NETTY_EVENTLOOP_RPCSERVER_THREADCOUNT_KEY,
-          EVENTLOOP_THREADCOUNT_DEFAULT);
-      eventLoopGroup = new NioEventLoopGroup(threadCount,
-        new DefaultThreadFactory("NettyRpcServer", true, Thread.MAX_PRIORITY));
-      channelClass = NioServerSocketChannel.class;
+    // Get the event loop group configuration from the server class if available.
+    NettyEventLoopGroupConfig config = null;
+    if (server != null) {

Review Comment:
   Still better to check whether server is an instance of HBaseServerBase? Or at least add a comment to say for now, if we pass a non-null server then it must be HBaseServerBase(or HRegionServer for branch-2.x). Otherwise other developers may be confused on this direct cast.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org