You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "leixm (via GitHub)" <gi...@apache.org> on 2023/03/29 08:50:08 UTC

[GitHub] [incubator-uniffle] leixm commented on a diff in pull request #771: [#584] feat(netty): Add transport client pool for netty

leixm commented on code in PR #771:
URL: https://github.com/apache/incubator-uniffle/pull/771#discussion_r1151600270


##########
common/src/main/java/org/apache/uniffle/common/netty/client/RpcResponseCallback.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.common.netty.client;
+
+import org.apache.uniffle.common.netty.protocol.RpcResponse;
+
+public interface RpcResponseCallback {
+  /**
+   * Successful serialized result from server.
+   *
+   * <p>After `onSuccess` returns, `response` will be recycled and its content will become invalid.
+   * Please copy the content of `response` if you want to use it after `onSuccess` returns.
+   */
+  void onSuccess(RpcResponse rpcResponse);

Review Comment:
   In fact, not all response types are RPCResponse, such as getInMemoryShuffleData.



##########
common/src/main/java/org/apache/uniffle/common/config/RssClientConf.java:
##########
@@ -43,4 +44,55 @@ public class RssClientConf {
       .defaultValue(ShuffleDataDistributionType.NORMAL)
       .withDescription("The type of partition shuffle data distribution, including normal and local_order. "
           + "The default value is normal. This config is only valid in Spark3.x");
+
+  public static final ConfigOption<Integer> NETTY_IO_CONNECT_TIMEOUT_MS = ConfigOptions
+      .key("rss.client.netty.io.connect.timeout.ms")
+      .intType()
+      .defaultValue(10 * 1000)
+      .withDescription("netty connect to server time out mills");
+
+  public static final ConfigOption<IOMode> NETTY_IO_MODE = ConfigOptions
+      .key("rss.client.netty.io.mode")
+      .enumType(IOMode.class)
+      .defaultValue(IOMode.NIO)
+      .withDescription("Netty EventLoopGroup backend, available options: NIO, EPOLL.");
+
+  public static final ConfigOption<Integer> NETTY_IO_CONNECTION_TIMEOUT_MS = ConfigOptions
+      .key("rss.client.netty.client.connection.timeout.ms")
+      .intType()
+      .defaultValue(10 * 60 * 1000)
+      .withDescription("connection active timeout");
+
+  public static final ConfigOption<Integer> NETTY_CLIENT_THREADS = ConfigOptions
+      .key("rss.client.netty.client.threads")
+      .intType()
+      .defaultValue(0)
+      .withDescription("Number of threads used in the client thread pool.");
+
+  public static final ConfigOption<Boolean> NETWORK_CLIENT_PREFER_DIRECT_BUFS = ConfigOptions
+      .key("rss.client.netty.client.prefer.direct.bufs")
+      .booleanType()
+      .defaultValue(true)
+      .withDescription("If true, we will prefer allocating off-heap byte buffers within Netty.");
+
+  public static final ConfigOption<Integer> NETTY_CLIENT_NUM_CONNECTIONS_PER_PEER = ConfigOptions
+      .key("rss.client.netty.client.connections.per.peer")
+      .intType()
+      .defaultValue(2)

Review Comment:
   > 
   
   Make sense.



##########
common/src/main/java/org/apache/uniffle/common/config/RssClientConf.java:
##########
@@ -43,4 +44,55 @@ public class RssClientConf {
       .defaultValue(ShuffleDataDistributionType.NORMAL)
       .withDescription("The type of partition shuffle data distribution, including normal and local_order. "
           + "The default value is normal. This config is only valid in Spark3.x");
+
+  public static final ConfigOption<Integer> NETTY_IO_CONNECT_TIMEOUT_MS = ConfigOptions
+      .key("rss.client.netty.io.connect.timeout.ms")
+      .intType()
+      .defaultValue(10 * 1000)
+      .withDescription("netty connect to server time out mills");
+
+  public static final ConfigOption<IOMode> NETTY_IO_MODE = ConfigOptions
+      .key("rss.client.netty.io.mode")

Review Comment:
   It's ok for me, i will fix it later PRs.



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org