You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/10/07 12:15:00 UTC

[jira] [Work logged] (HIVE-23800) Add hooks when HiveServer2 stops due to OutOfMemoryError

     [ https://issues.apache.org/jira/browse/HIVE-23800?focusedWorklogId=496538&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-496538 ]

ASF GitHub Bot logged work on HIVE-23800:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Oct/20 12:14
            Start Date: 07/Oct/20 12:14
    Worklog Time Spent: 10m 
      Work Description: 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:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 496538)
    Time Spent: 5h 10m  (was: 5h)

> Add hooks when HiveServer2 stops due to OutOfMemoryError
> --------------------------------------------------------
>
>                 Key: HIVE-23800
>                 URL: https://issues.apache.org/jira/browse/HIVE-23800
>             Project: Hive
>          Issue Type: Improvement
>          Components: HiveServer2
>            Reporter: Zhihua Deng
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> Make oom hook an interface of HiveServer2,  so user can implement the hook to do something before HS2 stops, such as dumping the heap or altering the devops.



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