spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zsxwing <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-7237] Many user provided closures are n...
Date Wed, 29 Apr 2015 22:08:15 GMT
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5787#discussion_r29386473
  
    --- Diff: core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala ---
    @@ -180,3 +232,90 @@ class TestClassWithNesting(val y: Int) extends Serializable {
         }
       }
     }
    +
    +/**
    + * Test whether closures passed in through public APIs are actually cleaned.
    + *
    + * We put a return statement in each of these closures as a mechanism to detect whether
the
    + * ClosureCleaner actually cleaned our closure. If it did, then it would throw an appropriate
    + * exception explicitly complaining about the return statement. Otherwise, we know the
    + * ClosureCleaner did not actually clean our closure, in which case we should fail the
test.
    + */
    +private object TestUserClosuresActuallyCleaned {
    +  def testMap(rdd: RDD[Int]): Unit = { rdd.map { _ => return; 0 }.count() }
    +  def testFlatMap(rdd: RDD[Int]): Unit = { rdd.flatMap { _ => return; Seq() }.count()
}
    +  def testFilter(rdd: RDD[Int]): Unit = { rdd.filter { _ => return; true }.count()
}
    +  def testSortBy(rdd: RDD[Int]): Unit = { rdd.sortBy { _ => return; 1 }.count() }
    +  def testKeyBy(rdd: RDD[Int]): Unit = { rdd.keyBy { _ => return; 1 }.count() }
    +  def testGroupBy(rdd: RDD[Int]): Unit = { rdd.groupBy { _ => return; 1 }.count()
}
    --- End diff --
    
    No test for `testGroupBy`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message