hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r1087462 [9/20] - in /hadoop/mapreduce/branches/MR-279: ./ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapred/ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/ mr-client/h...
Date Thu, 31 Mar 2011 22:23:34 GMT
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=1087462&r1=1087461&r2=1087462&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 Thu Mar 31 22:23:22 2011
@@ -21,7 +21,6 @@ package org.apache.hadoop.mapred;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 
-import org.apache.avro.ipc.AvroRemoteException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -42,16 +41,26 @@ import org.apache.hadoop.mapreduce.secur
 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.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.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.YarnClusterMetrics;
 import org.apache.hadoop.yarn.conf.YARNApplicationConstants;
 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;
 import org.apache.hadoop.yarn.ipc.YarnRPC;
 import org.apache.hadoop.yarn.security.client.ClientRMSecurityInfo;
-import org.apache.hadoop.yarn.ApplicationID;
-import org.apache.hadoop.yarn.ApplicationMaster;
-import org.apache.hadoop.yarn.ApplicationState;
-import org.apache.hadoop.yarn.ApplicationSubmissionContext;
-import org.apache.hadoop.yarn.ClientRMProtocol;
-import org.apache.hadoop.yarn.YarnClusterMetrics;
+
 
 // TODO: This should be part of something like yarn-client.
 public class ResourceMgrDelegate {
@@ -59,7 +68,8 @@ public class ResourceMgrDelegate {
       
   private Configuration conf;
   ClientRMProtocol applicationsManager;
-  private ApplicationID applicationId;
+  private ApplicationId applicationId;
+  private final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
 
   public ResourceMgrDelegate(Configuration conf) throws UnsupportedFileSystemException {
     this.conf = conf;
@@ -110,10 +120,12 @@ public class ResourceMgrDelegate {
 
   public ClusterMetrics getClusterMetrics() throws IOException,
       InterruptedException {
-    YarnClusterMetrics metrics = applicationsManager.getClusterMetrics();
+    GetClusterMetricsRequest request = recordFactory.newRecordInstance(GetClusterMetricsRequest.class);
+    GetClusterMetricsResponse response = applicationsManager.getClusterMetrics(request);
+    YarnClusterMetrics metrics = response.getClusterMetrics();
     ClusterMetrics oldMetrics = new ClusterMetrics(1, 1, 1, 1, 1, 1, 
-        metrics.numNodeManagers * 10, metrics.numNodeManagers * 2, 1,
-        metrics.numNodeManagers, 0, 0);
+        metrics.getNumNodeManagers() * 10, metrics.getNumNodeManagers() * 2, 1,
+        metrics.getNumNodeManagers(), 0, 0);
     return oldMetrics;
   }
 
@@ -129,7 +141,8 @@ public class ResourceMgrDelegate {
   }
 
   public JobID getNewJobID() throws IOException, InterruptedException {
-    applicationId = applicationsManager.getNewApplicationId();
+    GetNewApplicationIdRequest request = recordFactory.newRecordInstance(GetNewApplicationIdRequest.class);
+    applicationId = applicationsManager.getNewApplicationId(request).getApplicationId();
     return TypeConverter.fromYarn(applicationId);
   }
 
@@ -193,23 +206,27 @@ public class ResourceMgrDelegate {
   }
   
   
-  public ApplicationID submitApplication(ApplicationSubmissionContext appContext) 
+  public ApplicationId submitApplication(ApplicationSubmissionContext appContext) 
   throws IOException {
-    appContext.applicationId = applicationId;
-    applicationsManager.submitApplication(appContext);
+    appContext.setApplicationId(applicationId);
+    SubmitApplicationRequest request = recordFactory.newRecordInstance(SubmitApplicationRequest.class);
+    request.setApplicationSubmissionContext(appContext);
+    applicationsManager.submitApplication(request);
     LOG.info("Submitted application " + applicationId + " to ResourceManager");
     return applicationId;
   }
 
-  public ApplicationMaster getApplicationMaster(ApplicationID appId) 
-    throws AvroRemoteException {
-    ApplicationMaster appMaster = 
-      applicationsManager.getApplicationMaster(appId);
-    while (appMaster.state != ApplicationState.RUNNING &&
-        appMaster.state != ApplicationState.KILLED && 
-        appMaster.state != ApplicationState.FAILED && 
-        appMaster.state != ApplicationState.COMPLETED) {
-      appMaster = applicationsManager.getApplicationMaster(appId);
+  public ApplicationMaster getApplicationMaster(ApplicationId appId) 
+    throws YarnRemoteException {
+    GetApplicationMasterRequest request = recordFactory.newRecordInstance(GetApplicationMasterRequest.class);
+    request.setApplicationId(appId);
+    GetApplicationMasterResponse response = applicationsManager.getApplicationMaster(request);
+    ApplicationMaster appMaster = response.getApplicationMaster(); 
+    while (appMaster.getState() != ApplicationState.RUNNING &&
+        appMaster.getState() != ApplicationState.KILLED && 
+        appMaster.getState() != ApplicationState.FAILED && 
+        appMaster.getState() != ApplicationState.COMPLETED) {
+      appMaster = applicationsManager.getApplicationMaster(request).getApplicationMaster();
       try {
         LOG.info("Waiting for appMaster to start..");
         Thread.sleep(2000);
@@ -220,7 +237,7 @@ public class ResourceMgrDelegate {
     return appMaster;
   }
 
-  public ApplicationID getApplicationId() {
+  public ApplicationId getApplicationId() {
     return applicationId;
   }
 }

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=1087462&r1=1087461&r2=1087462&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 Thu Mar 31 22:23:22 2011
@@ -27,7 +27,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Vector;
 
-import org.apache.avro.ipc.AvroRemoteException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -62,18 +61,23 @@ import org.apache.hadoop.security.author
 import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.security.token.TokenIdentifier;
 import org.apache.hadoop.yarn.YarnException;
+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.LocalResource;
+import org.apache.hadoop.yarn.api.records.LocalResourceType;
+import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
+import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.hadoop.yarn.api.records.URL;
 import org.apache.hadoop.yarn.conf.YARNApplicationConstants;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
-import org.apache.hadoop.yarn.util.AvroUtil;
-import org.apache.hadoop.yarn.ApplicationID;
-import org.apache.hadoop.yarn.ApplicationMaster;
-import org.apache.hadoop.yarn.ApplicationState;
-import org.apache.hadoop.yarn.ApplicationSubmissionContext;
-import org.apache.hadoop.yarn.LocalResource;
-import org.apache.hadoop.yarn.LocalResourceType;
-import org.apache.hadoop.yarn.LocalResourceVisibility;
-import org.apache.hadoop.yarn.Resource;
-import org.apache.hadoop.yarn.URL;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
+import org.apache.hadoop.yarn.factories.RecordFactory;
+import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
+import org.apache.hadoop.yarn.ipc.RPCUtil;
+import org.apache.hadoop.yarn.util.ConverterUtils;
+
 
 /**
  * This class enables the current JobClient (0.22 hadoop) to run on YARN.
@@ -85,6 +89,7 @@ public class YARNRunner implements Clien
   public static final String YARN_AM_RESOURCE_KEY = "yarn.am.mapreduce.resource.mb";
   private static final int DEFAULT_YARN_AM_RESOURCE = 1024;
   
+  private final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
   private ResourceMgrDelegate resMgrDelegate;
   private ClientServiceDelegate clientServiceDelegate;
   private YarnConfiguration conf;
@@ -95,7 +100,7 @@ public class YARNRunner implements Clien
    * @param conf the configuration object for the client
    */
   public YARNRunner(Configuration conf)
-      throws AvroRemoteException {
+      throws YarnRemoteException {
     this.conf = new YarnConfiguration(conf);
     try {
       this.resMgrDelegate = new ResourceMgrDelegate(conf);
@@ -227,90 +232,86 @@ public class YARNRunner implements Clien
     // ---
     
     // Submit to ResourceManager
-    ApplicationID applicationId = resMgrDelegate.submitApplication(appContext);
+    ApplicationId applicationId = resMgrDelegate.submitApplication(appContext);
     
     ApplicationMaster appMaster = 
       resMgrDelegate.getApplicationMaster(applicationId);
-    if (appMaster.state == ApplicationState.FAILED || appMaster.state ==
+    if (appMaster.getState() == ApplicationState.FAILED || appMaster.getState() ==
       ApplicationState.KILLED) {
-      throw new AvroRemoteException("failed to run job");
+      throw RPCUtil.getRemoteException("failed to run job");
     }
     return clientServiceDelegate.getJobStatus(jobId);
   }
 
   private LocalResource createApplicationResource(FileContext fs, Path p)
       throws IOException {
-    LocalResource rsrc = new LocalResource();
+    LocalResource rsrc = recordFactory.newRecordInstance(LocalResource.class);
     FileStatus rsrcStat = fs.getFileStatus(p);
-    rsrc.resource = AvroUtil.getYarnUrlFromPath(rsrcStat.getPath());
-    rsrc.size = rsrcStat.getLen();
-    rsrc.timestamp = rsrcStat.getModificationTime();
-    rsrc.type = LocalResourceType.FILE;
-    rsrc.state = LocalResourceVisibility.APPLICATION;
+    rsrc.setResource(ConverterUtils.getYarnUrlFromPath(rsrcStat.getPath()));
+    rsrc.setSize(rsrcStat.getLen());
+    rsrc.setTimestamp(rsrcStat.getModificationTime());
+    rsrc.setType(LocalResourceType.FILE);
+    rsrc.setVisibility(LocalResourceVisibility.APPLICATION);
     return rsrc;
   }
 
   private ApplicationSubmissionContext getApplicationSubmissionContext(
       Configuration jobConf,
       String jobSubmitDir, Credentials ts) throws IOException {
-    ApplicationSubmissionContext appContext =
-        new ApplicationSubmissionContext();
-    ApplicationID applicationId = resMgrDelegate.getApplicationId();
-    appContext.applicationId = applicationId;
-    Resource capability = new Resource();
-    capability.memory =
-        conf.getInt(YARN_AM_RESOURCE_KEY, DEFAULT_YARN_AM_RESOURCE);
+    ApplicationSubmissionContext appContext = recordFactory.newRecordInstance(ApplicationSubmissionContext.class);
+    ApplicationId applicationId = resMgrDelegate.getApplicationId();
+    appContext.setApplicationId(applicationId);
+    Resource capability = recordFactory.newRecordInstance(Resource.class);
+    capability.setMemory(conf.getInt(YARN_AM_RESOURCE_KEY, DEFAULT_YARN_AM_RESOURCE));
     LOG.info("Master capability = " + capability);
-    appContext.masterCapability = capability;
+    appContext.setMasterCapability(capability);
 
     FileContext defaultFS = FileContext.getFileContext(conf);
     Path jobConfPath = new Path(jobSubmitDir, YARNApplicationConstants.JOB_CONF_FILE);
     
     URL yarnUrlForJobSubmitDir =
-        AvroUtil.getYarnUrlFromPath(defaultFS.makeQualified(new Path(
+        ConverterUtils.getYarnUrlFromPath(defaultFS.makeQualified(new Path(
             jobSubmitDir)));
-    appContext.resources = new HashMap<CharSequence, URL>();
+//    appContext.resources = new HashMap<CharSequence, URL>();
     LOG.debug("Creating setup context, jobSubmitDir url is "
         + yarnUrlForJobSubmitDir);
 
-    appContext.resources.put(YARNApplicationConstants.JOB_SUBMIT_DIR,
+    appContext.setResource(YARNApplicationConstants.JOB_SUBMIT_DIR,
         yarnUrlForJobSubmitDir);
 
-    appContext.resources_todo = new HashMap<CharSequence,LocalResource>();
-    appContext.resources_todo.put(YARNApplicationConstants.JOB_CONF_FILE,
-          createApplicationResource(defaultFS,
-          jobConfPath));
-    appContext.resources_todo.put(YARNApplicationConstants.JOB_JAR,
+//    appContext.resources_todo = new HashMap<CharSequence,LocalResource>();
+    appContext.setResourceTodo(YARNApplicationConstants.JOB_CONF_FILE,
+        createApplicationResource(defaultFS,
+            jobConfPath));
+    appContext.setResourceTodo(YARNApplicationConstants.JOB_JAR,
           createApplicationResource(defaultFS,
             new Path(jobSubmitDir, YARNApplicationConstants.JOB_JAR)));
+    
     // TODO gross hack
     for (String s : new String[] { "job.split", "job.splitmetainfo",
         YarnConfiguration.APPLICATION_TOKENS_FILE }) {
-      appContext.resources_todo.put(
-          YARNApplicationConstants.JOB_SUBMIT_DIR + "/" + s,
+      appContext.setResourceTodo(YARNApplicationConstants.JOB_SUBMIT_DIR + "/" + s,
           createApplicationResource(defaultFS,
-            new Path(jobSubmitDir, s)));
+              new Path(jobSubmitDir, s)));
     }
 
     // TODO: Only if security is on.
-    List<CharSequence> fsTokens = new ArrayList<CharSequence>();
+    List<String> fsTokens = new ArrayList<String>();
     for (Token<? extends TokenIdentifier> token : ts.getAllTokens()) {
       fsTokens.add(token.encodeToUrlString());
     }
     
     // TODO - Remove this!
-    appContext.fsTokens = fsTokens;
+    appContext.addAllFsTokens(fsTokens);
     DataOutputBuffer dob = new DataOutputBuffer();
     ts.writeTokenStorageToStream(dob);
-    appContext.fsTokens_todo =
-      ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
+    appContext.setFsTokensTodo(ByteBuffer.wrap(dob.getData(), 0, dob.getLength()));
 
     // Add queue information
-    appContext.queue = 
-      jobConf.get(JobContext.QUEUE_NAME, JobConf.DEFAULT_QUEUE_NAME);
+    appContext.setQueue(jobConf.get(JobContext.QUEUE_NAME, JobConf.DEFAULT_QUEUE_NAME));
     
     // Add job name
-    appContext.applicationName = jobConf.get(JobContext.JOB_NAME, "N/A");
+    appContext.setApplicationName(jobConf.get(JobContext.JOB_NAME, "N/A"));
     
     // Add the command line
     String javaHome = "$JAVA_HOME";
@@ -320,19 +321,21 @@ public class YARNRunner implements Clien
         "-Dhadoop.root.logger=DEBUG,console -Xmx1024m"));
 
     // Add { job jar, MR app jar } to classpath.
-    appContext.environment = new HashMap<CharSequence, CharSequence>();
-    MRApps.setInitialClasspath(appContext.environment);
-    MRApps.addToClassPath(appContext.environment,
+    Map<String, String> environment = new HashMap<String, String>();
+//    appContext.environment = new HashMap<CharSequence, CharSequence>();
+    MRApps.setInitialClasspath(environment);
+    MRApps.addToClassPath(environment,
         YARNApplicationConstants.JOB_JAR);
-    MRApps.addToClassPath(appContext.environment,
+    MRApps.addToClassPath(environment,
         YARNApplicationConstants.YARN_MAPREDUCE_APP_JAR_PATH);
+    appContext.addAllEnvironment(environment);
     vargs.add("org.apache.hadoop.mapreduce.v2.app.MRAppMaster");
-    vargs.add(String.valueOf(applicationId.clusterTimeStamp));
-    vargs.add(String.valueOf(applicationId.id));
+    vargs.add(String.valueOf(applicationId.getClusterTimestamp()));
+    vargs.add(String.valueOf(applicationId.getId()));
     vargs.add("1>logs/stderr");
     vargs.add("2>logs/stdout");
 
-    Vector<CharSequence> vargsFinal = new Vector<CharSequence>(8);
+    Vector<String> vargsFinal = new Vector<String>(8);
     // Final commmand
     StringBuilder mergedCommand = new StringBuilder();
     for (CharSequence str : vargs) {
@@ -343,9 +346,9 @@ public class YARNRunner implements Clien
     LOG.info("Command to launch container for ApplicationMaster is : "
         + mergedCommand);
 
-    appContext.command = vargsFinal;
+    appContext.addAllCommands(vargsFinal);
     // TODO: RM should get this from RPC.
-    appContext.user = UserGroupInformation.getCurrentUser().getShortUserName();
+    appContext.setUser(UserGroupInformation.getCurrentUser().getShortUserName());
     return appContext;
   }
   
@@ -407,7 +410,7 @@ public class YARNRunner implements Clien
         if (name.isAbsolute()) {
           throw new IllegalArgumentException("Resource name must be relative");
         }
-        container.resources_todo.put(
+        container.setResourceTodo(
             name.toUri().getPath(),
             getLocalResource(
                 uris[i], type, 
@@ -417,7 +420,9 @@ public class YARNRunner implements Clien
                 sizes[i], timestamps[i])
         );
         if (classPaths.containsKey(u.getPath())) {
-          MRApps.addToClassPath(container.environment, name.toUri().getPath());
+          Map<String, String> environment = container.getAllEnvironment();
+          MRApps.addToClassPath(environment, name.toUri().getPath());
+          container.addAllEnvironment(environment);
         }
       }
     }
@@ -439,12 +444,12 @@ public class YARNRunner implements Clien
   private static LocalResource getLocalResource(URI uri, 
       LocalResourceType type, LocalResourceVisibility visibility, 
       long size, long timestamp) {
-    LocalResource resource = new LocalResource();
-    resource.resource = AvroUtil.getYarnUrlFromURI(uri);
-    resource.type = type;
-    resource.state = visibility;
-    resource.size = size;
-    resource.timestamp = timestamp;
+    LocalResource resource = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(LocalResource.class);
+    resource.setResource(ConverterUtils.getYarnUrlFromURI(uri));
+    resource.setType(type);
+    resource.setVisibility(visibility);
+    resource.setSize(size);
+    resource.setTimestamp(timestamp);
     return resource;
   }
   

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=1087462&r1=1087461&r2=1087462&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 Thu Mar 31 22:23:22 2011
@@ -18,58 +18,85 @@
 
 package org.apache.hadoop.mapred;
 
-import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.List;
 
 import junit.framework.Assert;
 
-import org.apache.avro.ipc.AvroRemoteException;
 import org.apache.avro.ipc.Server;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapred.YARNRunner;
+import org.apache.hadoop.mapreduce.v2.YarnMRJobConfig;
+import org.apache.hadoop.mapreduce.v2.api.MRClientProtocol;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.FailTaskAttemptResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetCountersResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetDiagnosticsRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetDiagnosticsResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetJobReportRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetJobReportResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskAttemptCompletionEventsRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskAttemptCompletionEventsResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskAttemptReportRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskAttemptReportResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillJobRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillJobResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillTaskAttemptRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillTaskAttemptResponse;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillTaskRequest;
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillTaskResponse;
+import org.apache.hadoop.mapreduce.v2.api.records.Counters;
+import org.apache.hadoop.mapreduce.v2.api.records.JobId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskType;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.yarn.YarnException;
+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.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.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.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.ipc.RPCUtil;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
+import org.apache.hadoop.yarn.factories.RecordFactory;
+import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
+import org.apache.hadoop.yarn.factory.providers.YarnRemoteExceptionFactoryProvider;
 import org.apache.hadoop.yarn.ipc.YarnRPC;
 import org.apache.hadoop.yarn.server.resourcemanager.applicationsmanager.ApplicationsManager;
 import org.apache.hadoop.yarn.service.AbstractService;
-import org.apache.hadoop.yarn.ApplicationID;
-import org.apache.hadoop.yarn.ApplicationMaster;
-import org.apache.hadoop.yarn.ApplicationState;
-import org.apache.hadoop.yarn.ApplicationStatus;
-import org.apache.hadoop.yarn.ApplicationSubmissionContext;
-import org.apache.hadoop.yarn.ClientRMProtocol;
-import org.apache.hadoop.yarn.YarnClusterMetrics;
-import org.apache.hadoop.yarn.YarnRemoteException;
-import org.apache.hadoop.mapreduce.v2.api.CounterGroup;
-import org.apache.hadoop.mapreduce.v2.api.Counters;
-import org.apache.hadoop.mapreduce.v2.api.JobID;
-import org.apache.hadoop.mapreduce.v2.api.JobReport;
-import org.apache.hadoop.mapreduce.v2.api.MRClientProtocol;
-import org.apache.hadoop.mapreduce.v2.api.TaskAttemptCompletionEvent;
-import org.apache.hadoop.mapreduce.v2.api.TaskAttemptReport;
-import org.apache.hadoop.mapreduce.v2.api.TaskReport;
-import org.apache.hadoop.mapreduce.v2.YarnMRJobConfig;
 import org.junit.Test;
 
 public class TestClientRedirect {
 
   private static final Log LOG = LogFactory.getLog(TestClientRedirect.class);
   private static final String RMADDRESS = "0.0.0.0:8054";
+  private static final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
+  
   private static final String AMHOSTADDRESS = "0.0.0.0:10020";
   private static final String HSHOSTADDRESS = "0.0.0.0:10021";
   private static final int HSPORT = 10020;
   private volatile boolean amContact = false; 
   private volatile boolean hsContact = false;
   private volatile boolean amRunning = false;
- 
+
   @Test
   public void testRedirect() throws Exception {
     
@@ -143,42 +170,42 @@ public class TestClientRedirect {
     }
 
     @Override
-    public ApplicationID getNewApplicationId() throws AvroRemoteException {
+    public GetNewApplicationIdResponse getNewApplicationId(GetNewApplicationIdRequest request) throws YarnRemoteException {
       return null;
     }
-
+    
     @Override
-    public ApplicationMaster getApplicationMaster(ApplicationID applicationId)
-        throws AvroRemoteException {
-      ApplicationMaster master = new ApplicationMaster();
-      master.applicationId = applicationId;
-      master.status = new ApplicationStatus();
-      master.status.applicationId = applicationId;
+    public GetApplicationMasterResponse getApplicationMaster(GetApplicationMasterRequest request) throws YarnRemoteException {
+      ApplicationId applicationId = request.getApplicationId();
+      ApplicationMaster master = recordFactory.newRecordInstance(ApplicationMaster.class);
+      master.setApplicationId(applicationId);
+      master.setStatus(recordFactory.newRecordInstance(ApplicationStatus.class));
+      master.getStatus().setApplicationId(applicationId);
       if (amRunning) {
-        master.state = ApplicationState.RUNNING;
+        master.setState(ApplicationState.RUNNING);
       } else {
-        master.state = ApplicationState.COMPLETED;
+        master.setState(ApplicationState.COMPLETED);
       }
       String[] split = AMHOSTADDRESS.split(":");
-      master.host = split[0];
-      master.rpcPort = Integer.parseInt(split[1]);
-      return master;
-  }
+      master.setHost(split[0]);
+      master.setRpcPort(Integer.parseInt(split[1]));
+      GetApplicationMasterResponse response = recordFactory.newRecordInstance(GetApplicationMasterResponse.class);
+      response.setApplicationMaster(master);
+      return response;
+    }
 
     @Override
-    public Void submitApplication(ApplicationSubmissionContext context)
-        throws AvroRemoteException {
-      throw new AvroRemoteException("Test");
+    public SubmitApplicationResponse submitApplication(SubmitApplicationRequest request) throws YarnRemoteException {
+      throw YarnRemoteExceptionFactoryProvider.getYarnRemoteExceptionFactory(null).createYarnRemoteException("Test");
     }
-
+    
     @Override
-    public Void finishApplication(ApplicationID applicationId)
-        throws AvroRemoteException {
+    public FinishApplicationResponse finishApplication(FinishApplicationRequest request) throws YarnRemoteException {
       return null;
     }
-
+    
     @Override
-    public YarnClusterMetrics getClusterMetrics() throws AvroRemoteException {
+    public GetClusterMetricsResponse getClusterMetrics(GetClusterMetricsRequest request) throws YarnRemoteException {
       return null;
     }
   }
@@ -189,12 +216,14 @@ public class TestClientRedirect {
     }
 
     @Override
-    public Counters getCounters(JobID jobID) throws AvroRemoteException,
-      YarnRemoteException {
+    public GetCountersResponse getCounters(GetCountersRequest request) throws YarnRemoteException {
+      JobId jobId = request.getJobId();
       hsContact = true;
-      Counters counters = new Counters();
-      counters.groups = new HashMap<CharSequence, CounterGroup>();
-      return counters;
+      Counters counters = recordFactory.newRecordInstance(Counters.class);
+//      counters.groups = new HashMap<CharSequence, CounterGroup>();
+      GetCountersResponse response = recordFactory.newRecordInstance(GetCountersResponse.class);
+      response.setCounters(counters);
+      return response;
    }
   }
 
@@ -240,77 +269,78 @@ public class TestClientRedirect {
     }
 
     @Override
-    public Counters getCounters(JobID jobID) throws AvroRemoteException,
-      YarnRemoteException {
+    public GetCountersResponse getCounters(GetCountersRequest request) throws YarnRemoteException {
+      JobId jobID = request.getJobId();
+    
       amContact = true;
-      Counters counters = new Counters();
-      counters.groups = new HashMap<CharSequence, CounterGroup>();
-      return counters;
-   }
+      Counters counters = recordFactory.newRecordInstance(Counters.class);
+//      counters.groups = new HashMap<CharSequence, CounterGroup>();
+        GetCountersResponse response = recordFactory.newRecordInstance(GetCountersResponse.class);
+        response.setCounters(counters);
+        return response;
+      }
 
     @Override
-    public List<CharSequence> getDiagnostics(
-        org.apache.hadoop.mapreduce.v2.api.TaskAttemptID taskAttemptID)
-        throws AvroRemoteException, YarnRemoteException {
+    public GetJobReportResponse getJobReport(GetJobReportRequest request) throws YarnRemoteException {
+      JobId jobId = request.getJobId();
       return null;
     }
 
     @Override
-    public JobReport getJobReport(JobID jobID) throws AvroRemoteException,
-        YarnRemoteException {
+    public GetTaskReportResponse getTaskReport(GetTaskReportRequest request) throws YarnRemoteException {
+      TaskId taskID = request.getTaskId();
       return null;
     }
 
+
     @Override
-    public List<TaskAttemptCompletionEvent> getTaskAttemptCompletionEvents(
-        JobID jobID, int fromEventId, int maxEvents)
-        throws AvroRemoteException, YarnRemoteException {
+    public GetTaskAttemptReportResponse getTaskAttemptReport(GetTaskAttemptReportRequest request) throws YarnRemoteException {
+      TaskAttemptId taskAttemptID = request.getTaskAttemptId();
       return null;
     }
 
     @Override
-    public TaskAttemptReport getTaskAttemptReport(
-        org.apache.hadoop.mapreduce.v2.api.TaskAttemptID taskAttemptID)
-        throws AvroRemoteException, YarnRemoteException {
+    public GetTaskAttemptCompletionEventsResponse getTaskAttemptCompletionEvents(GetTaskAttemptCompletionEventsRequest request) throws YarnRemoteException {
+      JobId jobId = request.getJobId();
+      int fromEventId = request.getFromEventId();
+      int maxEvents = request.getMaxEvents();
       return null;
     }
 
     @Override
-    public TaskReport getTaskReport(org.apache.hadoop.mapreduce.v2.api.TaskID taskID)
-        throws AvroRemoteException, YarnRemoteException {
+    public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request) throws YarnRemoteException {
+      JobId jobID = request.getJobId();
+      TaskType taskType = request.getTaskType();
       return null;
     }
 
     @Override
-    public List<TaskReport> getTaskReports(JobID jobID,
-        org.apache.hadoop.mapreduce.v2.api.TaskType taskType)
-        throws AvroRemoteException, YarnRemoteException {
+    public GetDiagnosticsResponse getDiagnostics(GetDiagnosticsRequest request) throws YarnRemoteException {
+      TaskAttemptId taskAttemptID = request.getTaskAttemptId();
       return null;
     }
 
     @Override
-    public Void killJob(JobID jobID) throws AvroRemoteException,
-        YarnRemoteException {
+    public KillJobResponse killJob(KillJobRequest request) throws YarnRemoteException {
+      JobId jobID = request.getJobId();
       return null;
     }
 
     @Override
-    public Void killTask(org.apache.hadoop.mapreduce.v2.api.TaskID taskID)
-        throws AvroRemoteException, YarnRemoteException {
+    public KillTaskResponse killTask(KillTaskRequest request) throws YarnRemoteException {
+      TaskId taskID = request.getTaskId();
       return null;
     }
 
     @Override
-    public Void killTaskAttempt(
-        org.apache.hadoop.mapreduce.v2.api.TaskAttemptID taskAttemptID)
-        throws AvroRemoteException, YarnRemoteException {
+    public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request) throws YarnRemoteException {
+      TaskAttemptId taskAttemptID = request.getTaskAttemptId();
       return null;
     }
 
     @Override
-    public Void failTaskAttempt(
-        org.apache.hadoop.mapreduce.v2.api.TaskAttemptID taskAttemptID)
-        throws AvroRemoteException, YarnRemoteException {
+    public FailTaskAttemptResponse failTaskAttempt(FailTaskAttemptRequest request) throws YarnRemoteException {
+      TaskAttemptId taskAttemptID = request.getTaskAttemptId();
       return null;
     }
   }

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=1087462&r1=1087461&r2=1087462&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 Thu Mar 31 22:23:22 2011
@@ -20,45 +20,20 @@ package org.apache.hadoop.mapreduce.v2;
 
 import java.io.File;
 import java.io.IOException;
-import java.security.PrivilegedExceptionAction;
-import org.apache.avro.ipc.AvroRemoteException;
 
 import junit.framework.Assert;
 
+import org.apache.avro.ipc.AvroRemoteException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.FailingMapper;
-import org.apache.hadoop.RandomTextWriterJob;
 import org.apache.hadoop.SleepJob;
-import org.apache.hadoop.RandomTextWriterJob.RandomInputFormat;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.mapred.YARNRunner;
 import org.apache.hadoop.mapreduce.Counters;
 import org.apache.hadoop.mapreduce.Job;
-import org.apache.hadoop.mapreduce.JobStatus;
-import org.apache.hadoop.mapreduce.MRJobConfig;
-import org.apache.hadoop.mapreduce.TaskAttemptID;
-import org.apache.hadoop.mapreduce.TaskCompletionEvent;
-import org.apache.hadoop.mapreduce.TaskID;
-import org.apache.hadoop.mapreduce.TaskType;
 import org.apache.hadoop.mapreduce.TypeConverter;
-import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
-import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.hadoop.security.token.Token;
-import org.apache.hadoop.security.token.TokenIdentifier;
-import org.apache.hadoop.yarn.ApplicationID;
-import org.apache.hadoop.yarn.ApplicationState;
-import org.apache.hadoop.yarn.conf.YARNApplicationConstants;
-import org.apache.hadoop.yarn.conf.YarnConfiguration;
-import org.apache.hadoop.yarn.server.YarnServerConfig;
-import org.apache.hadoop.yarn.server.nodemanager.NMConfig;
-import org.apache.hadoop.yarn.server.resourcemanager.RMConfig;
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ApplicationState;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class TestMRJobsWithHistoryService {
@@ -98,7 +73,7 @@ public class TestMRJobsWithHistoryServic
     job.setJar(new File(MiniMRYarnCluster.APPJAR).getAbsolutePath());
     job.waitForCompletion(true);
     Counters counterMR = job.getCounters();
-    ApplicationID appID = TypeConverter.toYarn(job.getJobID()).appID;
+    ApplicationId appID = TypeConverter.toYarn(job.getJobID()).getAppId();
     while (true) {
       Thread.sleep(1000);
       if (mrCluster.getResourceManager().getApplicationsManager()

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java?rev=1087462&r1=1087461&r2=1087462&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java Thu Mar 31 22:23:22 2011
@@ -86,20 +86,20 @@ import org.apache.hadoop.io.DataOutputBy
 import org.apache.hadoop.mapreduce.security.SecureShuffleUtils;
 import org.apache.hadoop.mapreduce.task.reduce.ShuffleHeader;
 
-import org.apache.hadoop.yarn.ApplicationID;
 
 import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
 import org.apache.hadoop.yarn.server.nodemanager.NMConfig;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.AuxServices;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ApplicationLocalizer;
 import org.apache.hadoop.yarn.service.AbstractService;
-import org.apache.hadoop.yarn.util.AvroUtil;
+import org.apache.hadoop.yarn.util.ConverterUtils;
 import org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier;
 import org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager;
 
 // DEBUG
 import org.apache.commons.logging.impl.Log4JLogger;
-import org.apache.commons.logging.impl.Log4JLogger;
 import org.apache.log4j.Level;
 
 // TODO packaging
@@ -131,7 +131,7 @@ public class ShuffleHandler extends Abst
   }
 
   @Override
-  public void initApp(String user, ApplicationID appId, ByteBuffer secret) {
+  public void initApp(String user, ApplicationId appId, ByteBuffer secret) {
     // TODO these bytes should be versioned
     try {
       DataInputByteBuffer in = new DataInputByteBuffer();
@@ -139,7 +139,7 @@ public class ShuffleHandler extends Abst
       Token<JobTokenIdentifier> jt = new Token<JobTokenIdentifier>();
       jt.readFields(in);
       // TODO: Once SHuffle is out of NM, this can use MR APIs
-      JobID jobId = new JobID(Long.toString(appId.clusterTimeStamp), appId.id);
+      JobID jobId = new JobID(Long.toString(appId.getClusterTimestamp()), appId.getId());
       userRsrc.put(jobId.toString(), user);
       LOG.info("Added token for " + jobId.toString());
       secretManager.addTokenForJob(jobId.toString(), jt);
@@ -150,8 +150,8 @@ public class ShuffleHandler extends Abst
   }
 
   @Override
-  public void stopApp(ApplicationID appId) {
-    JobID jobId = new JobID(Long.toString(appId.clusterTimeStamp), appId.id);
+  public void stopApp(ApplicationId appId) {
+    JobID jobId = new JobID(Long.toString(appId.getClusterTimestamp()), appId.getId());
     secretManager.removeTokenForJob(jobId.toString());
   }
 
@@ -346,13 +346,13 @@ public class ShuffleHandler extends Abst
       // $x/$user/appcache/$appId/output/$mapId
       // TODO: Once Shuffle is out of NM, this can use MR APIs to convert between App and Job
       JobID jobID = JobID.forName(jobId);
-      ApplicationID appID = new ApplicationID();
-      appID.clusterTimeStamp = Long.parseLong(jobID.getJtIdentifier());
-      appID.id = jobID.getId();
+      ApplicationId appID = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(ApplicationId.class);
+      appID.setClusterTimestamp(Long.parseLong(jobID.getJtIdentifier()));
+      appID.setId(jobID.getId());
       final String base =
           ApplicationLocalizer.USERCACHE + "/" + user + "/"
               + ApplicationLocalizer.APPCACHE + "/"
-              + AvroUtil.toString(appID) + "/output" + "/" + mapId;
+              + ConverterUtils.toString(appID) + "/output" + "/" + mapId;
       LOG.debug("DEBUG0 " + base);
       // Index file
       Path indexFileName = lDirAlloc.getLocalPathToRead(

Modified: hadoop/mapreduce/branches/MR-279/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/pom.xml?rev=1087462&r1=1087461&r2=1087462&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/pom.xml (original)
+++ hadoop/mapreduce/branches/MR-279/pom.xml Thu Mar 31 22:23:22 2011
@@ -23,6 +23,11 @@
     <!-- The Avro dependency must be defined before hadoop-common to override 
     the transitive dependency on avro in hadoop-common. -->
     <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <version>2.4.0a</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.avro</groupId>
       <artifactId>avro</artifactId>
       <version>1.4.1</version>

Modified: hadoop/mapreduce/branches/MR-279/yarn/README
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/README?rev=1087462&r1=1087461&r2=1087462&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/README (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/README Thu Mar 31 22:23:22 2011
@@ -11,6 +11,17 @@ Setup
 Install the Avro maven plugin in local maven repository:
 mvn install:install-file -Dfile=./avro-maven-plugin/avro-maven-plugin-1.4.0-SNAPSHOT.jar -DpomFile=./avro-maven-plugin/avro-maven-plugin-1.4.0-SNAPSHOT.pom
 
+Install protobuf 2.4.0a (Download from http://code.google.com/p/protobuf/downloads/list)
+ - install the protoc executable (configure, make, make install)
+ - install the maven artifact (mvn install)
+Installing protoc requires gcc 4.1.x or higher.
+If the make step fails with (Valid until a fix is released for protobuf 2.4.0a)
+    ./google/protobuf/descriptor.h:1152: error:
+    `google::protobuf::internal::Mutex*google::protobuf::DescriptorPool::mutex_'
+    is private
+  Replace descriptor.cc with http://protobuf.googlecode.com/svn-history/r380/trunk/src/google/protobuf/descriptor.cc
+
+
 Quick Maven Tips
 ----------------
 clean workspace: mvn clean

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/pom.xml?rev=1087462&r1=1087461&r2=1087462&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/pom.xml (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/pom.xml Thu Mar 31 22:23:22 2011
@@ -18,7 +18,7 @@
   <url>http://maven.apache.org</url>
   <build>
     <plugins>
-      <plugin>
+      <!--plugin>
         <groupId>org.apache.avro</groupId>
         <artifactId>avro-maven-plugin</artifactId>
         <version>1.4.0-SNAPSHOT</version>
@@ -30,7 +30,85 @@
             </goals>
           </execution>
         </executions>
+      </plugin-->
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>create_generate_src_dirctory</id>
+            <phase>initialize</phase>
+            <configuration>
+              <tasks>
+                <mkdir dir="target/generated-sources/proto" />
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.2</version>
+        <executions>
+          <execution>
+            <id>generate-sources</id>
+            <phase>generate-sources</phase>
+            <configuration>
+              <executable>protoc</executable>
+              <arguments>
+				<argument>-Isrc/main/proto/</argument>
+                <argument>--java_out=target/generated-sources/proto</argument>
+                <argument>src/main/proto/yarn_protos.proto</argument>
+                <argument>src/main/proto/yarn_service_protos.proto</argument>
+                <argument>src/main/proto/AM_RM_protocol.proto</argument>
+                <argument>src/main/proto/client_RM_protocol.proto</argument>
+                <argument>src/main/proto/container_manager.proto</argument>
+              </arguments>
+            </configuration>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>1.5</version>
+        <executions>
+          <execution>
+            <id>add-source</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>target/generated-sources/proto</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
       </plugin>
+
+
     </plugins>
   </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <version>2.4.0a</version>
+    </dependency>
+  </dependencies>
+
+
 </project>

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/Application.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/Application.java?rev=1087462&r1=1087461&r2=1087462&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/Application.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/Application.java Thu Mar 31 22:23:22 2011
@@ -18,15 +18,16 @@
 
 package org.apache.hadoop.yarn;
 
-import org.apache.hadoop.yarn.ApplicationID;
-import org.apache.hadoop.yarn.ApplicationState;
-import org.apache.hadoop.yarn.ApplicationStatus;
+
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ApplicationState;
+import org.apache.hadoop.yarn.api.records.ApplicationStatus;
 
 /**
  * A read-only application interface
  */
 public interface Application {
-  ApplicationID id();
+  ApplicationId id();
   CharSequence user();
   CharSequence queue();
   CharSequence name();

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,15 @@
+package org.apache.hadoop.yarn.api;
+
+import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
+
+public interface AMRMProtocol {
+  public RegisterApplicationMasterResponse registerApplicationMaster(RegisterApplicationMasterRequest request) throws YarnRemoteException;
+  public FinishApplicationMasterResponse finishApplicationMaster(FinishApplicationMasterRequest request) throws YarnRemoteException;;
+  public AllocateResponse allocate(AllocateRequest request) throws YarnRemoteException;
+}

Added: 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=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,21 @@
+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.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.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.exceptions.YarnRemoteException;
+
+public interface ClientRMProtocol {
+  public GetNewApplicationIdResponse getNewApplicationId(GetNewApplicationIdRequest request) throws YarnRemoteException;
+  public GetApplicationMasterResponse getApplicationMaster(GetApplicationMasterRequest request) throws YarnRemoteException;
+  public SubmitApplicationResponse submitApplication(SubmitApplicationRequest request) throws YarnRemoteException;
+  public FinishApplicationResponse finishApplication(FinishApplicationRequest request) throws YarnRemoteException;
+  public GetClusterMetricsResponse getClusterMetrics(GetClusterMetricsRequest request) throws YarnRemoteException;
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManager.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManager.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManager.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManager.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,18 @@
+package org.apache.hadoop.yarn.api;
+
+import org.apache.hadoop.yarn.api.protocolrecords.CleanupContainerRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.CleanupContainerResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.StartContainerResponse;
+import org.apache.hadoop.yarn.api.protocolrecords.StopContainerRequest;
+import org.apache.hadoop.yarn.api.protocolrecords.StopContainerResponse;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
+
+public interface ContainerManager {
+  StartContainerResponse startContainer(StartContainerRequest request) throws YarnRemoteException;
+  StopContainerResponse stopContainer(StopContainerRequest request) throws YarnRemoteException;
+  CleanupContainerResponse cleanupContainer(CleanupContainerRequest request) throws YarnRemoteException;
+  GetContainerStatusResponse getContainerStatus(GetContainerStatusRequest request) throws YarnRemoteException;
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,31 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import java.util.List;
+
+import org.apache.hadoop.yarn.api.records.ApplicationStatus;
+import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ResourceRequest;
+
+public interface AllocateRequest {
+  public abstract ApplicationStatus getApplicationStatus();
+  
+  public abstract List<ResourceRequest> getAskList();
+  public abstract ResourceRequest getAsk(int index);
+  public abstract int getAskCount();
+  
+  public abstract List<Container> getReleaseList();
+  public abstract Container getRelease(int index);
+  public abstract int getReleaseCount();
+  
+  public abstract void setApplicationStatus(ApplicationStatus applicationStatus);
+  
+  public abstract void addAllAsks(List<ResourceRequest> resourceRequest);
+  public abstract void addAsk(ResourceRequest request);
+  public abstract void removeAsk(int index);
+  public abstract void clearAsks();
+  
+  public abstract void addAllReleases(List<Container> releaseContainers);
+  public abstract void addRelease(Container container);
+  public abstract void removeRelease(int index);
+  public abstract void clearReleases();
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,9 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.AMResponse;
+
+public interface AllocateResponse {
+  public abstract AMResponse getAMResponse();
+  
+  public abstract void setAMResponse(AMResponse amResponse);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/CleanupContainerRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/CleanupContainerRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/CleanupContainerRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/CleanupContainerRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ContainerId;
+
+public interface CleanupContainerRequest {
+  public abstract ContainerId getContainerId();
+  public abstract void setContainerId(ContainerId containerId);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/CleanupContainerResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/CleanupContainerResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/CleanupContainerResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/CleanupContainerResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface CleanupContainerResponse {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ApplicationMaster;
+
+public interface FinishApplicationMasterRequest {
+  public abstract ApplicationMaster getApplicationMaster();
+  public abstract void setApplicationMaster(ApplicationMaster applicationMaster);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface FinishApplicationMasterResponse {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,9 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+
+public interface FinishApplicationRequest {
+  public abstract ApplicationId getApplicationId();
+  
+  public abstract void setApplicationId(ApplicationId applicationId);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface FinishApplicationResponse {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationMasterRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationMasterRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationMasterRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationMasterRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+
+public interface GetApplicationMasterRequest {
+  public abstract ApplicationId getApplicationId();
+  public abstract void setApplicationId(ApplicationId applicationId);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationMasterResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationMasterResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationMasterResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationMasterResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ApplicationMaster;
+
+public interface GetApplicationMasterResponse {
+  public abstract ApplicationMaster getApplicationMaster();
+  public abstract void setApplicationMaster(ApplicationMaster applicationMaster);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface GetClusterMetricsRequest {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.YarnClusterMetrics;
+
+public interface GetClusterMetricsResponse {
+  public abstract YarnClusterMetrics getClusterMetrics();
+  public abstract void setClusterMetrics(YarnClusterMetrics metrics);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ContainerId;
+
+public interface GetContainerStatusRequest {
+  public abstract ContainerId getContainerId();
+  public abstract void setContainerId(ContainerId containerId);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ContainerStatus;
+
+public interface GetContainerStatusResponse {
+  public abstract ContainerStatus getStatus();
+  public abstract void setStatus(ContainerStatus containerStatus);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface GetNewApplicationIdRequest {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+
+public interface GetNewApplicationIdResponse {
+  public abstract ApplicationId getApplicationId();
+  public abstract void setApplicationId(ApplicationId applicationId);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,9 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ApplicationMaster;
+
+public interface RegisterApplicationMasterRequest {
+  public abstract ApplicationMaster getApplicationMaster();
+  
+  public abstract void setApplicationMaster(ApplicationMaster applicationMaster);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface RegisterApplicationMasterResponse {
+  
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,9 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
+
+public interface StartContainerRequest {
+  public abstract ContainerLaunchContext getContainerLaunchContext();
+  
+  public abstract void setContainerLaunchContext(ContainerLaunchContext context);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface StartContainerResponse {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ContainerId;
+
+public interface StopContainerRequest {
+  public abstract ContainerId getContainerId();
+  public abstract void setContainerId(ContainerId containerId);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface StopContainerResponse {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationRequest.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationRequest.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationRequest.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,8 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
+
+public interface SubmitApplicationRequest {
+  public abstract ApplicationSubmissionContext getApplicationSubmissionContext();
+  public abstract void setApplicationSubmissionContext(ApplicationSubmissionContext context);
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationResponse.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationResponse.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationResponse.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationResponse.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+public interface SubmitApplicationResponse {
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/AllocateRequestPBImpl.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/AllocateRequestPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/AllocateRequestPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/AllocateRequestPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,295 @@
+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.AllocateRequest;
+import org.apache.hadoop.yarn.api.records.ApplicationStatus;
+import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.api.records.ResourceRequest;
+import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationStatusPBImpl;
+import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl;
+import org.apache.hadoop.yarn.api.records.impl.pb.ResourceRequestPBImpl;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationStatusProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.ContainerProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.ResourceRequestProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateRequestProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateRequestProtoOrBuilder;
+
+
+    
+public class AllocateRequestPBImpl extends ProtoBase<AllocateRequestProto> implements AllocateRequest {
+  AllocateRequestProto proto = AllocateRequestProto.getDefaultInstance();
+  AllocateRequestProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private ApplicationStatus applicationStatus = null;
+  private List<ResourceRequest> ask = null;
+  private List<Container> release = null;
+  
+  
+  public AllocateRequestPBImpl() {
+    builder = AllocateRequestProto.newBuilder();
+  }
+
+  public AllocateRequestPBImpl(AllocateRequestProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public AllocateRequestProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.applicationStatus != null) {
+      builder.setApplicationStatus(convertToProtoFormat(this.applicationStatus));
+    }
+    if (this.ask != null) {
+      addAsksToProto();
+    }
+    if (this.release != null) {
+      addReleasesToProto();
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = AllocateRequestProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public ApplicationStatus getApplicationStatus() {
+    AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.applicationStatus != null) {
+      return this.applicationStatus;
+    }
+    if (!p.hasApplicationStatus()) {
+      return null;
+    }
+    this.applicationStatus = convertFromProtoFormat(p.getApplicationStatus());
+    return this.applicationStatus;
+  }
+
+  @Override
+  public void setApplicationStatus(ApplicationStatus applicationStatus) {
+    maybeInitBuilder();
+    if (applicationStatus == null) 
+      builder.clearApplicationStatus();
+    this.applicationStatus = applicationStatus;
+  }
+  @Override
+  public List<ResourceRequest> getAskList() {
+    initAsks();
+    return this.ask;
+  }
+  @Override
+  public ResourceRequest getAsk(int index) {
+    initAsks();
+    return this.ask.get(index);
+  }
+  @Override
+  public int getAskCount() {
+    initAsks();
+    return this.ask.size();
+  }
+  
+  private void initAsks() {
+    if (this.ask != null) {
+      return;
+    }
+    AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
+    List<ResourceRequestProto> list = p.getAskList();
+    this.ask = new ArrayList<ResourceRequest>();
+
+    for (ResourceRequestProto c : list) {
+      this.ask.add(convertFromProtoFormat(c));
+    }
+  }
+  
+  @Override
+  public void addAllAsks(final List<ResourceRequest> ask) {
+    if (ask == null)
+      return;
+    initAsks();
+    this.ask.addAll(ask);
+  }
+  
+  private void addAsksToProto() {
+    maybeInitBuilder();
+    builder.clearAsk();
+    if (ask == null)
+      return;
+    Iterable<ResourceRequestProto> iterable = new Iterable<ResourceRequestProto>() {
+      @Override
+      public Iterator<ResourceRequestProto> iterator() {
+        return new Iterator<ResourceRequestProto>() {
+
+          Iterator<ResourceRequest> iter = ask.iterator();
+
+          @Override
+          public boolean hasNext() {
+            return iter.hasNext();
+          }
+
+          @Override
+          public ResourceRequestProto next() {
+            return convertToProtoFormat(iter.next());
+          }
+
+          @Override
+          public void remove() {
+            throw new UnsupportedOperationException();
+
+          }
+        };
+
+      }
+    };
+    builder.addAllAsk(iterable);
+  }
+  @Override
+  public void addAsk(ResourceRequest ask) {
+    initAsks();
+    this.ask.add(ask);
+  }
+  @Override
+  public void removeAsk(int index) {
+    initAsks();
+    this.ask.remove(index);
+  }
+  @Override
+  public void clearAsks() {
+    initAsks();
+    this.ask.clear();
+  }
+  @Override
+  public List<Container> getReleaseList() {
+    initReleases();
+    return this.release;
+  }
+  @Override
+  public Container getRelease(int index) {
+    initReleases();
+    return this.release.get(index);
+  }
+  @Override
+  public int getReleaseCount() {
+    initReleases();
+    return this.release.size();
+  }
+  
+  private void initReleases() {
+    if (this.release != null) {
+      return;
+    }
+    AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
+    List<ContainerProto> list = p.getReleaseList();
+    this.release = new ArrayList<Container>();
+
+    for (ContainerProto c : list) {
+      this.release.add(convertFromProtoFormat(c));
+    }
+  }
+  
+  @Override
+  public void addAllReleases(final List<Container> release) {
+    if (release == null)
+      return;
+    initReleases();
+    this.release.addAll(release);
+  }
+  
+  private void addReleasesToProto() {
+    maybeInitBuilder();
+    builder.clearRelease();
+    if (release == null)
+      return;
+    Iterable<ContainerProto> iterable = new Iterable<ContainerProto>() {
+      @Override
+      public Iterator<ContainerProto> iterator() {
+        return new Iterator<ContainerProto>() {
+
+          Iterator<Container> iter = release.iterator();
+
+          @Override
+          public boolean hasNext() {
+            return iter.hasNext();
+          }
+
+          @Override
+          public ContainerProto next() {
+            return convertToProtoFormat(iter.next());
+          }
+
+          @Override
+          public void remove() {
+            throw new UnsupportedOperationException();
+
+          }
+        };
+
+      }
+    };
+    builder.addAllRelease(iterable);
+  }
+  @Override
+  public void addRelease(Container release) {
+    initReleases();
+    this.release.add(release);
+  }
+  @Override
+  public void removeRelease(int index) {
+    initReleases();
+    this.release.remove(index);
+  }
+  @Override
+  public void clearReleases() {
+    initReleases();
+    this.release.clear();
+  }
+
+  private ApplicationStatusPBImpl convertFromProtoFormat(ApplicationStatusProto p) {
+    return new ApplicationStatusPBImpl(p);
+  }
+
+  private ApplicationStatusProto convertToProtoFormat(ApplicationStatus t) {
+    return ((ApplicationStatusPBImpl)t).getProto();
+  }
+
+  private ResourceRequestPBImpl convertFromProtoFormat(ResourceRequestProto p) {
+    return new ResourceRequestPBImpl(p);
+  }
+
+  private ResourceRequestProto convertToProtoFormat(ResourceRequest t) {
+    return ((ResourceRequestPBImpl)t).getProto();
+  }
+
+  private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {
+    return new ContainerPBImpl(p);
+  }
+
+  private ContainerProto convertToProtoFormat(Container t) {
+    return ((ContainerPBImpl)t).getProto();
+  }
+
+
+
+}  



Mime
View raw message