Skip to content
Snippets Groups Projects
Commit bbd8d7de authored by Sean Owen's avatar Sean Owen
Browse files

[SPARK-20806][DEPLOY] Launcher: redundant check for Spark lib dir

## What changes were proposed in this pull request?

Remove redundant check for libdir in CommandBuilderUtils

## How was this patch tested?

Existing tests

Author: Sean Owen <sowen@cloudera.com>

Closes #18032 from srowen/SPARK-20806.
parent 749418d2
No related branches found
No related tags found
No related merge requests found
......@@ -335,22 +335,17 @@ class CommandBuilderUtils {
*/
static String findJarsDir(String sparkHome, String scalaVersion, boolean failIfNotFound) {
// TODO: change to the correct directory once the assembly build is changed.
File libdir;
if (new File(sparkHome, "jars").isDirectory()) {
libdir = new File(sparkHome, "jars");
checkState(!failIfNotFound || libdir.isDirectory(),
"Library directory '%s' does not exist.",
libdir.getAbsolutePath());
} else {
File libdir = new File(sparkHome, "jars");
if (!libdir.isDirectory()) {
libdir = new File(sparkHome, String.format("assembly/target/scala-%s/jars", scalaVersion));
if (!libdir.isDirectory()) {
checkState(!failIfNotFound,
"Library directory '%s' does not exist; make sure Spark is built.",
libdir.getAbsolutePath());
libdir = null;
return null;
}
}
return libdir != null ? libdir.getAbsolutePath() : null;
return libdir.getAbsolutePath();
}
}
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