Skip to content

Commit a2c3618

Browse files
committed
Revert "[SPARK-4075] [Deploy] Jar url validation is not enough for Jar file"
This reverts commit 098f83c.
1 parent 4b1c77c commit a2c3618

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

core/src/main/scala/org/apache/spark/deploy/ClientArguments.scala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
package org.apache.spark.deploy
1919

20-
import java.net.{URI, URISyntaxException}
21-
2220
import scala.collection.mutable.ListBuffer
2321

2422
import org.apache.log4j.Level
@@ -116,12 +114,5 @@ private[spark] class ClientArguments(args: Array[String]) {
116114
}
117115

118116
object ClientArguments {
119-
def isValidJarUrl(s: String): Boolean = {
120-
try {
121-
val uri = new URI(s)
122-
uri.getScheme != null && uri.getAuthority != null && s.endsWith("jar")
123-
} catch {
124-
case _: URISyntaxException => false
125-
}
126-
}
117+
def isValidJarUrl(s: String): Boolean = s.matches("(.+):(.+)jar")
127118
}

core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ class ClientSuite extends FunSuite with Matchers {
2929
ClientArguments.isValidJarUrl("hdfs://someHost:1234/foo") should be (false)
3030
ClientArguments.isValidJarUrl("/missing/a/protocol/jarfile.jar") should be (false)
3131
ClientArguments.isValidJarUrl("not-even-a-path.jar") should be (false)
32-
33-
// No authority
34-
ClientArguments.isValidJarUrl("hdfs:someHost:1234/jarfile.jar") should be (false)
35-
36-
// Invalid syntax
37-
ClientArguments.isValidJarUrl("hdfs:") should be (false)
3832
}
3933

4034
}

0 commit comments

Comments
 (0)