Github user jerryshao commented on the issue:
https://github.com/apache/spark/pull/15377
@srowen I'm not against this change, personally because the usage of flag
is wired to me and frankly saying I haven't seen such pattern in the Spark code.
Since we want to avoid re-executing the code if CallContext is not enabled
or not existed. We could get this information immutably like:
```scala
private[util] object CallerContext {
val callerContextSupported: Boolean = if (callContext is not enabled) {
false
} else if (callContext is not existed) {
false
} else {
true
}
}
```
And in `setCurrentContext` we could get rid of this mutable things, use the
flag to decide whether to set the caller context without reset flag. That will
simplify the codes and make others easy to understand.
What do you think?
---
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]