You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by ss...@apache.org on 2013/11/07 20:46:14 UTC

git commit: TEZ-603. Add a temporary configuration to YARNRunner to allow it to kill a session when a job is submitted. (sseth)

Updated Branches:
  refs/heads/master e0cccc726 -> 37081a86a


TEZ-603. Add a temporary configuration to YARNRunner to allow it to kill
a session when a job is submitted. (sseth)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tez/commit/37081a86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/37081a86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/37081a86

Branch: refs/heads/master
Commit: 37081a86a9a6b43f6454ceed8dff07a6da2b078e
Parents: e0cccc7
Author: Siddharth Seth <ss...@apache.org>
Authored: Thu Nov 7 11:45:54 2013 -0800
Committer: Siddharth Seth <ss...@apache.org>
Committed: Thu Nov 7 11:45:54 2013 -0800

----------------------------------------------------------------------
 .../org/apache/tez/mapreduce/client/YARNRunner.java  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/37081a86/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
index e010ec3..1d09055 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
@@ -501,10 +501,25 @@ public class YARNRunner implements ClientProtocol {
     return finalConf;
   }
 
+  private void maybeKillSession() throws IOException {
+    String sessionAppIdToKill = conf.get("mapreduce.tez.session.tokill-application-id");
+    if (sessionAppIdToKill != null) {
+      ApplicationId killAppId = ConverterUtils.toApplicationId(sessionAppIdToKill);
+      try {
+        resMgrDelegate.killApplication(killAppId);
+      } catch (YarnException e) {
+        throw new IOException("Failed while killing Session AppId", e);
+      }
+    }
+  }
+  
   @Override
   public JobStatus submitJob(JobID jobId, String jobSubmitDir, Credentials ts)
   throws IOException, InterruptedException {
 
+    // HACK! TEZ-604. Get rid of this once Hive moves all of it's tasks over to Tez native.
+    maybeKillSession();
+    
     ApplicationId appId = resMgrDelegate.getApplicationId();
 
     FileSystem fs = FileSystem.get(conf);