diff options
author | Andrew Or <andrew@databricks.com> | 2014-11-17 11:25:38 -0800 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2014-11-17 11:25:38 -0800 |
commit | b528367d75bde36004b551bb149e024b56a3ba57 (patch) | |
tree | 65a9248f3200f2a67b4cfe60580893987649bc59 | |
parent | 4b1c77cbf59ccc752bc0d0291df3550cbfbe730c (diff) | |
download | spark-b528367d75bde36004b551bb149e024b56a3ba57.tar.gz spark-b528367d75bde36004b551bb149e024b56a3ba57.tar.bz2 spark-b528367d75bde36004b551bb149e024b56a3ba57.zip |
Revert "[SPARK-4075] [Deploy] Jar url validation is not enough for Jar file"
This reverts commit 098f83c7ccd7dad9f9228596da69fe5f55711a52.
-rw-r--r-- | core/src/main/scala/org/apache/spark/deploy/ClientArguments.scala | 11 | ||||
-rw-r--r-- | core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala | 6 |
2 files changed, 1 insertions, 16 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/ClientArguments.scala b/core/src/main/scala/org/apache/spark/deploy/ClientArguments.scala index 4e802e02c4..39150deab8 100644 --- a/core/src/main/scala/org/apache/spark/deploy/ClientArguments.scala +++ b/core/src/main/scala/org/apache/spark/deploy/ClientArguments.scala @@ -17,8 +17,6 @@ package org.apache.spark.deploy -import java.net.{URI, URISyntaxException} - import scala.collection.mutable.ListBuffer import org.apache.log4j.Level @@ -116,12 +114,5 @@ private[spark] class ClientArguments(args: Array[String]) { } object ClientArguments { - def isValidJarUrl(s: String): Boolean = { - try { - val uri = new URI(s) - uri.getScheme != null && uri.getAuthority != null && s.endsWith("jar") - } catch { - case _: URISyntaxException => false - } - } + def isValidJarUrl(s: String): Boolean = s.matches("(.+):(.+)jar") } diff --git a/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala b/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala index 94a2bdd74e..4161aede1d 100644 --- a/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala @@ -29,12 +29,6 @@ class ClientSuite extends FunSuite with Matchers { ClientArguments.isValidJarUrl("hdfs://someHost:1234/foo") should be (false) ClientArguments.isValidJarUrl("/missing/a/protocol/jarfile.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) } } |