Skip to content

Commit 9b01609

Browse files
committed
Add a exclude properties config
1 parent f538b56 commit 9b01609

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

client-spark/spark2/src/main/java/org/apache/spark/shuffle/DelegationRssShuffleManager.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.spark.shuffle;
1919

20+
import java.util.List;
2021
import java.util.Map;
2122
import java.util.Set;
2223

@@ -32,6 +33,8 @@
3233
import org.apache.uniffle.client.impl.grpc.CoordinatorGrpcRetryableClient;
3334
import org.apache.uniffle.client.request.RssAccessClusterRequest;
3435
import org.apache.uniffle.client.response.RssAccessClusterResponse;
36+
import org.apache.uniffle.common.config.RssClientConf;
37+
import org.apache.uniffle.common.config.RssConf;
3538
import org.apache.uniffle.common.exception.RssException;
3639
import org.apache.uniffle.common.rpc.StatusCode;
3740
import org.apache.uniffle.common.util.Constants;
@@ -124,6 +127,16 @@ private boolean tryAccessCluster() {
124127
extraProperties.put(
125128
ACCESS_INFO_REQUIRED_SHUFFLE_NODES_NUM, String.valueOf(assignmentShuffleNodesNum));
126129

130+
RssConf rssConf = RssSparkConfig.toRssConf(sparkConf);
131+
List<String> excludeProperties =
132+
rssConf.get(RssClientConf.RSS_CLIENT_REPORT_EXCLUDE_PROPERTIES);
133+
// Put all spark conf into extra properties, except which length is longer than 100
134+
// to avoid extra properties too long.
135+
rssConf.getAll().stream()
136+
.filter(entry -> StringUtils.length((String) entry.getValue()) < 100)
137+
.filter(entry -> !excludeProperties.contains(entry.getKey()))
138+
.forEach(entry -> extraProperties.put(entry.getKey(), (String) entry.getValue()));
139+
127140
Set<String> assignmentTags = RssSparkShuffleUtils.getAssignmentTags(sparkConf);
128141
try {
129142
if (coordinatorClient != null) {

client-spark/spark3/src/main/java/org/apache/spark/shuffle/DelegationRssShuffleManager.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.spark.shuffle;
1919

20+
import java.util.List;
2021
import java.util.Map;
2122
import java.util.Set;
2223

@@ -32,6 +33,8 @@
3233
import org.apache.uniffle.client.impl.grpc.CoordinatorGrpcRetryableClient;
3334
import org.apache.uniffle.client.request.RssAccessClusterRequest;
3435
import org.apache.uniffle.client.response.RssAccessClusterResponse;
36+
import org.apache.uniffle.common.config.RssClientConf;
37+
import org.apache.uniffle.common.config.RssConf;
3538
import org.apache.uniffle.common.exception.RssException;
3639
import org.apache.uniffle.common.rpc.StatusCode;
3740
import org.apache.uniffle.common.util.Constants;
@@ -123,10 +126,15 @@ private boolean tryAccessCluster() {
123126
Map<String, String> extraProperties = Maps.newHashMap();
124127
extraProperties.put(
125128
ACCESS_INFO_REQUIRED_SHUFFLE_NODES_NUM, String.valueOf(assignmentShuffleNodesNum));
129+
130+
RssConf rssConf = RssSparkConfig.toRssConf(sparkConf);
131+
List<String> excludeProperties =
132+
rssConf.get(RssClientConf.RSS_CLIENT_REPORT_EXCLUDE_PROPERTIES);
126133
// Put all spark conf into extra properties, except which length is longer than 100
127134
// to avoid extra properties too long.
128-
RssSparkConfig.toRssConf(sparkConf).getAll().stream()
135+
rssConf.getAll().stream()
129136
.filter(entry -> StringUtils.length((String) entry.getValue()) < 100)
137+
.filter(entry -> !excludeProperties.contains(entry.getKey()))
130138
.forEach(entry -> extraProperties.put(entry.getKey(), (String) entry.getValue()));
131139

132140
Set<String> assignmentTags = RssSparkShuffleUtils.getAssignmentTags(sparkConf);

common/src/main/java/org/apache/uniffle/common/config/RssClientConf.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,10 @@ public class RssClientConf {
303303
.withDescription(
304304
"The block id manager class of server for this application, "
305305
+ "the implementation of this interface to manage the shuffle block ids");
306+
public static final ConfigOption<List<String>> RSS_CLIENT_REPORT_EXCLUDE_PROPERTIES =
307+
ConfigOptions.key("rss.client.reportExcludeProperties")
308+
.stringType()
309+
.asList()
310+
.noDefaultValue()
311+
.withDescription("the report exclude properties could be configured by this option");
306312
}

0 commit comments

Comments
 (0)