Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AA0A8200C36 for ; Fri, 24 Feb 2017 02:08:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A8D90160B7D; Fri, 24 Feb 2017 01:08:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F1573160B7F for ; Fri, 24 Feb 2017 02:08:35 +0100 (CET) Received: (qmail 32933 invoked by uid 500); 24 Feb 2017 01:08:34 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 31477 invoked by uid 99); 24 Feb 2017 01:08:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2017 01:08:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 82C33DFF75; Fri, 24 Feb 2017 01:08:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sershe@apache.org To: commits@hive.apache.org Date: Fri, 24 Feb 2017 01:08:39 -0000 Message-Id: <394d5684d2bf448ab4a61b0e8b17629c@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [07/50] [abbrv] hive git commit: HIVE-15936: ConcurrentModificationException in ATSHook (Daniel Dai, reviewed by Jason Dere) archived-at: Fri, 24 Feb 2017 01:08:36 -0000 HIVE-15936: ConcurrentModificationException in ATSHook (Daniel Dai, reviewed by Jason Dere) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/3485d02c Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/3485d02c Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/3485d02c Branch: refs/heads/hive-14535 Commit: 3485d02cbfca5603e86e7b370da86b607003f337 Parents: 90688bd Author: Daniel Dai Authored: Fri Feb 17 00:22:54 2017 -0800 Committer: Daniel Dai Committed: Fri Feb 17 00:22:54 2017 -0800 ---------------------------------------------------------------------- .../org/apache/hadoop/hive/ql/hooks/ATSHook.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/3485d02c/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java b/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java index 55b922b..72a1acc 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java @@ -143,6 +143,11 @@ public class ATSHook implements ExecuteWithHookContext { final QueryState queryState = hookContext.getQueryState(); final String queryId = queryState.getQueryId(); + final Map durations = new HashMap(); + for (String key : hookContext.getPerfLogger().getEndTimes().keySet()) { + durations.put(key, hookContext.getPerfLogger().getDuration(key)); + } + try { setupAtsExecutor(conf); @@ -203,10 +208,10 @@ public class ATSHook implements ExecuteWithHookContext { tablesRead, tablesWritten, conf, llapId)); break; case POST_EXEC_HOOK: - fireAndForget(createPostHookEvent(queryId, currentTime, user, requestuser, true, opId, hookContext.getPerfLogger())); + fireAndForget(createPostHookEvent(queryId, currentTime, user, requestuser, true, opId, durations)); break; case ON_FAILURE_HOOK: - fireAndForget(createPostHookEvent(queryId, currentTime, user, requestuser , false, opId, hookContext.getPerfLogger())); + fireAndForget(createPostHookEvent(queryId, currentTime, user, requestuser , false, opId, durations)); break; default: //ignore @@ -325,7 +330,7 @@ public class ATSHook implements ExecuteWithHookContext { } TimelineEntity createPostHookEvent(String queryId, long stopTime, String user, String requestuser, boolean success, - String opId, PerfLogger perfLogger) throws Exception { + String opId, Map durations) throws Exception { LOG.info("Received post-hook notification for :" + queryId); TimelineEntity atsEntity = new TimelineEntity(); @@ -346,8 +351,8 @@ public class ATSHook implements ExecuteWithHookContext { // Perf times JSONObject perfObj = new JSONObject(new LinkedHashMap<>()); - for (String key : perfLogger.getEndTimes().keySet()) { - perfObj.put(key, perfLogger.getDuration(key)); + for (Map.Entry entry : durations.entrySet()) { + perfObj.put(entry.getKey(), entry.getValue()); } atsEntity.addOtherInfo(OtherInfoTypes.PERF.name(), perfObj.toString());