jojochuang commented on a change in pull request #2498:
URL: https://github.com/apache/ozone/pull/2498#discussion_r733457198



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/ReplicationServer.java
##########
@@ -57,22 +68,52 @@
 
   private int port;
 
+  private int poolSize;
+
+  private int queueLimit;
+
+  private ThreadPoolExecutor executor;
+
+  private EventLoopGroup eventLoopGroup;
+
   public ReplicationServer(
       ContainerController controller,
       ReplicationConfig replicationConfig,
-      SecurityConfig secConf,
-      CertificateClient caClient
-  ) {
+      SecurityConfig secConf, DatanodeConfiguration dnConfig,
+      CertificateClient caClient) {
     this.secConf = secConf;
     this.caClient = caClient;
     this.controller = controller;
     this.port = replicationConfig.getPort();
+    this.poolSize = dnConfig.getReplicationMaxStreams();
+    this.queueLimit = dnConfig.getReplicationQueueLimit();
     init();
   }
 
   public void init() {
+    executor = new ThreadPoolExecutor(
+        poolSize, poolSize, 60, TimeUnit.SECONDS,
+        new LinkedBlockingQueue<>(queueLimit),
+        new ThreadFactoryBuilder().setDaemon(true)
+            .setNameFormat("ReplicationServerExecutor-%d")
+            .build());
+
+    Class<? extends ServerChannel> channelType;
+
+    if (Epoll.isAvailable()) {
+      eventLoopGroup = new EpollEventLoopGroup(poolSize * 2);
+      channelType = EpollServerDomainSocketChannel.class;

Review comment:
       How is this different from EpollServerSocketChannel?
   If we use domain socket do we bind to a domain socket instead like the 
example in here? 
https://stackoverflow.com/questions/48354562/binding-a-java-grpc-server-to-a-unix-domain-socket/48358536#48358536




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to