You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/07/29 09:42:16 UTC

[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #104: [Improvement] Use ConfigBuilder to rewrite the class RssSparkConfig

jerqi commented on code in PR #104:
URL: https://github.com/apache/incubator-uniffle/pull/104#discussion_r933061069


##########
client-spark/common/src/main/java/org/apache/spark/shuffle/RssSparkConfig.java:
##########
@@ -17,130 +17,277 @@
 
 package org.apache.spark.shuffle;
 
-import java.util.Set;
-
 import com.google.common.collect.Sets;
+import org.apache.spark.internal.config.ConfigBuilder;
+import org.apache.spark.internal.config.ConfigEntry;
 
-import org.apache.uniffle.client.util.RssClientConfig;
+import java.util.Set;
 
 public class RssSparkConfig {
 
+  public static final class SparkConfigBuilder {
+    public static ConfigBuilder configBuilder;
+
+    public static ConfigBuilder key(String key) {
+      configBuilder = new ConfigBuilder(key);
+      return configBuilder;
+    }
+  }
+
+  public static class RssConfigEntry<T> {
+    public ConfigEntry<Object> entry;
+    public String key;
+
+    public RssConfigEntry(ConfigEntry<Object> entry) {
+      this.entry = entry;
+      this.key = entry.key();
+    }
+
+    public T getValue() {
+      return (T) entry.defaultValue(). get();
+    }
+  }
+
+  public static RssConfigEntry<Integer> RSS_PARTITION_NUM_PER_RANGE = new RssConfigEntry(
+      SparkConfigBuilder
+          .key("spark.rss.partitionNum.per.range")

Review Comment:
   ```
   SPARK_PREFIX +  RssClientConfig.RSS_PARTITION_NUM_PER_RANGE
   ```
   ?



-- 
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