You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2018/08/01 17:40:12 UTC
[GitHub] spark pull request #21930: [SPARK-14540][Core] Fix remaining major issues fo...
Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/21930#discussion_r206968703
--- Diff: core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala ---
@@ -159,6 +160,43 @@ private[spark] object ClosureCleaner extends Logging {
clean(closure, checkSerializable, cleanTransitively, Map.empty)
}
+ /**
+ * Try to get a serialized Lambda from the closure.
+ *
+ * @param closure the closure to check.
+ */
+ private def getSerializedLambda(closure: AnyRef): Option[SerializedLambda] = {
+ if (scala.util.Properties.versionString.contains("2.11")) {
+ return None
+ }
+ val isClosureCandidate =
+ closure.getClass.isSynthetic &&
+ closure
+ .getClass
+ .getInterfaces.exists{x: Class[_] => x.getName.equals("scala.Serializable") }
+
+ if (isClosureCandidate) {
+ try {
+ val res = inspect(closure)
--- End diff --
Inline res? just little stuff that might streamline this a bit, it doesn't matter
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org