You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by bi...@apache.org on 2013/05/24 03:37:17 UTC

git commit: TEZ-155. Basic fixes for Hive (gunther via bikas)

Updated Branches:
  refs/heads/TEZ-1 4c2732c99 -> 5d8adeb52


TEZ-155. Basic fixes for Hive (gunther via bikas)


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

Branch: refs/heads/TEZ-1
Commit: 5d8adeb52d1ef46b4ea3874a675ace930c45bc91
Parents: 4c2732c
Author: Bikas Saha <bi...@apache.org>
Authored: Thu May 23 18:34:03 2013 -0700
Committer: Bikas Saha <bi...@apache.org>
Committed: Thu May 23 18:34:03 2013 -0700

----------------------------------------------------------------------
 .../tez/mapreduce/ClientServiceDelegate.java       |   21 ++++++++++-----
 .../org/apache/tez/mapreduce/DAGJobStatus.java     |   11 ++++---
 2 files changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5d8adeb5/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/ClientServiceDelegate.java
----------------------------------------------------------------------
diff --git a/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/ClientServiceDelegate.java b/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/ClientServiceDelegate.java
index 44ccc07..1335a44 100644
--- a/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/ClientServiceDelegate.java
+++ b/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/ClientServiceDelegate.java
@@ -24,7 +24,9 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
 import org.apache.hadoop.mapreduce.*;
 import org.apache.hadoop.mapreduce.v2.LogParams;
+import org.apache.hadoop.mapreduce.v2.util.MRApps;
 import org.apache.hadoop.mapreduce.TaskCompletionEvent;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.yarn.api.records.ApplicationReport;
 import org.apache.hadoop.yarn.api.records.YarnApplicationState;
 import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
@@ -87,12 +89,17 @@ public class ClientServiceDelegate {
   }
   
   public JobStatus getJobStatus(JobID oldJobID) throws IOException {
+    org.apache.hadoop.mapreduce.v2.api.records.JobId jobId =
+      TypeConverter.toYarn(oldJobID);
+    String user = UserGroupInformation.getCurrentUser().getShortUserName();
+    String jobFile = MRApps.getJobFile(conf, user, oldJobID);
+
     try {
       if(dagClient == null) {
         appReport = getAppReport(oldJobID);
         if(appReport.getYarnApplicationState() != YarnApplicationState.RUNNING) {
           // if job not running return status from appReport;
-          return getJobStatusFromRM(appReport);
+          return getJobStatusFromRM(appReport, jobFile);
         } else {
           // job is running. create dag am client
           dagClient = tezClient.getDAGClient(appReport.getHost(), 
@@ -102,7 +109,7 @@ public class ClientServiceDelegate {
       }
       // return status from client. use saved appReport for queue etc
       DAGStatus dagStatus = dagClient.getDAGStatus(currentDAGId);
-      return new DAGJobStatus(appReport, dagStatus);
+      return new DAGJobStatus(appReport, dagStatus, jobFile);
     } catch (TezRemoteException e) {
       // AM not responding
       dagClient = null;
@@ -116,20 +123,20 @@ public class ClientServiceDelegate {
     }
     
     // final fallback
-    return getJobStatusFromRM(appReport);
+    return getJobStatusFromRM(appReport, jobFile);
   }
   
-  private JobStatus getJobStatusFromRM(ApplicationReport appReport) {
+  private JobStatus getJobStatusFromRM(ApplicationReport appReport, String jobFile) {
     JobStatus jobStatus =
-        new DAGJobStatus(appReport, null);
+      new DAGJobStatus(appReport, null, jobFile);
     return jobStatus;            
   }
 
   public org.apache.hadoop.mapreduce.TaskReport[] getTaskReports(
       JobID oldJobID, TaskType taskType)
        throws IOException{
-    // FIXME need support to query task reports?
-    throw new UnsupportedOperationException();
+    // TEZ-146: need to return real task reports
+    return new org.apache.hadoop.mapreduce.TaskReport[0];
   }
 
   public boolean killTask(TaskAttemptID taskAttemptID, boolean fail)

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/5d8adeb5/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/DAGJobStatus.java
----------------------------------------------------------------------
diff --git a/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/DAGJobStatus.java b/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/DAGJobStatus.java
index 08c61f8..10d05b3 100644
--- a/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/DAGJobStatus.java
+++ b/tez-yarn-client/src/main/java/org/apache/tez/mapreduce/DAGJobStatus.java
@@ -39,13 +39,15 @@ import org.mortbay.log.Log;
 
 public class DAGJobStatus extends JobStatus {
 
+  String jobFile;
   private final ApplicationReport report;
   private final DAGStatus dagStatus;
   
-  public DAGJobStatus(ApplicationReport appReport, DAGStatus dagStatus) {
+  public DAGJobStatus(ApplicationReport appReport, DAGStatus dagStatus, String jobFile) {
     super();
     this.report = appReport;
     this.dagStatus = dagStatus;
+    this.jobFile = jobFile;
   }
   
   @Override
@@ -215,8 +217,8 @@ public class DAGJobStatus extends JobStatus {
 
   @Override
   public synchronized JobPriority getPriority() {
-    // TODO Auto-generated method stub
-    return super.getPriority();
+    // TEX-147: return real priority
+    return JobPriority.NORMAL;
   }
 
   @Override
@@ -251,8 +253,7 @@ public class DAGJobStatus extends JobStatus {
 
   @Override
   public String getJobFile() {
-    // FIXME
-    throw new UnsupportedOperationException();
+    return jobFile;
   }
 
   @Override