forked from apache/incubator-uniffle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apache#1416] feat(spark): support custom hadoop config in client side (
apache#1417) ### What changes were proposed in this pull request? support custom hadoop config in client side ### Why are the changes needed? It's necessary to support user specify custom hadoop config in client side for remote storage. For apache#1416 ### Does this PR introduce _any_ user-facing change? Yes. The prefix key of `spark.rss.hadoop.*` for Hadoop conf. For Spark like that: `spark.rss.hadoop.fs.defaultFS=hdfs://rbf-x1`, this will be as `fs.defaultFS=hdfs://rbf-x1` for Hadoop storage ### How was this patch tested? UTs
- Loading branch information
Showing
6 changed files
with
75 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...rk/common/src/test/java/org/apache/uniffle/shuffle/manager/RssShuffleManagerBaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* 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.shuffle.manager; | ||
|
||
import org.apache.spark.SparkConf; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import org.apache.uniffle.common.RemoteStorageInfo; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class RssShuffleManagerBaseTest { | ||
|
||
@Test | ||
public void testGetDefaultRemoteStorageInfo() { | ||
SparkConf sparkConf = new SparkConf(); | ||
RemoteStorageInfo remoteStorageInfo = | ||
RssShuffleManagerBase.getDefaultRemoteStorageInfo(sparkConf); | ||
assertTrue(remoteStorageInfo.getConfItems().isEmpty()); | ||
|
||
sparkConf.set("spark.rss.hadoop.fs.defaultFs", "hdfs://rbf-xxx/foo"); | ||
remoteStorageInfo = RssShuffleManagerBase.getDefaultRemoteStorageInfo(sparkConf); | ||
assertEquals(remoteStorageInfo.getConfItems().size(), 1); | ||
assertEquals(remoteStorageInfo.getConfItems().get("fs.defaultFs"), "hdfs://rbf-xxx/foo"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters