[jira] [Created] (FLINK-20719) Change BatchExecNode & StreamExecNode to interface and make each node extended from ExecNodeBase directly

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-20719) Change BatchExecNode & StreamExecNode to interface and make each node extended from ExecNodeBase directly

Shang Yuanchun (Jira)
godfrey he created FLINK-20719:
----------------------------------

             Summary: Change BatchExecNode & StreamExecNode to interface and make each node extended from ExecNodeBase directly
                 Key: FLINK-20719
                 URL: https://issues.apache.org/jira/browse/FLINK-20719
             Project: Flink
          Issue Type: Sub-task
          Components: Table SQL / Planner
            Reporter: godfrey he
             Fix For: 1.13.0


Currently the inheritance structure of exec nodes is:

{code:java}
ExecNode (interface)
   |_ ExecNodeBase (abstract class)
         |_ BatchExecNode (abstract class)
               |_ BatchExecCalc
               |_ ...
         |_ StreamExecNode (abstract class)
               |_ StreamExecCalc
               |_ ...
{code}
the advantage is: each specific node only needs to inherit one base class, and BatchExecNode and StreamExecNode can provide some default implementation
the disadvantage is: common class of specific batch node and stream node must be interface which only can provide some utility method through default implementation and its sub-classes also have some deduplicate code.  if the common class can be abstract class, its sub-classes is cleaner.  such as: Calc classes

the structure after adjustment is:
{code:java}
ExecNode (interface)
   |_ ExecNodeBase (abstract class)
   |_ BatchExecNode (interface)
   |_ StreamExecNode (interface)

class BatchExecCalc extends ExecNodeBase implements BatchExecNode
...

class StreamExecCalc extends ExecNodeBase implements StreamExecNode
...
{code}
the advantage is: common class can be abstract class, its sub-classes will be cleaner; we can add some specific method definition in BatchExecNode and StreamExecNode, which is more extendable.
the disadvantage is: each specific node must extend from ExecNodeBase and Batch(/Stream)ExecNode.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)