GitHub user paul-rogers opened a pull request: https://github.com/apache/drill/pull/787
DRILL-5319: Refactor "contexts" for unit testing This PR is purely a refactoring: no functionality is added or changed. The refactoring splits various context and related classes into a set of new interfaces with needed for operator-level unit tests. The other, Drillbit-related methods are left in the original interfaces. Most code need not change. The changes here allow operator-level unit tests to mock up the exec-time methods so we can use them without firing up a Drillbit (or using mocking libraries). A later PR will provide the sub-operator test framework that uses this refactoring. Changes include: * The OptionManager is split, with read-only methods moving to a new OptionSet interface. * The FragmentContext is split, with an exec-only FragmentExecContext proving low-level methods. * OperatorStats is split, with a new OperatorStatReceiver class providing write-only support to operators. * Several places that accepted an OperatorContext or FragmentContext, but needed only an allocator, are changed to accept the allocator directly. You can merge this pull request into a Git repository by running: $ git pull https://github.com/paul-rogers/drill DRILL-5319 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/drill/pull/787.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #787 ---- commit e4d3b383ee905921ac505f4278220a3270caa68e Author: Paul Rogers <prog...@maprtech.com> Date: 2017-03-19T02:52:52Z DRILL-5319: Refactor "contexts" for unit testing This PR is purely a refactoring: no functionality is added or changed. The refactoring splits various context and related classes into a set of new interfaces with needed for operator-level unit tests. The other, Drillbit-related methods are left in the original interfaces. Most code need not change. The changes here allow operator-level unit tests to mock up the exec-time methods so we can use them without firing up a Drillbit (or using mocking libraries). A later PR will provide the sub-operator test framework that uses this refactoring. Changes include: * The OptionManager is split, with read-only methods moving to a new OptionSet interface. * The FragmentContext is split, with an exec-only FragmentExecContext proving low-level methods. * OperatorStats is split, with a new OperatorStatReceiver class providing write-only support to operators. * Several places that accepted an OperatorContext or FragmentContext, but needed only an allocator, are changed to accept the allocator directly. ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---