[
https://issues.apache.org/jira/browse/DRILL-5116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15791554#comment-15791554
]
Paul Rogers commented on DRILL-5116:
------------------------------------
With this fix, Drill provides several new features to control plain-old Java
compilation.
First, each operator declares its code generator ready for plain-old Java
compilation:
{code}
cg.plainOldJavaCapable(true);
{code}
Second, each operator contains a commented-out line that will both turn on
plain-old Java and persist the code when you want to debug it. Uncomment the
line to enable debugging. This is done this way because, in general, we only
want to debug one operator at a time and only when when working on some
specific problem.
{code}
// Uncomment out this line to debug the generated code.
// cg.persistCode(true);
{code}
Code is written to a location defined by the config setting added in
DRILL-5052. Here is the default; you can override it in {{drill-override.conf}}:
{code}
compile: {
...
// Where to save the generated source. See ClassBuilder
code_dir: "/tmp/drill/codegen"
{code}
Finally, you can request that all code be generated as plain-old Java. Note
that this should be considered experimental at this point: the unit tests pass
with this option on, but much more testing is required. Again, this is a config
option:
{code}
compile: {
// Use plain Java compilation where available
prefer_plain_java: false
{code}
> Enable generated code debugging in each Drill operator
> ------------------------------------------------------
>
> Key: DRILL-5116
> URL: https://issues.apache.org/jira/browse/DRILL-5116
> Project: Apache Drill
> Issue Type: Improvement
> Affects Versions: 1.9.0
> Reporter: Paul Rogers
> Assignee: Paul Rogers
> Priority: Minor
>
> DRILL-5052 adds the ability to debug generated code. Some of the code
> generated by Drill's operators has minor problems when compiled directly
> using the new technique. These issues are ignore by the byte-code-merge
> technique uses in production. This ticket asks to try the DRILL-5052 feature
> in each operator, clean up any minor problems, and ensure each operator
> generates code suitable for debugging. Use the new
> {{CodeGenerator.plainOldJavaCapable()}} method to mark each generated class
> as ready for "plain-old Java" code gen.
> The advantages of this feature are two:
> 1. Ability to step through the generated code to increase understanding of
> existing operators and to ease development of improvements to existing
> operators and of any new operators we choose to create.
> 2. Open the door to experimenting with how to improve performance of the
> generated code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)