XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.11.0
    • Fix Version/s: 1.11.0
    • Component/s: Tools, Build & Test
    • Labels:
      None

      Description

      Each operator has visibility to the FragmentContext class. FragmentContext provides access to all of Drill internals: the Drillbit context, the network interfaces, RPC messages and so on.

      Further, all the code generation mechanisms require a FragmentContext object.

      This structure creates a large barrier to unit testing. To test, say, a particular bit of generated code, we must have the entire Drillbit running so we can obtain a FragmentContext. Clearly, this is less than ideal.

      Upon inspection, it turns out that the FragmentContext is mostly needed, by many operators, to generate code. Of the many methods in FragmentContext, code generation uses only six.

      The solution is to create a new super-interface, CodeGenContext, which holds those six methods. The CodeGenContext can be easily re-implemented for unit testing.

      Then, modify all the code-generation classes that currently take FragmentContext to take CodeGenContext instead.

      Since FragmentContext derives from CodeGenContext, existing operator code "just works."

        Attachments

          Activity

            People

            • Assignee:
              paul-rogers Paul Rogers
              Reporter:
              paul-rogers Paul Rogers
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: