hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r1091574 [1/2] - in /hadoop/mapreduce/branches/MR-279: ./ mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/ mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/ mr-client/hadoop...
Date Tue, 12 Apr 2011 21:15:42 GMT
Author: acmurthy
Date: Tue Apr 12 21:15:37 2011
New Revision: 1091574

URL: http://svn.apache.org/viewvc?rev=1091574&view=rev
Log:
Implement 'bin/mapred job -list' and 'bin/mapred job -list-active-trackers'.

Added:
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsRequestPBImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsResponsePBImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Application.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationPBImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java
Removed:
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/Application.java
Modified:
    hadoop/mapreduce/branches/MR-279/CHANGES.txt
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/client_RM_protocol.proto
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_service_protos.proto
    hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManager.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManagerImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsList.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RmController.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebApp.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java

Modified: hadoop/mapreduce/branches/MR-279/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/CHANGES.txt?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/MR-279/CHANGES.txt Tue Apr 12 21:15:37 2011
@@ -2,6 +2,11 @@ Hadoop MapReduce Change Log
 
 Trunk (unreleased changes)
 
+  MAPREDUCE-279
+    
+    Implement 'bin/mapred job -list' and 'bin/mapred job
+    -list-active-trackers'. (acmurthy)
+
   INCOMPATIBLE CHANGES
 
     MAPREDUCE-1866. Removes deprecated class

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java Tue Apr 12 21:15:37 2011
@@ -18,6 +18,8 @@
 
 package org.apache.hadoop.mapreduce;
 
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -26,6 +28,7 @@ import org.apache.hadoop.mapred.JobPrior
 import org.apache.hadoop.mapred.TIPStatus;
 import org.apache.hadoop.mapred.TaskCompletionEvent;
 import org.apache.hadoop.mapreduce.TaskReport;
+import org.apache.hadoop.mapreduce.JobStatus.State;
 import org.apache.hadoop.mapreduce.v2.api.records.Counter;
 import org.apache.hadoop.mapreduce.v2.api.records.CounterGroup;
 import org.apache.hadoop.mapreduce.v2.api.records.Counters;
@@ -40,7 +43,10 @@ import org.apache.hadoop.mapreduce.v2.ap
 import org.apache.hadoop.mapreduce.v2.api.records.TaskState;
 import org.apache.hadoop.mapreduce.v2.api.records.TaskType;
 import org.apache.hadoop.yarn.YarnException;
+import org.apache.hadoop.yarn.api.records.Application;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ApplicationState;
+import org.apache.hadoop.yarn.api.records.NodeManagerInfo;
 import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
 
 public class TypeConverter {
@@ -331,5 +337,70 @@ public class TypeConverter {
     }
     return reports;
   }
