Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/6740#discussion_r32104475
--- Diff: core/src/main/scala/org/apache/spark/rdd/RDDOperationScope.scala
---
@@ -95,17 +95,17 @@ private[spark] object RDDOperationScope extends Logging
{
private[spark] def withScope[T](
sc: SparkContext,
allowNesting: Boolean = false)(body: => T): T = {
- val stackTrace = Thread.currentThread.getStackTrace().tail // ignore
"Thread#getStackTrace"
- val ourMethodName = stackTrace(1).getMethodName // i.e. withScope
- // Climb upwards to find the first method that's called something
different
- val callerMethodName = stackTrace
- .find(_.getMethodName != ourMethodName)
+
+ val callerMethodName = Thread.currentThread.getStackTrace()
+ .dropWhile(! _.getMethodName().equals("withScope"))
--- End diff --
I get it, I'm reading it correctly at last now. Minor: you have two
different ways of expressing the same check in these two lines; can they both
be `_.getMethodName != "withScope"`?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]