atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suma...@apache.org
Subject incubator-atlas git commit: ATLAS-834 Handle exceptions from HiveHook executor.submit() (sumasai)
Date Sat, 28 May 2016 13:26:21 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 56c13aa36 -> 65d95ebe2


ATLAS-834 Handle exceptions from HiveHook executor.submit() (sumasai)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/65d95ebe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/65d95ebe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/65d95ebe

Branch: refs/heads/master
Commit: 65d95ebe23744f72c0ed40b9a171d3c42cd2906c
Parents: 56c13aa
Author: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Authored: Sat May 28 06:26:09 2016 -0700
Committer: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Committed: Sat May 28 06:26:09 2016 -0700

----------------------------------------------------------------------
 .../org/apache/atlas/hive/hook/HiveHook.java    | 61 ++++++++++----------
 release-log.txt                                 |  1 +
 2 files changed, 33 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/65d95ebe/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
index 3dfba05..9026b3c 100755
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
@@ -154,36 +154,39 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext
{
     @Override
     public void run(final HookContext hookContext) throws Exception {
         // clone to avoid concurrent access
-
-        final HiveConf conf = new HiveConf(hookContext.getConf());
-
-        final HiveEventContext event = new HiveEventContext();
-        event.setInputs(hookContext.getInputs());
-        event.setOutputs(hookContext.getOutputs());
-        event.setJsonPlan(getQueryPlan(hookContext.getConf(), hookContext.getQueryPlan()));
-        event.setHookType(hookContext.getHookType());
-        event.setUgi(hookContext.getUgi());
-        event.setUser(getUser(hookContext.getUserName()));
-        event.setOperation(OPERATION_MAP.get(hookContext.getOperationName()));
-        event.setQueryId(hookContext.getQueryPlan().getQueryId());
-        event.setQueryStr(hookContext.getQueryPlan().getQueryStr());
-        event.setQueryStartTime(hookContext.getQueryPlan().getQueryStartTime());
-        event.setQueryType(hookContext.getQueryPlan().getQueryPlan().getQueryType());
-
-        boolean sync = conf.get(CONF_SYNC, "false").equals("true");
-        if (sync) {
-            fireAndForget(event);
-        } else {
-            executor.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        fireAndForget(event);
-                    } catch (Throwable e) {
-                        LOG.info("Atlas hook failed", e);
+        try {
+            final HiveConf conf = new HiveConf(hookContext.getConf());
+
+            final HiveEventContext event = new HiveEventContext();
+            event.setInputs(hookContext.getInputs());
+            event.setOutputs(hookContext.getOutputs());
+            event.setJsonPlan(getQueryPlan(hookContext.getConf(), hookContext.getQueryPlan()));
+            event.setHookType(hookContext.getHookType());
+            event.setUgi(hookContext.getUgi());
+            event.setUser(getUser(hookContext.getUserName()));
+            event.setOperation(OPERATION_MAP.get(hookContext.getOperationName()));
+            event.setQueryId(hookContext.getQueryPlan().getQueryId());
+            event.setQueryStr(hookContext.getQueryPlan().getQueryStr());
+            event.setQueryStartTime(hookContext.getQueryPlan().getQueryStartTime());
+            event.setQueryType(hookContext.getQueryPlan().getQueryPlan().getQueryType());
+
+            boolean sync = conf.get(CONF_SYNC, "false").equals("true");
+            if (sync) {
+                fireAndForget(event);
+            } else {
+                executor.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            fireAndForget(event);
+                        } catch (Throwable e) {
+                            LOG.error("Atlas hook failed due to error ", e);
+                        }
                     }
-                }
-            });
+                });
+            }
+        } catch(Throwable t) {
+            LOG.error("Submitting to thread pool failed due to error ", t);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/65d95ebe/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 977fcf4..da80b6e 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -22,6 +22,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file
(dosset
 ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via
shwethags)
 
 ALL CHANGES:
+ATLAS-834 Handle exceptions from HiveHook executor.submit() (sumasai)
 ATLAS-635 Process showing old entity name where as actual entity is renamed ( svimal2106
via sumasai )
 ATLAS-823 Atlas should use external HBase and SOLR (tbeerbower via shwethags)
 ATLAS-752 Column renames should retain traits/tags (svimal2106 via shwethags)


Mime
View raw message