deniskuzZ commented on code in PR #5649:
URL: https://github.com/apache/hive/pull/5649#discussion_r2017576257
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/KillTriggerActionHandler.java:
##########
@@ -38,28 +38,24 @@ public class KillTriggerActionHandler implements
TriggerActionHandler<TezSession
@Override
public void applyAction(final Map<TezSessionState, Trigger> queriesViolated)
{
for (Map.Entry<TezSessionState, Trigger> entry :
queriesViolated.entrySet()) {
- switch (entry.getValue().getAction().getType()) {
- case KILL_QUERY:
- TezSessionState sessionState = entry.getKey();
- String queryId = sessionState.getWmContext().getQueryId();
- try {
- UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
- SessionState ss = new SessionState(new HiveConf(),
ugi.getShortUserName());
- ss.setIsHiveServerQuery(true);
- SessionState.start(ss);
- KillQuery killQuery = sessionState.getKillQuery();
- // if kill query is null then session might have been released to
pool or closed already
- if (killQuery != null) {
- sessionState.getKillQuery().killQuery(queryId,
entry.getValue().getViolationMsg(),
- sessionState.getConf());
- }
- } catch (HiveException|IOException e) {
- LOG.warn("Unable to kill query {} for trigger violation", queryId);
+ if (entry.getValue().getAction().getType() == Action.Type.KILL_QUERY) {
+ TezSessionState sessionState = entry.getKey();
+ String queryId = sessionState.getWmContext().getQueryId();
+ try {
+ UserGroupInformation ugi =
UserGroupInformation.getCurrentUser();
+ DriverUtils.setUpSessionState(sessionState.getConf(),
ugi.getShortUserName());
Review Comment:
Should we pass the `conf` to `KillTriggerActionHandler` constructor from
`TezSessionPoolManager#initTriggers` and use it instead of
`TezSessionState#getConf`?
--
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]