diff options
author | scwf <wangfei1@huawei.com> | 2014-08-31 14:02:11 -0700 |
---|---|---|
committer | Matei Zaharia <matei@databricks.com> | 2014-08-31 14:02:11 -0700 |
commit | 725715cbf3c1834b81aa91ea751fd04d307f504d (patch) | |
tree | b614b7657e7aa0cbad9d95e63aec22f3d862e579 /yarn/common | |
parent | c567a68a59f086ed13f38a8a847afb2c7d35697c (diff) | |
download | spark-725715cbf3c1834b81aa91ea751fd04d307f504d.tar.gz spark-725715cbf3c1834b81aa91ea751fd04d307f504d.tar.bz2 spark-725715cbf3c1834b81aa91ea751fd04d307f504d.zip |
[SPARK-3010] fix redundant conditional
https://issues.apache.org/jira/browse/SPARK-3010
this pr is to fix redundant conditional in spark, such as
1.
private[spark] def codegenEnabled: Boolean =
if (getConf(CODEGEN_ENABLED, "false") == "true") true else false
2.
x => if (x == 2) true else false
...
Author: scwf <wangfei1@huawei.com>
Author: wangfei <wangfei_hello@126.com>
Closes #1992 from scwf/condition and squashes the following commits:
b2a044a [scwf] merge SecurityManager
e16239c [scwf] fix confilct
6811401 [scwf] fix merge confilct
0824df4 [scwf] Merge branch 'master' of https://github.com/apache/spark into patch-4
e274515 [scwf] fix redundant conditions
d032bf9 [wangfei] [SQL]Excess judgment
Diffstat (limited to 'yarn/common')
-rw-r--r-- | yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala index 6cf300c398..5d8e5e6dff 100644 --- a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala +++ b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala @@ -209,7 +209,7 @@ trait ClientBase extends Logging { if (! localPath.isEmpty()) { val localURI = new URI(localPath) if (!ClientBase.LOCAL_SCHEME.equals(localURI.getScheme())) { - val setPermissions = if (destName.equals(ClientBase.APP_JAR)) true else false + val setPermissions = destName.equals(ClientBase.APP_JAR) val destPath = copyRemoteFile(dst, qualifyForLocal(localURI), replication, setPermissions) val destFs = FileSystem.get(destPath.toUri(), conf) distCacheMgr.addResource(destFs, conf, destPath, localResources, LocalResourceType.FILE, |