pvary commented on a change in pull request #2865:
URL: https://github.com/apache/hive/pull/2865#discussion_r767587185



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/reexec/IReExecutionPlugin.java
##########
@@ -42,24 +42,72 @@
   /**
    * Called before executing the query.
    */
-  void beforeExecute(int executionIndex, boolean explainReOptimization);
+  default void beforeExecute(int executionIndex, boolean 
explainReOptimization) {
+    // default noop
+  }
 
   /**
    * The query have failed, does this plugin advises to re-execute it again?
    */
-  boolean shouldReExecute(int executionNum);
+  default boolean shouldReExecute(int executionNum) {
+    // default no
+    return false;
+  }
 
   /**
-   * The plugin should prepare for the re-compilaton of the query.
+   * The plugin should prepare for the re-compilation of the query.
    */
-  void prepareToReExecute();
+  default void prepareToReExecute() {
+    // default noop
+  }
 
   /**
-   * The query have failed; and have been recompiled - does this plugin 
advises to re-execute it again?
+   * The query has failed; and have been recompiled - does this plugin advises 
to re-execute it again?
    */
-  boolean shouldReExecute(int executionNum, PlanMapper oldPlanMapper, 
PlanMapper newPlanMapper);
+  default boolean shouldReExecute(int executionNum, PlanMapper oldPlanMapper, 
PlanMapper newPlanMapper) {

Review comment:
       The CBO ReExecute (ReCompile) plugin does not need reExecute...
   
   Let's talk about this. IMHO default implementation makes the codes of the 
specific plugins much more readable. No useless code is needed there.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to