[ https://issues.apache.org/jira/browse/HIVE-23800?focusedWorklogId=459045&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-459045 ]
ASF GitHub Bot logged work on HIVE-23800: ----------------------------------------- Author: ASF GitHub Bot Created on: 15/Jul/20 00:57 Start Date: 15/Jul/20 00:57 Worklog Time Spent: 10m Work Description: dengzhhu653 commented on pull request #1205: URL: https://github.com/apache/hive/pull/1205#issuecomment-658484942 > when I was using some of these hooks earlier: they are too specific to some purpose. > right now the proposed callback is a {{Runnable}} ... which means you will have to create a completely new one in case you want to pass some things to it later... > > so...I would recommend the following: > > * remove the "oom" keyword from the name of the hook/etc - it could be diag, debug or something like that > * add a callback which has 2 arguments: > > * a callback type (some enum; which should have a value which is specific to "oom") > * some callback payload object to which we can add things later on... it could be an object using the {{Adaptable}} pattern > > all this stuff is to make it a bit more reusable if we need to reuse it later on... ...Sorry, I don't get much clear about "some callback payload object to which we can add things later on.", is something like this: ``` public class HookRuntime { private static final HookRuntime runtime = new HookRuntime(); public static HookRuntime getHookRuntime() { return runtime; } private Map<Enum, HookPayloadObject> hooks = new HashMap<>(); void callback(Enum Type, HookPayloadObject payload) { } HookPayloadObject getHookPayLoad(Enum typs) { return null; } } public interface HookPayloadObject<T> extends Runnable { void addHook(Hook hook); void setContext(T context); } ``` Thanks a lot for your time! ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 459045) Time Spent: 2h 10m (was: 2h) > 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: Major > Labels: pull-request-available > Time Spent: 2h 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)