Github user ilooner commented on the issue:
https://github.com/apache/drill/pull/1045
@paul-rogers
I have split the FragmentContext into Four interfaces. We discussed 3, but
it felt like 4 was more appropriate since some methods didn't fit well in some
of the contexts.
- **ExecutorFragmentContext**: This is the highest level context that
exposes access to everything. This is used by the FragmentExecutor and is also
passed to the BatchCreators and RootCreators.
- **RootFragmentContext**: This is exposed to the root executors. It has a
few methods only needed by the root, but doesn't have access to everything like
the ExecutorFragmentContext.
- **ExchangeFragmentContext**: This contains the network functions, and is
used by the senders and recievers.
- **FragmentContext**: This is the barebones context which has no network
functions and only exposes the bare minimum needed by operators.
These contexts are interfaces that inherit each other in the following way:
ExecutorFragmentContext -> RootFragmentContext -> ExchangeFragmentContext
-> FragmentContext
There is only one implementation of the interfaces **FragmentContextImpl**.
The facade pattern is used to cast the context to the appropriate interface
depending on where it's used.
Let me know if you'd like to change the hierarchy or organization. Once we
finalize how we want to organize things I will add javadoc.
---