File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed
main/scala/org/apache/spark
test/scala/org/apache/spark/rdd Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ private[spark] class SecurityManager(sparkConf: SparkConf) extends Logging {
294294 def checkUIViewPermissions (user : String ): Boolean = {
295295 logDebug(" user=" + user + " aclsEnabled=" + aclsEnabled() + " viewAcls=" +
296296 viewAcls.mkString(" ," ))
297- if ( aclsEnabled() && ( user != null ) && ( ! viewAcls.contains(user))) false else true
297+ ! aclsEnabled || user == null || viewAcls.contains(user)
298298 }
299299
300300 /**
@@ -309,7 +309,7 @@ private[spark] class SecurityManager(sparkConf: SparkConf) extends Logging {
309309 def checkModifyPermissions (user : String ): Boolean = {
310310 logDebug(" user=" + user + " aclsEnabled=" + aclsEnabled() + " modifyAcls=" +
311311 modifyAcls.mkString(" ," ))
312- if ( aclsEnabled() && ( user != null ) && ( ! modifyAcls.contains(user))) false else true
312+ ! aclsEnabled || user == null || modifyAcls.contains(user)
313313 }
314314
315315
Original file line number Diff line number Diff line change @@ -38,9 +38,7 @@ class PartitionPruningRDDSuite extends FunSuite with SharedSparkContext {
3838 Iterator ()
3939 }
4040 }
41- val prunedRDD = PartitionPruningRDD .create(rdd, {
42- x => (x == 2 )
43- })
41+ val prunedRDD = PartitionPruningRDD .create(rdd, _ == 2 )
4442 assert(prunedRDD.partitions.length == 1 )
4543 val p = prunedRDD.partitions(0 )
4644 assert(p.index == 0 )
@@ -62,13 +60,10 @@ class PartitionPruningRDDSuite extends FunSuite with SharedSparkContext {
6260 List (split.asInstanceOf [TestPartition ].testValue).iterator
6361 }
6462 }
65- val prunedRDD1 = PartitionPruningRDD .create(rdd, {
66- x => (x == 0 )
67- })
63+ val prunedRDD1 = PartitionPruningRDD .create(rdd, _ == 0 )
6864
69- val prunedRDD2 = PartitionPruningRDD .create(rdd, {
70- x => (x == 2 )
71- })
65+
66+ val prunedRDD2 = PartitionPruningRDD .create(rdd, _ == 2 )
7267
7368 val merged = prunedRDD1 ++ prunedRDD2
7469 assert(merged.count() == 2 )
You can’t perform that action at this time.
0 commit comments