Github user srowen commented on the pull request:
https://github.com/apache/spark/pull/12248#issuecomment-207588437
This can as easily be ...
```
Properties p = ...
p.put("traceId", "foo")
...
def handleRead(...) {
log4j.MDC.put("traceId", p.get("traceId"))
...
}
```
I get that if `handleRead` is buried somewhere in a library function you
have to plumb through access to Properties explicitly in the library. Going via
static methods on a thread-local task context is a little less transparent, but
it is more convenient. That's really the win, that anything in your code has
direct magic access to context props; I don't think anything else actually gets
simpler.
I think the fact it's already an API reduces the cost of a change like this
in comparison, so I can see the argument for it.
---
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]