spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewo...@apache.org
Subject spark git commit: Revert "[SPARK-4075] [Deploy] Jar url validation is not enough for Jar file"
Date Mon, 17 Nov 2014 19:25:46 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-1.1 4b1c77cbf -> b528367d7


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

This reverts commit 098f83c7ccd7dad9f9228596da69fe5f55711a52.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b528367d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b528367d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b528367d

Branch: refs/heads/branch-1.1
Commit: b528367d75bde36004b551bb149e024b56a3ba57
Parents: 4b1c77c
Author: Andrew Or <andrew@databricks.com>
Authored: Mon Nov 17 11:25:38 2014 -0800
Committer: Andrew Or <andrew@databricks.com>
Committed: Mon Nov 17 11:25:38 2014 -0800

----------------------------------------------------------------------
 .../scala/org/apache/spark/deploy/ClientArguments.scala  | 11 +----------
 .../test/scala/org/apache/spark/deploy/ClientSuite.scala |  6 ------
 2 files changed, 1 insertion(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/b528367d/core/src/main/scala/org/apache/spark/deploy/ClientArguments.scala
----------------------------------------------------------------------
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 4e802e0..39150de 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")
 }

http://git-wip-us.apache.org/repos/asf/spark/blob/b528367d/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala
----------------------------------------------------------------------
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 94a2bdd..4161aed 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)
   }
 
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message