-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32121][SHUFFLE] Support Windows OS in ExecutorDiskUtils #28940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
e8ea16a
187e813
9b24a14
8cd8bd1
06024f4
6a201a5
50a742d
56f3be5
aac01ca
a80bd6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
|
|
||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||
| import com.google.common.io.CharStreams; | ||
| import org.apache.commons.lang3.SystemUtils; | ||
| import org.apache.spark.network.shuffle.protocol.ExecutorShuffleInfo; | ||
| import org.apache.spark.network.util.MapConfigProvider; | ||
| import org.apache.spark.network.util.TransportConf; | ||
|
|
@@ -146,12 +147,21 @@ public void jsonSerializationOfExecutorRegistration() throws IOException { | |
|
|
||
| @Test | ||
| public void testNormalizeAndInternPathname() { | ||
| assertPathsMatch("/foo", "bar", "baz", "/foo/bar/baz"); | ||
| assertPathsMatch("//foo/", "bar/", "//baz", "/foo/bar/baz"); | ||
| assertPathsMatch("foo", "bar", "baz///", "foo/bar/baz"); | ||
| assertPathsMatch("/foo/", "/bar//", "/baz", "/foo/bar/baz"); | ||
| assertPathsMatch("/", "", "", "/"); | ||
| assertPathsMatch("/", "/", "/", "/"); | ||
| String sep = File.separator; | ||
| String expectedPathname1 = sep + "foo" + sep + "bar" + sep + "baz"; | ||
|
||
| String expectedPathname2 = "foo" + sep + "bar" + sep + "baz"; | ||
| String expectedPathname3 = sep + "foo\\" + sep + "bar" + sep + "baz"; | ||
| assertPathsMatch("/foo", "bar", "baz", expectedPathname1); | ||
| assertPathsMatch("//foo/", "bar/", "//baz", expectedPathname1); | ||
| assertPathsMatch("foo", "bar", "baz///", expectedPathname2); | ||
| assertPathsMatch("/foo/", "/bar//", "/baz", expectedPathname1); | ||
| assertPathsMatch("/", "", "", sep); | ||
| assertPathsMatch("/", "/", "/", sep); | ||
| if (SystemUtils.IS_OS_WINDOWS) { | ||
| assertPathsMatch("/foo\\/", "bar", "baz", expectedPathname1); | ||
| } else { | ||
| assertPathsMatch("/foo\\/", "bar", "baz", expectedPathname3); | ||
| } | ||
| } | ||
|
|
||
| private void assertPathsMatch(String p1, String p2, String p3, String expectedPathname) { | ||
|
|
@@ -160,6 +170,6 @@ private void assertPathsMatch(String p1, String p2, String p3, String expectedPa | |
| assertEquals(expectedPathname, normPathname); | ||
| File file = new File(normPathname); | ||
| String returnedPath = file.getPath(); | ||
| assertTrue(normPathname == returnedPath); | ||
| assertEquals(normPathname, returnedPath); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.