+  
+  public static JobStatus.State fromYarn(ApplicationState state) {
+    switch (state) {
+    case ALLOCATED:
+    case LAUNCHED:
+    case PENDING:
+      return State.PREP;
+    case PAUSED:
+    case RUNNING:
+      return State.RUNNING;
+    case COMPLETED:
+      return State.SUCCEEDED;
+    case FAILED:
+      return State.FAILED;
+    case KILLED:
+      return State.KILLED;
+    }
+    throw new YarnException("Unrecognized application state: " + state);
+  }
+
+  public static TaskTrackerInfo fromYarn(NodeManagerInfo node) {
+    TaskTrackerInfo taskTracker = new TaskTrackerInfo(node.getNodeName());
+    return taskTracker;
+  }
+
+  public static TaskTrackerInfo[] fromYarn(List<NodeManagerInfo> nodes) {
+    List<TaskTrackerInfo> taskTrackers = new ArrayList<TaskTrackerInfo>();
+    for (NodeManagerInfo node : nodes) {
+      taskTrackers.add(fromYarn(node));
+    }
+    return taskTrackers.toArray(new TaskTrackerInfo[nodes.size()]);
+  }
+
+  public static JobStatus fromYarn(Application application) {
+    String trackingUrl = "";
+    try {
+      if (application.getMasterHost() != null) {
+        URL url = 
+          new URL("http", application.getMasterHost(),
+              application.getMasterPort(), "");
+        trackingUrl = url.toString();
+      }
+    } catch (MalformedURLException ignored) {
+    }
+
+    JobStatus jobStatus = 
+      new JobStatus(
+          TypeConverter.fromYarn(application.getApplicationId()), 
+          0.0f, 0.0f, 0.0f, 0.0f, 
+          TypeConverter.fromYarn(application.getState()), 
+          org.apache.hadoop.mapreduce.JobPriority.NORMAL, 
+          application.getUser(), application.getName(), "", 
+          trackingUrl
+      ); 
+    return jobStatus;
+  }
+
+  public static JobStatus[] fromYarn(List<Application> applications) {
+    List<JobStatus> jobStatuses = new ArrayList<JobStatus>();
+    for (Application application : applications) {
+      jobStatuses.add(TypeConverter.fromYarn(application));
+    }
+    return jobStatuses.toArray(new JobStatus[jobStatuses.size()]);
+  }
+
 }
 

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java Tue Apr 12 21:15:37 2011
@@ -211,11 +211,17 @@ public class Cluster {
    * @return array of {@link Job}
    * @throws IOException
    * @throws InterruptedException
+   * @deprecated Use {@link #getAllJobStatuses()} instead
    */
+  @Deprecated
   public Job[] getAllJobs() throws IOException, InterruptedException {
     return getJobs(client.getAllJobs());
   }
   
+  public JobStatus[] getAllJobStatuses() throws IOException, InterruptedException {
+    return client.getAllJobs();
+  }
+  
   /**
    * Grab the jobtracker system directory path where 
    * job-specific files will  be placed.

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java Tue Apr 12 21:15:37 2011
@@ -444,13 +444,13 @@ public class CLI extends Configured impl
    */
   private void listJobs(Cluster cluster) 
       throws IOException, InterruptedException {
-    List<Job> runningJobs = new ArrayList<Job>();
-    for (Job job : cluster.getAllJobs()) {
-      if (!job.isComplete()) {
+    List<JobStatus> runningJobs = new ArrayList<JobStatus>();
+    for (JobStatus job : cluster.getAllJobStatuses()) {
+      if (!job.isJobComplete()) {
         runningJobs.add(job);
       }
     }
-    displayJobList(runningJobs.toArray(new Job[0]));
+    displayJobListFromStatus(runningJobs.toArray(new JobStatus[0]));
   }
     
   /**
@@ -459,7 +459,7 @@ public class CLI extends Configured impl
    */
   private void listAllJobs(Cluster cluster) 
       throws IOException, InterruptedException {
-    displayJobList(cluster.getAllJobs());
+    displayJobListFromStatus(cluster.getAllJobStatuses());
   }
   
   /**
@@ -523,18 +523,18 @@ public class CLI extends Configured impl
     }
   }
   
-  protected void displayJobList(Job[] jobs) 
-      throws IOException, InterruptedException {
+  protected void displayJobListFromStatus(JobStatus[] jobs) 
+  throws IOException, InterruptedException {
     System.out.println("Total jobs:" + jobs.length);
     System.out.println("JobId\tState\tStartTime\t" +
-      "UserName\tPriority\tSchedulingInfo");
-    for (Job job : jobs) {
+    "UserName\tPriority\tSchedulingInfo");
+    for (JobStatus job : jobs) {
       System.out.printf("%s\t%s\t%d\t%s\t%s\t%s\n", job.getJobID().toString(),
-        job.getJobState(), job.getStartTime(),
-        job.getUser(), job.getPriority().name(), job.getSchedulingInfo());
+          job.getState(), job.getStartTime(),
+          job.getUsername(), job.getPriority().name(), job.getSchedulingInfo());
     }
-  }
-  
+}
+
   public static void main(String[] argv) throws Exception {
     int res = ToolRunner.run(new CLI(), argv);
     System.exit(res);

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java Tue Apr 12 21:15:37 2011
@@ -20,6 +20,7 @@ package org.apache.hadoop.mapred;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -42,16 +43,21 @@ import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.SecurityInfo;
 import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.yarn.api.ClientRMProtocol;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationMaster;
 import org.apache.hadoop.yarn.api.records.ApplicationState;
 import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
+import org.apache.hadoop.yarn.api.records.NodeManagerInfo;
 import org.apache.hadoop.yarn.api.records.YarnClusterMetrics;
 import org.apache.hadoop.yarn.conf.YARNApplicationConstants;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
@@ -97,12 +103,20 @@ public class ResourceMgrDelegate {
 
   public TaskTrackerInfo[] getActiveTrackers() throws IOException,
       InterruptedException {
-    return null;
+    GetClusterNodesRequest request = 
+      recordFactory.newRecordInstance(GetClusterNodesRequest.class);
+    GetClusterNodesResponse response = 
+      applicationsManager.getClusterNodes(request);
+    return TypeConverter.fromYarn(response.getNodeManagerList());
   }
 
 
   public JobStatus[] getAllJobs() throws IOException, InterruptedException {
-    return null;
+    GetAllApplicationsRequest request =
+      recordFactory.newRecordInstance(GetAllApplicationsRequest.class);
+    GetAllApplicationsResponse response = 
+      applicationsManager.getAllApplications(request);
+    return TypeConverter.fromYarn(response.getApplicationList());
   }
 
 

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java Tue Apr 12 21:15:37 2011
@@ -121,7 +121,7 @@ public class YARNRunner implements Clien
   @Override
   public TaskTrackerInfo[] getActiveTrackers() throws IOException,
       InterruptedException {
-	  throw new IOException("Not implemented");
+	  return resMgrDelegate.getActiveTrackers();
   }
 
   @Override

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java Tue Apr 12 21:15:37 2011
@@ -63,10 +63,14 @@ import org.apache.hadoop.yarn.YarnExcept
 import org.apache.hadoop.yarn.api.ClientRMProtocol;
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest;
@@ -75,7 +79,7 @@ import org.apache.hadoop.yarn.api.record
 import org.apache.hadoop.yarn.api.records.ApplicationMaster;
 import org.apache.hadoop.yarn.api.records.ApplicationState;
 import org.apache.hadoop.yarn.api.records.ApplicationStatus;
-import org.apache.hadoop.yarn.conf.YarnConfiguration;
+import org.apache.hadoop.yarn.conf.YarnConfiguration;;
 import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
 import org.apache.hadoop.yarn.factories.RecordFactory;
 import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
@@ -213,6 +217,20 @@ public class TestClientRedirect {
     public GetClusterMetricsResponse getClusterMetrics(GetClusterMetricsRequest request) throws YarnRemoteException {
       return null;
     }
+
+    @Override
+    public GetAllApplicationsResponse getAllApplications(
+        GetAllApplicationsRequest request) throws YarnRemoteException {
+      // TODO Auto-generated method stub
+      return null;
+    }
+
+    @Override
+    public GetClusterNodesResponse getClusterNodes(
+        GetClusterNodesRequest request) throws YarnRemoteException {
+      // TODO Auto-generated method stub
+      return null;
+    }
   }
 
   class HistoryService extends AMService {

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java Tue Apr 12 21:15:37 2011
@@ -92,7 +92,7 @@ public class TestMRJobsWithHistoryServic
     while (true) {
       Thread.sleep(1000);
       if (mrCluster.getResourceManager().getApplicationsManager()
-          .getApplication(appID).state().equals(ApplicationState.COMPLETED))
+          .getApplication(appID).getState().equals(ApplicationState.COMPLETED))
         break;
     }
     Counters counterHS = job.getCounters();

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java Tue Apr 12 21:15:37 2011
@@ -2,10 +2,14 @@ package org.apache.hadoop.yarn.api;
 
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest;
@@ -18,4 +22,6 @@ public interface ClientRMProtocol {
   public SubmitApplicationResponse submitApplication(SubmitApplicationRequest request) throws YarnRemoteException;
   public FinishApplicationResponse finishApplication(FinishApplicationRequest request) throws YarnRemoteException;
   public GetClusterMetricsResponse getClusterMetrics(GetClusterMetricsRequest request) throws YarnRemoteException;
+  public GetAllApplicationsResponse getAllApplications(GetAllApplicationsRequest request) throws YarnRemoteException;
+  public GetClusterNodesResponse getClusterNodes(GetClusterNodesRequest request) throws YarnRemoteException;
 }

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,4 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface GetAllApplicationsRequest {
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,10 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import java.util.List;
+
+import org.apache.hadoop.yarn.api.records.Application;
+
+public interface GetAllApplicationsResponse {
+  List<Application> getApplicationList();
+  void setApplicationList(List<Application> applications);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface GetClusterNodesRequest {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,10 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import java.util.List;
+
+import org.apache.hadoop.yarn.api.records.NodeManagerInfo;
+
+public interface GetClusterNodesResponse {
+  List<NodeManagerInfo> getNodeManagerList();
+  void setNodeManagerList(List<NodeManagerInfo> nodeManagers);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsRequestPBImpl.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsRequestPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsRequestPBImpl.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,29 @@
+package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
+
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsRequestProto;
+
+public class GetAllApplicationsRequestPBImpl extends
+    ProtoBase<GetAllApplicationsRequestProto> implements GetAllApplicationsRequest {
+  GetAllApplicationsRequestProto proto = GetAllApplicationsRequestProto.getDefaultInstance();
+  GetAllApplicationsRequestProto.Builder builder = null;
+  boolean viaProto = false;
+
+  public GetAllApplicationsRequestPBImpl() {
+    builder = GetAllApplicationsRequestProto.newBuilder();
+  }
+
+  public GetAllApplicationsRequestPBImpl(GetAllApplicationsRequestProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  @Override
+  public GetAllApplicationsRequestProto getProto() {
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsResponsePBImpl.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsResponsePBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetAllApplicationsResponsePBImpl.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,134 @@
+package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
+import org.apache.hadoop.yarn.api.records.Application;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationPBImpl;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProtoOrBuilder;
+
+public class GetAllApplicationsResponsePBImpl 
+extends ProtoBase<GetAllApplicationsResponseProto> implements 
+GetAllApplicationsResponse {
+
+  GetAllApplicationsResponseProto proto = 
+    GetAllApplicationsResponseProto.getDefaultInstance();
+  GetAllApplicationsResponseProto.Builder builder = null;
+  boolean viaProto = false;
+
+  List<Application> applicationList;
+  
+  public GetAllApplicationsResponsePBImpl() {
+    builder = GetAllApplicationsResponseProto.newBuilder();
+  }
+  
+  public GetAllApplicationsResponsePBImpl(GetAllApplicationsResponseProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+
+  @Override
+  public List<Application> getApplicationList() {    
+    initLocalApplicationsList();
+    return this.applicationList;
+  }
+
+  @Override
+  public void setApplicationList(List<Application> applications) {
+    maybeInitBuilder();
+    if (applications == null) 
+      builder.clearApplications();
+    this.applicationList = applications;
+  }
+
+  @Override
+  public GetAllApplicationsResponseProto getProto() {    
+    mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.applicationList != null) {
+      addLocalApplicationsToProto();
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = GetAllApplicationsResponseProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+
+  //Once this is called. containerList will never be null - untill a getProto is called.
+  private void initLocalApplicationsList() {
+    if (this.applicationList != null) {
+      return;
+    }
+    GetAllApplicationsResponseProtoOrBuilder p = viaProto ? proto : builder;
+    List<ApplicationProto> list = p.getApplicationsList();
+    applicationList = new ArrayList<Application>();
+
+    for (ApplicationProto a : list) {
+      applicationList.add(convertFromProtoFormat(a));
+    }
+  }
+
+  private void addLocalApplicationsToProto() {
+    maybeInitBuilder();
+    builder.clearApplications();
+    if (applicationList == null)
+      return;
+    Iterable<ApplicationProto> iterable = new Iterable<ApplicationProto>() {
+      @Override
+      public Iterator<ApplicationProto> iterator() {
+        return new Iterator<ApplicationProto>() {
+
+          Iterator<Application> iter = applicationList.iterator();
+
+          @Override
+          public boolean hasNext() {
+            return iter.hasNext();
+          }
+
+          @Override
+          public ApplicationProto next() {
+            return convertToProtoFormat(iter.next());
+          }
+
+          @Override
+          public void remove() {
+            throw new UnsupportedOperationException();
+
+          }
+        };
+
+      }
+    };
+    builder.addAllApplications(iterable);
+  }
+
+  private ApplicationPBImpl convertFromProtoFormat(ApplicationProto p) {
+    return new ApplicationPBImpl(p);
+  }
+
+  private ApplicationProto convertToProtoFormat(Application t) {
+    return ((ApplicationPBImpl)t).getProto();
+  }
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,30 @@
+package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
+
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesRequestProto;
+
+public class GetClusterNodesRequestPBImpl extends
+    ProtoBase<GetClusterNodesRequestProto> implements GetClusterNodesRequest {
+
+  GetClusterNodesRequestProto proto = GetClusterNodesRequestProto.getDefaultInstance();
+  GetClusterNodesRequestProto.Builder builder = null;
+  boolean viaProto = false;
+
+  public GetClusterNodesRequestPBImpl() {
+    builder = GetClusterNodesRequestProto.newBuilder();
+  }
+
+  public GetClusterNodesRequestPBImpl(GetClusterNodesRequestProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  @Override
+  public GetClusterNodesRequestProto getProto() {
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,135 @@
+package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
+import org.apache.hadoop.yarn.api.records.NodeManagerInfo;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.api.records.impl.pb.NodeManagerInfoPBImpl;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeManagerInfoProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProtoOrBuilder;
+
+public class GetClusterNodesResponsePBImpl extends
+    ProtoBase<GetClusterNodesResponseProto> implements GetClusterNodesResponse {
+
+  GetClusterNodesResponseProto proto = 
+    GetClusterNodesResponseProto.getDefaultInstance();
+  GetClusterNodesResponseProto.Builder builder = null;
+  boolean viaProto = false;
+
+  List<NodeManagerInfo> nodeManagerInfoList;
+  
+  public GetClusterNodesResponsePBImpl() {
+    builder = GetClusterNodesResponseProto.newBuilder();
+  }
+  
+  public GetClusterNodesResponsePBImpl(GetClusterNodesResponseProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+
+  @Override
+  public List<NodeManagerInfo> getNodeManagerList() {    
+    initLocalNodeManagerInfosList();
+    return this.nodeManagerInfoList;
+  }
+  
+  @Override
+  public void setNodeManagerList(List<NodeManagerInfo> nodeManagers) {
+    maybeInitBuilder();
+    if (nodeManagers == null) {
+      builder.clearNodeManagers();
+    }
+    this.nodeManagerInfoList = nodeManagers;
+  
+  }
+
+  @Override
+  public GetClusterNodesResponseProto getProto() {    
+    mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.nodeManagerInfoList != null) {
+      addLocalNodeManagerInfosToProto();
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = GetClusterNodesResponseProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+
+  //Once this is called. containerList will never be null - untill a getProto is called.
+  private void initLocalNodeManagerInfosList() {
+    if (this.nodeManagerInfoList != null) {
+      return;
+    }
+    GetClusterNodesResponseProtoOrBuilder p = viaProto ? proto : builder;
+    List<NodeManagerInfoProto> list = p.getNodeManagersList();
+    nodeManagerInfoList = new ArrayList<NodeManagerInfo>();
+
+    for (NodeManagerInfoProto a : list) {
+      nodeManagerInfoList.add(convertFromProtoFormat(a));
+    }
+  }
+
+  private void addLocalNodeManagerInfosToProto() {
+    maybeInitBuilder();
+    builder.clearNodeManagers();
+    if (nodeManagerInfoList == null)
+      return;
+    Iterable<NodeManagerInfoProto> iterable = new Iterable<NodeManagerInfoProto>() {
+      @Override
+      public Iterator<NodeManagerInfoProto> iterator() {
+        return new Iterator<NodeManagerInfoProto>() {
+
+          Iterator<NodeManagerInfo> iter = nodeManagerInfoList.iterator();
+
+          @Override
+          public boolean hasNext() {
+            return iter.hasNext();
+          }
+
+          @Override
+          public NodeManagerInfoProto next() {
+            return convertToProtoFormat(iter.next());
+          }
+
+          @Override
+          public void remove() {
+            throw new UnsupportedOperationException();
+
+          }
+        };
+
+      }
+    };
+    builder.addAllNodeManagers(iterable);
+  }
+
+  private NodeManagerInfoPBImpl convertFromProtoFormat(NodeManagerInfoProto p) {
+    return new NodeManagerInfoPBImpl(p);
+  }
+
+  private NodeManagerInfoProto convertToProtoFormat(NodeManagerInfo t) {
+    return ((NodeManagerInfoPBImpl)t).getProto();
+  }
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Application.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Application.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Application.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Application.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,20 @@
+package org.apache.hadoop.yarn.api.records;
+
+public interface Application {
+  public ApplicationId getApplicationId();
+  public void setApplicationId(ApplicationId applicationId);
+  public String getUser();
+  public void setUser(String user);
+  public String getQueue();
+  public void setQueue(String queue);
+  public String getName();
+  public void setName(String name);
+  public ApplicationStatus getStatus();
+  public void setStatus(ApplicationStatus status);
+  public ApplicationState getState();
+  public void setState(ApplicationState state);
+  public String getMasterHost();
+  public void setMasterHost(String masterHost);
+  public int getMasterPort();
+  public void setMasterPort(int masterPort);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,14 @@
+package org.apache.hadoop.yarn.api.records;
+
+public interface NodeManagerInfo {
+  String getNodeName();
+  void setNodeName(String nodeName);
+  String getRackName();
+  void setRackName(String rackName);
+  Resource getUsed();        
+  void setUsed(Resource used);
+  Resource getCapability();
+  void setCapability(Resource capability);
+  int getNumContainers();
+  void setNumContainers(int numContainers);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationPBImpl.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationPBImpl.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,253 @@
+package org.apache.hadoop.yarn.api.records.impl.pb;
+
+import org.apache.hadoop.yarn.api.records.Application;
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ApplicationState;
+import org.apache.hadoop.yarn.api.records.ApplicationStatus;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationProtoOrBuilder;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationStateProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationStatusProto;
+import org.apache.hadoop.yarn.util.ProtoUtils;
+
+public class ApplicationPBImpl extends ProtoBase<ApplicationProto> 
+implements Application {
+  ApplicationProto proto = ApplicationProto.getDefaultInstance();
+  ApplicationProto.Builder builder = null;
+  boolean viaProto = false;
+
+  ApplicationId applicationId;
+  ApplicationStatus status;
+
+  public ApplicationPBImpl() {
+    builder = ApplicationProto.newBuilder();
+  }
+  
+  public ApplicationPBImpl(ApplicationProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+
+  @Override
+  public ApplicationId getApplicationId() {
+    if (this.applicationId != null) {
+      return this.applicationId;
+    }
+
+    ApplicationProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasStatus()) {
+      return null;
+    }
+    this.applicationId = convertFromProtoFormat(p.getApplicationId());
+    return this.applicationId;
+  }
+  
+  @Override
+  public String getMasterHost() {
+    ApplicationProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasMasterHost()) {
+      return null;
+    }
+    return (p.getMasterHost());
+  }
+
+  @Override
+  public int getMasterPort() {
+    ApplicationProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasMasterPort()) {
+      return -1;
+    }
+    return p.getMasterPort();
+  }
+
+  @Override
+  public String getName() {
+    ApplicationProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasName()) {
+      return null;
+    }
+    return p.getName();
+  }
+
+  @Override
+  public String getQueue() {
+    ApplicationProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasQueue()) {
+      return null;
+    }
+    return p.getQueue();
+  }
+
+  @Override
+  public ApplicationState getState() {
+    ApplicationProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasState()) {
+      return null;
+    }
+    return convertFromProtoFormat(p.getState());
+  }
+
+  @Override
+  public ApplicationStatus getStatus() {
+    if (this.status != null) {
+      return this.status;
+    }
+
+    ApplicationProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasStatus()) {
+      return null;
+    }
+    this.status = convertFromProtoFormat(p.getStatus());
+    return this.status;
+  }
+
+  @Override
+  public String getUser() {
+    ApplicationProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasUser()) {
+      return null;
+    }
+    return p.getUser();
+  }
+  
+  @Override
+  public void setApplicationId(ApplicationId applicationId) {
+    maybeInitBuilder();
+    if (applicationId == null)
+      builder.clearStatus();
+    this.applicationId = applicationId;
+  }
+
+  @Override
+  public void setMasterHost(String masterHost) {
+    maybeInitBuilder();
+    if (masterHost == null) {
+      builder.clearMasterHost();
+      return;
+    }
+    builder.setMasterHost((masterHost));
+  }
+
+  @Override
+  public void setMasterPort(int masterPort) {
+    maybeInitBuilder();
+    if (masterPort == -1) {
+      builder.clearMasterPort();
+      return;
+    }
+    builder.setMasterPort(masterPort);
+  }
+
+  @Override
+  public void setName(String name) {
+    maybeInitBuilder();
+    if (name == null) {
+      builder.clearName();
+      return;
+    }
+    builder.setName(name);
+  }
+
+  @Override
+  public void setQueue(String queue) {
+    maybeInitBuilder();
+    if (queue == null) {
+      builder.clearQueue();
+      return;
+    }
+    builder.setQueue(queue);
+  }
+
+  @Override
+  public void setState(ApplicationState state) {
+    maybeInitBuilder();
+    if (state == null) {
+      builder.clearState();
+      return;
+    }
+    builder.setState(convertToProtoFormat(state));
+  }
+
+  @Override
+  public void setStatus(ApplicationStatus status) {
+    maybeInitBuilder();
+    if (status == null)
+      builder.clearStatus();
+    this.status = status;
+  }
+
+  @Override
+  public void setUser(String user) {
+    maybeInitBuilder();
+    if (user == null) {
+      builder.clearUser();
+      return;
+    }
+    builder.setUser((user));
+  }
+
+  @Override
+  public ApplicationProto getProto() {
+    mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.applicationId != null
+        && !((ApplicationIdPBImpl) this.applicationId).getProto().equals(
+            builder.getApplicationId())) {
+      builder.setApplicationId(convertToProtoFormat(this.applicationId));
+    }
+    if (this.status != null
+        && !((ApplicationStatusPBImpl) this.status).getProto().equals(
+            builder.getStatus())) {
+      builder.setStatus(convertToProtoFormat(this.status));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto)
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = ApplicationProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+
+  private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
+    return ((ApplicationIdPBImpl) t).getProto();
+  }
+
+  private ApplicationStatusPBImpl convertFromProtoFormat(
+      ApplicationStatusProto p) {
+    return new ApplicationStatusPBImpl(p);
+  }
+
+  private ApplicationStatusProto convertToProtoFormat(ApplicationStatus t) {
+    return ((ApplicationStatusPBImpl) t).getProto();
+  }
+
+  private ApplicationState convertFromProtoFormat(ApplicationStateProto s) {
+    return ProtoUtils.convertFromProtoFormat(s);
+  }
+
+  private ApplicationStateProto convertToProtoFormat(ApplicationState s) {
+    return ProtoUtils.convertToProtoFormat(s);
+  }
+
+  private ApplicationIdPBImpl convertFromProtoFormat(
+      ApplicationIdProto applicationId) {
+    return new ApplicationIdPBImpl(applicationId);
+  }
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java?rev=1091574&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java Tue Apr 12 21:15:37 2011
@@ -0,0 +1,166 @@
+package org.apache.hadoop.yarn.api.records.impl.pb;
+
+import org.apache.hadoop.yarn.api.records.NodeManagerInfo;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeManagerInfoProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeManagerInfoProtoOrBuilder;
+import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto;
+
+public class NodeManagerInfoPBImpl extends ProtoBase<NodeManagerInfoProto>
+    implements NodeManagerInfo {
+
+  NodeManagerInfoProto proto = NodeManagerInfoProto.getDefaultInstance();
+  NodeManagerInfoProto.Builder builder = null;
+  boolean viaProto = false;
+
+  Resource used;
+  Resource capability;
+  
+  public NodeManagerInfoPBImpl() {
+    builder = NodeManagerInfoProto.newBuilder();
+  }
+  
+  public NodeManagerInfoPBImpl(NodeManagerInfoProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+
+  @Override
+  public Resource getCapability() {
+    if (this.capability != null) {
+      return this.capability;
+    }
+
+    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasCapability()) {
+      return null;
+    }
+    this.capability = convertFromProtoFormat(p.getCapability());
+    return this.capability;
+  }
+
+  @Override
+  public String getNodeName() {
+    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.hasNodeName()) ? p.getNodeName() : null;
+  }
+
+  @Override
+  public int getNumContainers() {
+    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.hasNumContainers()) ? p.getNumContainers() : 0;
+  }
+
+  @Override
+  public String getRackName() {
+    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.hasRackName()) ? p.getRackName() : null;
+  }
+
+  @Override
+  public Resource getUsed() {
+    if (this.used != null) {
+      return this.used;
+    }
+
+    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasUsed()) {
+      return null;
+    }
+    this.used = convertFromProtoFormat(p.getUsed());
+    return this.used;
+  }
+
+  @Override
+  public void setCapability(Resource capability) {
+    maybeInitBuilder();
+    if (capability == null)
+      builder.clearCapability();
+    this.capability = capability;
+  }
+
+  @Override
+  public void setNodeName(String nodeName) {
+    maybeInitBuilder();
+    if (nodeName == null) {
+      builder.clearNodeName();
+      return;
+    }
+    builder.setNodeName(nodeName);
+  }
+
+  @Override
+  public void setNumContainers(int numContainers) {
+    maybeInitBuilder();
+    if (numContainers == 0) {
+      builder.clearNumContainers();
+      return;
+    }
+    builder.setNumContainers(numContainers);
+  }
+
+  @Override
+  public void setRackName(String rackName) {
+    maybeInitBuilder();
+    if (rackName == null) {
+      builder.clearRackName();
+      return;
+    }
+    builder.setRackName(rackName);
+  }
+
+  @Override
+  public void setUsed(Resource used) {
+    maybeInitBuilder();
+    if (used == null)
+      builder.clearUsed();
+    this.used = used;
+  }
+
+  @Override
+  public NodeManagerInfoProto getProto() {
+    mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.used != null
+        && !((ResourcePBImpl) this.used).getProto().equals(
+            builder.getUsed())) {
+      builder.setUsed(convertToProtoFormat(this.used));
+    }
+    if (this.capability != null
+        && !((ResourcePBImpl) this.capability).getProto().equals(
+            builder.getCapability())) {
+      builder.setCapability(convertToProtoFormat(this.used));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto)
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = NodeManagerInfoProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+
+
+  private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
+    return new ResourcePBImpl(p);
+  }
+
+  private ResourceProto convertToProtoFormat(Resource r) {
+    return ((ResourcePBImpl) r).getProto();
+  }
+
+}

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/client_RM_protocol.proto
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/client_RM_protocol.proto?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/client_RM_protocol.proto (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/client_RM_protocol.proto Tue Apr 12 21:15:37 2011
@@ -16,5 +16,7 @@ service ClientRMProtocolService {
   rpc submitApplication (SubmitApplicationRequestProto) returns (SubmitApplicationResponseProto);
   rpc finishApplication (FinishApplicationRequestProto) returns (FinishApplicationResponseProto);
   rpc getClusterMetrics (GetClusterMetricsRequestProto) returns (GetClusterMetricsResponseProto);
+  rpc getAllApplications (GetAllApplicationsRequestProto) returns (GetAllApplicationsResponseProto);
+  rpc getClusterNodes (GetClusterNodesRequestProto) returns (GetClusterNodesResponseProto);
 }
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto Tue Apr 12 21:15:37 2011
@@ -103,7 +103,24 @@ message LocalResourceProto {
   optional LocalResourceVisibilityProto visibility= 5;
 }
 
+message ApplicationProto {
+  optional ApplicationIdProto applicationId = 1;
+  optional string user = 2;
+  optional string queue = 3;
+  optional string name = 4;
+  optional ApplicationStatusProto status = 5;
+  optional ApplicationStateProto state = 6;
+  optional string masterHost = 7;
+  optional int32 masterPort = 8;
+}
 
+message NodeManagerInfoProto {
+  optional string nodeName = 1;
+  optional string rackName = 2;
+  optional ResourceProto used = 3;
+  optional ResourceProto capability = 4;
+  optional int32 numContainers = 5;
+}
 
 
 ////////////////////////////////////////////////////////////////////////

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_service_protos.proto
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_service_protos.proto?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_service_protos.proto (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_service_protos.proto Tue Apr 12 21:15:37 2011
@@ -74,6 +74,19 @@ message GetClusterMetricsResponseProto {
   optional YarnClusterMetricsProto cluster_metrics = 1;
 }
 
+message GetAllApplicationsRequestProto {
+}
+
+message GetAllApplicationsResponseProto {
+  repeated ApplicationProto applications = 1;
+}
+
+message GetClusterNodesRequestProto {
+}
+
+message GetClusterNodesResponseProto {
+  repeated NodeManagerInfoProto nodeManagers = 1; 
+}
 
 
 //////////////////////////////////////////////////////

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/client/ClientRMProtocolPBClientImpl.java Tue Apr 12 21:15:37 2011
@@ -9,20 +9,28 @@ import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.yarn.api.ClientRMProtocol;
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.FinishApplicationRequestPBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.FinishApplicationResponsePBImpl;
+import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetAllApplicationsRequestPBImpl;
+import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetAllApplicationsResponsePBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetApplicationMasterRequestPBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetApplicationMasterResponsePBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterMetricsRequestPBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterMetricsResponsePBImpl;
+import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterNodesRequestPBImpl;
+import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterNodesResponsePBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetNewApplicationIdRequestPBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetNewApplicationIdResponsePBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.SubmitApplicationRequestPBImpl;
@@ -31,8 +39,10 @@ import org.apache.hadoop.yarn.exceptions
 import org.apache.hadoop.yarn.ipc.ProtoOverHadoopRpcEngine;
 import org.apache.hadoop.yarn.proto.ClientRMProtocol.ClientRMProtocolService;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationRequestProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationMasterRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterMetricsRequestProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationIdRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.SubmitApplicationRequestProto;
 
@@ -133,4 +143,42 @@ public class ClientRMProtocolPBClientImp
     }
   }
 
+  @Override
+  public GetAllApplicationsResponse getAllApplications(
+      GetAllApplicationsRequest request) throws YarnRemoteException {
+    GetAllApplicationsRequestProto requestProto = 
+      ((GetAllApplicationsRequestPBImpl)request).getProto();
+    try {
+      return new GetAllApplicationsResponsePBImpl(
+          proxy.getAllApplications(null, requestProto));
+    } catch (ServiceException e) {
+      if (e.getCause() instanceof YarnRemoteException) {
+        throw (YarnRemoteException)e.getCause();
+      } else if (e.getCause() instanceof UndeclaredThrowableException) {
+        throw (UndeclaredThrowableException)e.getCause();
+      } else {
+        throw new UndeclaredThrowableException(e);
+      }
+    }
+  }
+
+  @Override
+  public GetClusterNodesResponse getClusterNodes(
+      GetClusterNodesRequest request) throws YarnRemoteException {
+    GetClusterNodesRequestProto requestProto =
+      ((GetClusterNodesRequestPBImpl)request).getProto();
+    try {
+      return new GetClusterNodesResponsePBImpl(
+          proxy.getClusterNodes(null, requestProto));
+    } catch (ServiceException e) {
+      if (e.getCause() instanceof YarnRemoteException) {
+        throw (YarnRemoteException)e.getCause();
+      } else if (e.getCause() instanceof UndeclaredThrowableException) {
+        throw (UndeclaredThrowableException)e.getCause();
+      } else {
+        throw new UndeclaredThrowableException(e);
+      }
+    }
+  }
+
 }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ClientRMProtocolPBServiceImpl.java Tue Apr 12 21:15:37 2011
@@ -2,16 +2,22 @@ package org.apache.hadoop.yarn.api.impl.
 
 import org.apache.hadoop.yarn.api.ClientRMProtocol;
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.FinishApplicationRequestPBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.FinishApplicationResponsePBImpl;
+import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetAllApplicationsRequestPBImpl;
+import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetAllApplicationsResponsePBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetApplicationMasterRequestPBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetApplicationMasterResponsePBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterMetricsRequestPBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterMetricsResponsePBImpl;
+import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterNodesRequestPBImpl;
+import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterNodesResponsePBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetNewApplicationIdRequestPBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetNewApplicationIdResponsePBImpl;
 import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.SubmitApplicationRequestPBImpl;
@@ -20,10 +26,14 @@ import org.apache.hadoop.yarn.exceptions
 import org.apache.hadoop.yarn.proto.ClientRMProtocol.ClientRMProtocolService.BlockingInterface;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationResponseProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsRequestProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationMasterRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationMasterResponseProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterMetricsRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterMetricsResponseProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesRequestProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationIdRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationIdResponseProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.SubmitApplicationRequestProto;
@@ -102,4 +112,31 @@ public class ClientRMProtocolPBServiceIm
     }
   }
 
+  @Override
+  public GetAllApplicationsResponseProto getAllApplications(
+      RpcController controller, GetAllApplicationsRequestProto proto)
+      throws ServiceException {
+    GetAllApplicationsRequestPBImpl request =
+      new GetAllApplicationsRequestPBImpl(proto);
+    try {
+      GetAllApplicationsResponse response = real.getAllApplications(request);
+      return ((GetAllApplicationsResponsePBImpl)response).getProto();
+    } catch (YarnRemoteException e) {
+      throw new ServiceException(e);
+    }
+  }
+
+  @Override
+  public GetClusterNodesResponseProto getClusterNodes(RpcController controller,
+      GetClusterNodesRequestProto proto) throws ServiceException {
+    GetClusterNodesRequestPBImpl request =
+      new GetClusterNodesRequestPBImpl(proto);
+    try {
+      GetClusterNodesResponse response = real.getClusterNodes(request);
+      return ((GetClusterNodesResponsePBImpl)response).getProto();
+    } catch (YarnRemoteException e) {
+      throw new ServiceException(e);
+    }
+  }
+
 }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java Tue Apr 12 21:15:37 2011
@@ -24,7 +24,7 @@ import com.google.common.collect.Lists;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.hadoop.yarn.Application;
+import org.apache.hadoop.yarn.api.records.Application;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationState;
 import org.apache.hadoop.yarn.api.records.ApplicationStatus;
@@ -80,23 +80,55 @@ public class MockApps {
     final String name = newAppName();
     final String queue = newQueue();
     return new Application() {
-      @Override public ApplicationId id() { return id; }
-      @Override public CharSequence user() { return user; }
-      @Override public CharSequence name() { return name; }
-      @Override public ApplicationStatus status() { return status; }
-      @Override public ApplicationState state() { return state; }
-      @Override public CharSequence queue() { return queue; }
-      @Override public CharSequence master() {
+      @Override public ApplicationId getApplicationId() { return id; }
+      @Override public String getUser() { return user; }
+      @Override public String getName() { return name; }
+      @Override public ApplicationStatus getStatus() { return status; }
+      @Override public ApplicationState getState() { return state; }
+      @Override public String getQueue() { return queue; }
+      @Override public String getMasterHost() {
         return Math.random() > 0.8 ? null : "localhost";
       }
-      @Override public int httpPort() { return 58888; }
-      @Override public boolean isFinished() {
-        switch (state) {
-          case COMPLETED:
-          case FAILED:
-          case KILLED: return true;
-        }
-        return false;
+      @Override public int getMasterPort() { return 58888; }
+      @Override
+      public void setApplicationId(ApplicationId applicationId) {
+        // TODO Auto-generated method stub
+        
+      }
+      @Override
+      public void setMasterHost(String masterHost) {
+        // TODO Auto-generated method stub
+        
+      }
+      @Override
+      public void setMasterPort(int masterPort) {
+        // TODO Auto-generated method stub
+        
+      }
+      @Override
+      public void setName(String name) {
+        // TODO Auto-generated method stub
+        
+      }
+      @Override
+      public void setQueue(String queue) {
+        // TODO Auto-generated method stub
+        
+      }
+      @Override
+      public void setState(ApplicationState state) {
+        // TODO Auto-generated method stub
+        
+      }
+      @Override
+      public void setStatus(ApplicationStatus status) {
+        // TODO Auto-generated method stub
+        
+      }
+      @Override
+      public void setUser(String user) {
+        // TODO Auto-generated method stub
+        
       }
     };
   }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java Tue Apr 12 21:15:37 2011
@@ -20,6 +20,8 @@ package org.apache.hadoop.yarn.server.re
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.avro.ipc.Server;
 import org.apache.commons.logging.Log;
@@ -31,16 +33,21 @@ import org.apache.hadoop.security.Securi
 import org.apache.hadoop.yarn.api.ClientRMProtocol;
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationMasterResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
+import org.apache.hadoop.yarn.api.records.NodeManagerInfo;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
 import org.apache.hadoop.yarn.factories.RecordFactory;
@@ -49,9 +56,11 @@ import org.apache.hadoop.yarn.ipc.RPCUti
 import org.apache.hadoop.yarn.ipc.YarnRPC;
 import org.apache.hadoop.yarn.security.client.ClientRMSecurityInfo;
 import org.apache.hadoop.yarn.server.resourcemanager.applicationsmanager.ApplicationsManager;
+import org.apache.hadoop.yarn.server.resourcemanager.resourcetracker.NodeInfo;
 import org.apache.hadoop.yarn.server.resourcemanager.resourcetracker.ResourceContext;
 import org.apache.hadoop.yarn.service.AbstractService;
 
+
 /**
  * The client interface to the Resource Manager. This module handles all the rpc
  * interfaces to the resource manager from the client.
@@ -146,6 +155,41 @@ public class ClientRMService extends Abs
   }
   
   @Override
+  public GetAllApplicationsResponse getAllApplications(
+      GetAllApplicationsRequest request) throws YarnRemoteException {
+    GetAllApplicationsResponse response = 
+      recordFactory.newRecordInstance(GetAllApplicationsResponse.class);
+    response.setApplicationList(applicationsManager.getApplications());
+    return response;
+  }
+
+  @Override
+  public GetClusterNodesResponse getClusterNodes(GetClusterNodesRequest request)
+      throws YarnRemoteException {
+    GetClusterNodesResponse response = 
+      recordFactory.newRecordInstance(GetClusterNodesResponse.class);
+    List<NodeInfo> nodeInfos = clusterInfo.getAllNodeInfo();
+    List<NodeManagerInfo> nodes = 
+      new ArrayList<NodeManagerInfo>(nodeInfos.size());
+    for (NodeInfo nodeInfo : nodeInfos) {
+      nodes.add(createNodeManagerInfo(nodeInfo));
+    }
+    response.setNodeManagerList(nodes);
+    return response;
+  }
+
+  private NodeManagerInfo createNodeManagerInfo(NodeInfo nodeInfo) {
+    NodeManagerInfo node = 
+      recordFactory.newRecordInstance(NodeManagerInfo.class);
+    node.setNodeName(nodeInfo.getHostName());
+    node.setRackName(nodeInfo.getRackName());
+    node.setCapability(nodeInfo.getTotalCapability());
+    node.setUsed(nodeInfo.getUsedResource());
+    node.setNumContainers(nodeInfo.getNumContainers());
+    return node;
+  }
+
+  @Override
   public void stop() {
     if (this.server != null) {
         this.server.close();

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManager.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManager.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManager.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManager.java Tue Apr 12 21:15:37 2011
@@ -23,7 +23,7 @@ import java.util.List;
 
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 import org.apache.hadoop.classification.InterfaceStability.Evolving;
-import org.apache.hadoop.yarn.Application;
+import org.apache.hadoop.yarn.api.records.Application;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationMaster;
 import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManagerImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManagerImpl.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManagerImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManagerImpl.java Tue Apr 12 21:15:37 2011
@@ -28,13 +28,16 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.token.Token;
-import org.apache.hadoop.yarn.Application;
+import org.apache.hadoop.yarn.api.records.Application;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationMaster;
 import org.apache.hadoop.yarn.api.records.ApplicationState;
 import org.apache.hadoop.yarn.api.records.ApplicationStatus;
 import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
+import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
 import org.apache.hadoop.yarn.event.EventHandler;
+import org.apache.hadoop.yarn.factories.RecordFactory;
+import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
 import org.apache.hadoop.yarn.security.ApplicationTokenIdentifier;
 import org.apache.hadoop.yarn.security.ApplicationTokenSecretManager;
 import org.apache.hadoop.yarn.security.client.ClientToAMSecretManager;
@@ -69,6 +72,9 @@ public class ApplicationsManagerImpl ext
   private final ApplicationTokenSecretManager applicationTokenSecretManager;
   private final ASMContext asmContext; 
   
+  private final RecordFactory recordFactory = 
+    RecordFactoryProvider.getRecordFactory(null);
+
   public ApplicationsManagerImpl(ApplicationTokenSecretManager 
       applicationTokenSecretManager, YarnScheduler scheduler, ASMContext asmContext) {
     super("ApplicationsManager");
@@ -215,42 +221,26 @@ public class ApplicationsManagerImpl ext
     return amTracker.get(applicationId);
   }
   
-  static class AppImpl implements Application {
-    final ApplicationMaster am;
-    final String user;
-    final String queue;
-    final String name;
-    
-    AppImpl(ApplicationMaster am, String user, String queue, String name) { 
-      this.am = am; 
-      this.user = user;
-      this.queue = queue;
-      this.name = name;
-    }
-
-    @Override public ApplicationId id() { return am.getApplicationId(); }
-    @Override public String user() { return user; }
-    @Override public String name() { return name; }
-    @Override public String queue() { return queue; }
-    @Override public ApplicationStatus status() { return am.getStatus(); }
-    @Override public String master() { return am.getHost(); }
-    @Override public int httpPort() { return am.getHttpPort(); }
-    @Override public ApplicationState state() { return am.getState(); }
-    @Override public boolean isFinished() {
-      switch (am.getState()) {
-        case COMPLETED:
-        case FAILED:
-        case KILLED: return true;
-      }
-      return false;
-    }
+  private Application createApplication(ApplicationMaster am, String user,
+      String queue, String name) {
+    Application application = 
+      recordFactory.newRecordInstance(Application.class);
+    application.setApplicationId(am.getApplicationId());
+    application.setMasterHost(am.getHost());
+    application.setMasterPort(am.getHttpPort());
+    application.setName(name);
+    application.setQueue(queue);
+    application.setState(am.getState());
+    application.setStatus(am.getStatus());
+    application.setUser(user);
+    return application;
   }
-
+  
   @Override
   public List<Application> getApplications() {
     List<Application> apps = new ArrayList<Application>();
     for (AppContext am: getAllApplications()) {
-      apps.add(new AppImpl(am.getMaster(), 
+      apps.add(createApplication(am.getMaster(), 
           am.getUser(), am.getQueue(), am.getName()));
     }
     return apps;
@@ -260,7 +250,7 @@ public class ApplicationsManagerImpl ext
   public Application getApplication(ApplicationId appID) {
     ApplicationMasterInfo master = amTracker.get(appID);
     return (master == null) ? null : 
-      new AppImpl(master.getMaster(), 
+      createApplication(master.getMaster(), 
           master.getUser(), master.getQueue(), master.getName());
   }
 }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java?rev=1091574&r1=1091573&r2=1091574&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java Tue Apr 12 21:15:37 2011
@@ -20,7 +20,7 @@ package org.apache.hadoop.yarn.server.re
 
 import com.google.inject.Inject;
 
-import org.apache.hadoop.yarn.Application;
+import org.apache.hadoop.yarn.api.records.Application;
 import org.apache.hadoop.yarn.util.Apps;
 import org.apache.hadoop.yarn.webapp.hamlet.Hamlet;
 import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.*;
@@ -52,20 +52,20 @@ class AppsBlock extends HtmlBlock {
         tbody();
     int i = 0;
     for (Application app : list.apps) {
-      String appId = Apps.toString(app.id());
-      CharSequence master = app.master();
+      String appId = Apps.toString(app.getApplicationId());
+      CharSequence master = app.getMasterHost();
       String am = master == null ? "UNASSIGNED"
-                                 : join(master, ':', app.httpPort());
-      String percent = String.format("%.1f", app.status().getProgress() * 100);
+                                 : join(master, ':', app.getMasterPort());
+      String percent = String.format("%.1f", app.getStatus().getProgress() * 100);
       tbody.
         tr().
           td().
-            br().$title(String.valueOf(app.id().getId()))._(). // for sorting
+            br().$title(String.valueOf(app.getApplicationId().getId()))._(). // for sorting
             a(url("app", appId), appId)._().
-          td(app.user().toString()).
-          td(app.name().toString()).
-          td(app.queue().toString()).
-          td(app.state().toString()).
+          td(app.getUser().toString()).
+          td(app.getName().toString()).
+          td(app.getQueue().toString()).
+          td(app.getState().toString()).
           td().
             br().$title(percent)._(). // for sorting
             div(_PROGRESSBAR).



Mime
View raw message