Skip to content
Snippets Groups Projects
Commit dbb9da5c authored by Andrew Or's avatar Andrew Or
Browse files

Revert "[SPARK-4075] [Deploy] Jar url validation is not enough for Jar file"

This reverts commit 098f83c7.
parent 9ac2bb18
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
package org.apache.spark.deploy package org.apache.spark.deploy
import java.net.{URI, URISyntaxException}
import scala.collection.mutable.ListBuffer import scala.collection.mutable.ListBuffer
import org.apache.log4j.Level import org.apache.log4j.Level
...@@ -116,12 +114,5 @@ private[spark] class ClientArguments(args: Array[String]) { ...@@ -116,12 +114,5 @@ private[spark] class ClientArguments(args: Array[String]) {
} }
object ClientArguments { object ClientArguments {
def isValidJarUrl(s: String): Boolean = { def isValidJarUrl(s: String): Boolean = s.matches("(.+):(.+)jar")
try {
val uri = new URI(s)
uri.getScheme != null && uri.getAuthority != null && s.endsWith("jar")
} catch {
case _: URISyntaxException => false
}
}
} }
...@@ -29,12 +29,6 @@ class ClientSuite extends FunSuite with Matchers { ...@@ -29,12 +29,6 @@ class ClientSuite extends FunSuite with Matchers {
ClientArguments.isValidJarUrl("hdfs://someHost:1234/foo") should be (false) ClientArguments.isValidJarUrl("hdfs://someHost:1234/foo") should be (false)
ClientArguments.isValidJarUrl("/missing/a/protocol/jarfile.jar") should be (false) ClientArguments.isValidJarUrl("/missing/a/protocol/jarfile.jar") should be (false)
ClientArguments.isValidJarUrl("not-even-a-path.jar") should be (false) ClientArguments.isValidJarUrl("not-even-a-path.jar") should be (false)
// No authority
ClientArguments.isValidJarUrl("hdfs:someHost:1234/jarfile.jar") should be (false)
// Invalid syntax
ClientArguments.isValidJarUrl("hdfs:") should be (false)
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment