kgyrtkirk commented on a change in pull request #1205:
URL: https://github.com/apache/hive/pull/1205#discussion_r500961287



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/HookRunner.java
##########
@@ -39,57 +36,27 @@
 import org.apache.hadoop.hive.ql.parse.HiveSemanticAnalyzerHook;
 import org.apache.hadoop.hive.ql.parse.HiveSemanticAnalyzerHookContext;
 import org.apache.hadoop.hive.ql.session.SessionState;
-import org.apache.hadoop.hive.ql.session.SessionState.LogHelper;
 import org.apache.hive.common.util.HiveStringUtils;
 
+import static org.apache.hadoop.hive.ql.hooks.HookContext.HookType.*;
+
 /**
  * Handles hook executions for {@link Driver}.
  */
 public class HookRunner {
 
   private static final String CLASS_NAME = Driver.class.getName();
   private final HiveConf conf;
-  private LogHelper console;
-  private List<QueryLifeTimeHook> queryHooks = new ArrayList<>();
-  private List<HiveSemanticAnalyzerHook> saHooks = new ArrayList<>();
-  private List<HiveDriverRunHook> driverRunHooks = new ArrayList<>();
-  private List<ExecuteWithHookContext> preExecHooks = new ArrayList<>();
-  private List<ExecuteWithHookContext> postExecHooks = new ArrayList<>();
-  private List<ExecuteWithHookContext> onFailureHooks = new ArrayList<>();
-  private boolean initialized = false;
+  private final HooksLoader loader;

Review comment:
       this is great!
   since from now on we can also dynamically add new hooks to it at runtime - 
we may rename it from "Loader" to something else.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java
##########
@@ -45,7 +47,50 @@
 public class HookContext {
 
   static public enum HookType {
-    PRE_EXEC_HOOK, POST_EXEC_HOOK, ON_FAILURE_HOOK
+

Review comment:
       I like this approach - could you make a small check:
   
   * if we have hook compiled for the old api (which uses say the enum key 
`HookType.PRE_EXEC_HOOK`)
   * will it work or not  (without recompilation) with the new implementation




----------------------------------------------------------------
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.

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