NOTE: before LLAP branch merge, there's no LLAP code here.
There used to be a global static map of IOContext-s inside IOContext (Hive style!).
Unfortunately, due to variety of factors, this is now a giant fustercluck.
1) Spark doesn't apparently care about multiple inputs, but has multiple threads, so one
threadlocal IOContext was added for it.
2) LLAP has lots of tasks in the same process so globals no longer cut it either.
3) However, Tez runs 2+ threads for one task (e.g. TezTaskEventRouter and TezChild), and these
surprisingly enough need the same context. Tez, in its infinite wisdom, doesn't allow them
to communicate in any way nor provide any shared context.
So we are going to...
1) Keep the good ol' global map for MR and Tez. Hive style!
2) Keep the threadlocal for Spark. Hive style!
3) Create inheritable (TADA!) threadlocal with attemptId, only set in LLAP; that will propagate
to all the little Tez threads, and we will keep a map per attempt. Hive style squared!