File tree Expand file tree Collapse file tree 2 files changed +1
-16
lines changed
main/scala/org/apache/spark/deploy
test/scala/org/apache/spark/deploy Expand file tree Collapse file tree 2 files changed +1
-16
lines changed Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .spark .deploy
19
19
20
- import java .net .{URI , URISyntaxException }
21
-
22
20
import scala .collection .mutable .ListBuffer
23
21
24
22
import org .apache .log4j .Level
@@ -116,12 +114,5 @@ private[spark] class ClientArguments(args: Array[String]) {
116
114
}
117
115
118
116
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" )
127
118
}
Original file line number Diff line number Diff line change @@ -29,12 +29,6 @@ class ClientSuite extends FunSuite with Matchers {
29
29
ClientArguments .isValidJarUrl(" hdfs://someHost:1234/foo" ) should be (false )
30
30
ClientArguments .isValidJarUrl(" /missing/a/protocol/jarfile.jar" ) should be (false )
31
31
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 )
38
32
}
39
33
40
34
}
You can’t perform that action at this time.
0 commit comments