hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1153430 [2/9] - in /hadoop/common/branches/MR-279/mapreduce: mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/loc...
Date Wed, 03 Aug 2011 11:32:10 GMT
Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/AllocateRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/AllocateRequestPBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/AllocateRequestPBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/AllocateRequestPBImpl.java Wed Aug  3 11:31:34 2011
@@ -6,14 +6,14 @@ 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.ApplicationAttemptId;
 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.ApplicationAttemptIdPBImpl;
 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.ApplicationAttemptIdProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ContainerProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ResourceRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateRequestProto;
@@ -25,8 +25,8 @@ public class AllocateRequestPBImpl exten
   AllocateRequestProto proto = AllocateRequestProto.getDefaultInstance();
   AllocateRequestProto.Builder builder = null;
   boolean viaProto = false;
-  
-  private ApplicationStatus applicationStatus = null;
+
+  private ApplicationAttemptId applicationAttemptID = null;
   private List<ResourceRequest> ask = null;
   private List<Container> release = null;
   
@@ -48,8 +48,8 @@ public class AllocateRequestPBImpl exten
   }
 
   private void mergeLocalToBuilder() {
-    if (this.applicationStatus != null) {
-      builder.setApplicationStatus(convertToProtoFormat(this.applicationStatus));
+    if (this.applicationAttemptID != null) {
+      builder.setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptID));
     }
     if (this.ask != null) {
       addAsksToProto();
@@ -73,28 +73,52 @@ public class AllocateRequestPBImpl exten
     }
     viaProto = false;
   }
-    
-  
+
   @Override
-  public ApplicationStatus getApplicationStatus() {
+  public ApplicationAttemptId getApplicationAttemptId() {
     AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
-    if (this.applicationStatus != null) {
-      return this.applicationStatus;
+    if (this.applicationAttemptID != null) {
+      return this.applicationAttemptID;
     }
-    if (!p.hasApplicationStatus()) {
+    if (!p.hasApplicationAttemptId()) {
       return null;
     }
-    this.applicationStatus = convertFromProtoFormat(p.getApplicationStatus());
-    return this.applicationStatus;
+    this.applicationAttemptID = convertFromProtoFormat(p.getApplicationAttemptId());
+    return this.applicationAttemptID;
   }
 
   @Override
-  public void setApplicationStatus(ApplicationStatus applicationStatus) {
+  public void setApplicationAttemptId(ApplicationAttemptId appAttemptId) {
     maybeInitBuilder();
-    if (applicationStatus == null) 
-      builder.clearApplicationStatus();
-    this.applicationStatus = applicationStatus;
+    if (appAttemptId == null) 
+      builder.clearApplicationAttemptId();
+    this.applicationAttemptID = appAttemptId;
   }
+
+  @Override
+  public int getResponseId() {
+    AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
+    return p.getResponseId();
+  }
+
+  @Override
+  public void setResponseId(int id) {
+    maybeInitBuilder();
+    builder.setResponseId(id);
+  }
+
+  @Override
+  public float getProgress() {
+    AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
+    return p.getProgress();
+  }
+
+  @Override
+  public void setProgress(float progress) {
+    maybeInitBuilder();
+    builder.setProgress(progress);
+  }
+
   @Override
   public List<ResourceRequest> getAskList() {
     initAsks();
@@ -266,12 +290,12 @@ public class AllocateRequestPBImpl exten
     this.release.clear();
   }
 
-  private ApplicationStatusPBImpl convertFromProtoFormat(ApplicationStatusProto p) {
-    return new ApplicationStatusPBImpl(p);
+  private ApplicationAttemptIdPBImpl convertFromProtoFormat(ApplicationAttemptIdProto p) {
+    return new ApplicationAttemptIdPBImpl(p);
   }
 
-  private ApplicationStatusProto convertToProtoFormat(ApplicationStatus t) {
-    return ((ApplicationStatusPBImpl)t).getProto();
+  private ApplicationAttemptIdProto convertToProtoFormat(ApplicationAttemptId t) {
+    return ((ApplicationAttemptIdPBImpl)t).getProto();
   }
 
   private ResourceRequestPBImpl convertFromProtoFormat(ResourceRequestProto p) {
@@ -289,7 +313,4 @@ public class AllocateRequestPBImpl exten
   private ContainerProto convertToProtoFormat(Container t) {
     return ((ContainerPBImpl)t).getProto();
   }
-
-
-
 }  

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/FinishApplicationMasterRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/FinishApplicationMasterRequestPBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/FinishApplicationMasterRequestPBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/FinishApplicationMasterRequestPBImpl.java Wed Aug  3 11:31:34 2011
@@ -2,12 +2,13 @@ package org.apache.hadoop.yarn.api.proto
 
 
 import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest;
-import org.apache.hadoop.yarn.api.records.ApplicationMaster;
+import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ProtoBase;
-import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationMasterPBImpl;
-import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationMasterProto;
+import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationAttemptIdProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationMasterRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationMasterRequestProtoOrBuilder;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterRequestProtoOrBuilder;
 
 
     
@@ -16,7 +17,7 @@ public class FinishApplicationMasterRequ
   FinishApplicationMasterRequestProto.Builder builder = null;
   boolean viaProto = false;
   
-  private ApplicationMaster applicationMaster = null;
+  private ApplicationAttemptId appAttemptId = null;
   
   
   public FinishApplicationMasterRequestPBImpl() {
@@ -36,8 +37,8 @@ public class FinishApplicationMasterRequ
   }
 
   private void mergeLocalToBuilder() {
-    if (this.applicationMaster != null) {
-      builder.setApplicationMaster(convertToProtoFormat(this.applicationMaster));
+    if (this.appAttemptId != null) {
+      builder.setApplicationAttemptId(convertToProtoFormat(this.appAttemptId));
     }
   }
 
@@ -58,32 +59,68 @@ public class FinishApplicationMasterRequ
     
   
   @Override
-  public ApplicationMaster getApplicationMaster() {
+  public ApplicationAttemptId getApplicationAttemptId() {
     FinishApplicationMasterRequestProtoOrBuilder p = viaProto ? proto : builder;
-    if (this.applicationMaster != null) {
-      return this.applicationMaster;
+    if (this.appAttemptId != null) {
+      return this.appAttemptId;
     }
-    if (!p.hasApplicationMaster()) {
+    if (!p.hasApplicationAttemptId()) {
       return null;
     }
-    this.applicationMaster = convertFromProtoFormat(p.getApplicationMaster());
-    return this.applicationMaster;
+    this.appAttemptId = convertFromProtoFormat(p.getApplicationAttemptId());
+    return this.appAttemptId;
   }
 
   @Override
-  public void setApplicationMaster(ApplicationMaster applicationMaster) {
+  public void setAppAttemptId(ApplicationAttemptId applicationAttemptId) {
     maybeInitBuilder();
-    if (applicationMaster == null) 
-      builder.clearApplicationMaster();
-    this.applicationMaster = applicationMaster;
+    if (applicationAttemptId == null) 
+      builder.clearApplicationAttemptId();
+    this.appAttemptId = applicationAttemptId;
   }
 
-  private ApplicationMasterPBImpl convertFromProtoFormat(ApplicationMasterProto p) {
-    return new ApplicationMasterPBImpl(p);
+  @Override
+  public String getDiagnostics() {
+    FinishApplicationMasterRequestProtoOrBuilder p = viaProto ? proto : builder;
+    return p.getDiagnostics();
+  }
+
+  @Override
+  public void setDiagnostics(String diagnostics) {
+    maybeInitBuilder();
+    builder.setDiagnostics(diagnostics);
+  }
+
+  @Override
+  public String getTrackingUrl() {
+    FinishApplicationMasterRequestProtoOrBuilder p = viaProto ? proto : builder;
+    return p.getTrackingUrl();
+  }
+
+  @Override
+  public void setTrackingUrl(String url) {
+    maybeInitBuilder();
+    builder.setTrackingUrl(url);
+  }
+
+  @Override
+  public String getFinalState() {
+    FinishApplicationMasterRequestProtoOrBuilder p = viaProto ? proto : builder;
+    return p.getFinalState();
+  }
+
+  @Override
+  public void setFinalState(String state) {
+    maybeInitBuilder();
+    builder.setFinalState(state);
+  }
+
+  private ApplicationAttemptIdPBImpl convertFromProtoFormat(ApplicationAttemptIdProto p) {
+    return new ApplicationAttemptIdPBImpl(p);
   }
 
-  private ApplicationMasterProto convertToProtoFormat(ApplicationMaster t) {
-    return ((ApplicationMasterPBImpl)t).getProto();
+  private ApplicationAttemptIdProto convertToProtoFormat(ApplicationAttemptId t) {
+    return ((ApplicationAttemptIdPBImpl)t).getProto();
   }
 
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesResponsePBImpl.java Wed Aug  3 11:31:34 2011
@@ -5,10 +5,10 @@ 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.NodeReport;
 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.api.records.impl.pb.NodeReportPBImpl;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeReportProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProtoOrBuilder;
 
@@ -20,7 +20,7 @@ public class GetClusterNodesResponsePBIm
   GetClusterNodesResponseProto.Builder builder = null;
   boolean viaProto = false;
 
-  List<NodeManagerInfo> nodeManagerInfoList;
+  List<NodeReport> nodeManagerInfoList;
   
   public GetClusterNodesResponsePBImpl() {
     builder = GetClusterNodesResponseProto.newBuilder();
@@ -32,15 +32,15 @@ public class GetClusterNodesResponsePBIm
   }
 
   @Override
-  public List<NodeManagerInfo> getNodeManagerList() {    
+  public List<NodeReport> getNodeReports() {    
     initLocalNodeManagerInfosList();
     return this.nodeManagerInfoList;
   }
   
   @Override
-  public void setNodeManagerList(List<NodeManagerInfo> nodeManagers) {
+  public void setNodeReports(List<NodeReport> nodeManagers) {
     if (nodeManagers == null) {
-      builder.clearNodeManagers();
+      builder.clearNodeReports();
     }
     this.nodeManagerInfoList = nodeManagers;
   }
@@ -80,25 +80,25 @@ public class GetClusterNodesResponsePBIm
       return;
     }
     GetClusterNodesResponseProtoOrBuilder p = viaProto ? proto : builder;
-    List<NodeManagerInfoProto> list = p.getNodeManagersList();
-    nodeManagerInfoList = new ArrayList<NodeManagerInfo>();
+    List<NodeReportProto> list = p.getNodeReportsList();
+    nodeManagerInfoList = new ArrayList<NodeReport>();
 
-    for (NodeManagerInfoProto a : list) {
+    for (NodeReportProto a : list) {
       nodeManagerInfoList.add(convertFromProtoFormat(a));
     }
   }
 
   private void addLocalNodeManagerInfosToProto() {
     maybeInitBuilder();
-    builder.clearNodeManagers();
+    builder.clearNodeReports();
     if (nodeManagerInfoList == null)
       return;
-    Iterable<NodeManagerInfoProto> iterable = new Iterable<NodeManagerInfoProto>() {
+    Iterable<NodeReportProto> iterable = new Iterable<NodeReportProto>() {
       @Override
-      public Iterator<NodeManagerInfoProto> iterator() {
-        return new Iterator<NodeManagerInfoProto>() {
+      public Iterator<NodeReportProto> iterator() {
+        return new Iterator<NodeReportProto>() {
 
-          Iterator<NodeManagerInfo> iter = nodeManagerInfoList.iterator();
+          Iterator<NodeReport> iter = nodeManagerInfoList.iterator();
 
           @Override
           public boolean hasNext() {
@@ -106,7 +106,7 @@ public class GetClusterNodesResponsePBIm
           }
 
           @Override
-          public NodeManagerInfoProto next() {
+          public NodeReportProto next() {
             return convertToProtoFormat(iter.next());
           }
 
@@ -119,15 +119,15 @@ public class GetClusterNodesResponsePBIm
 
       }
     };
-    builder.addAllNodeManagers(iterable);
+    builder.addAllNodeReports(iterable);
   }
 
-  private NodeManagerInfoPBImpl convertFromProtoFormat(NodeManagerInfoProto p) {
-    return new NodeManagerInfoPBImpl(p);
+  private NodeReportPBImpl convertFromProtoFormat(NodeReportProto p) {
+    return new NodeReportPBImpl(p);
   }
 
-  private NodeManagerInfoProto convertToProtoFormat(NodeManagerInfo t) {
-    return ((NodeManagerInfoPBImpl)t).getProto();
+  private NodeReportProto convertToProtoFormat(NodeReport t) {
+    return ((NodeReportPBImpl)t).getProto();
   }
 
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/RegisterApplicationMasterRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/RegisterApplicationMasterRequestPBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/RegisterApplicationMasterRequestPBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/RegisterApplicationMasterRequestPBImpl.java Wed Aug  3 11:31:34 2011
@@ -2,10 +2,10 @@ package org.apache.hadoop.yarn.api.proto
 
 
 import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest;
-import org.apache.hadoop.yarn.api.records.ApplicationMaster;
+import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ProtoBase;
-import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationMasterPBImpl;
-import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationMasterProto;
+import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationAttemptIdProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterRequestProto;
 import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterRequestProtoOrBuilder;
 
@@ -16,7 +16,7 @@ public class RegisterApplicationMasterRe
   RegisterApplicationMasterRequestProto.Builder builder = null;
   boolean viaProto = false;
   
-  private ApplicationMaster applicationMaster = null;
+  private ApplicationAttemptId applicationAttemptId = null;
   
   
   public RegisterApplicationMasterRequestPBImpl() {
@@ -36,8 +36,8 @@ public class RegisterApplicationMasterRe
   }
 
   private void mergeLocalToBuilder() {
-    if (this.applicationMaster != null && !((ApplicationMasterPBImpl)this.applicationMaster).getProto().equals(builder.getApplicationMaster())) {
-      builder.setApplicationMaster(convertToProtoFormat(this.applicationMaster));
+    if (this.applicationAttemptId != null && !((ApplicationAttemptIdPBImpl)this.applicationAttemptId).getProto().equals(builder.getApplicationAttemptId())) {
+      builder.setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId));
     }
   }
 
@@ -58,34 +58,68 @@ public class RegisterApplicationMasterRe
     
   
   @Override
-  public ApplicationMaster getApplicationMaster() {
+  public ApplicationAttemptId getApplicationAttemptId() {
     RegisterApplicationMasterRequestProtoOrBuilder p = viaProto ? proto : builder;
-    if (this.applicationMaster != null) {
-      return this.applicationMaster;
+    if (this.applicationAttemptId != null) {
+      return this.applicationAttemptId;
     }
-    if (!p.hasApplicationMaster()) {
+    if (!p.hasApplicationAttemptId()) {
       return null;
     }
-    this.applicationMaster = convertFromProtoFormat(p.getApplicationMaster());
-    return this.applicationMaster;
+    this.applicationAttemptId = convertFromProtoFormat(p.getApplicationAttemptId());
+    return this.applicationAttemptId;
   }
 
   @Override
-  public void setApplicationMaster(ApplicationMaster applicationMaster) {
+  public void setApplicationAttemptId(ApplicationAttemptId applicationMaster) {
     maybeInitBuilder();
     if (applicationMaster == null) 
-      builder.clearApplicationMaster();
-    this.applicationMaster = applicationMaster;
+      builder.clearApplicationAttemptId();
+    this.applicationAttemptId = applicationMaster;
   }
 
-  private ApplicationMasterPBImpl convertFromProtoFormat(ApplicationMasterProto p) {
-    return new ApplicationMasterPBImpl(p);
+  @Override
+  public String getHost() {
+    RegisterApplicationMasterRequestProtoOrBuilder p = viaProto ? proto : builder;
+    return p.getHost();
+  }
+
+  @Override
+  public void setHost(String host) {
+    maybeInitBuilder();
+    builder.setHost(host);
+  }
+
+  @Override
+  public int getRpcPort() {
+    RegisterApplicationMasterRequestProtoOrBuilder p = viaProto ? proto : builder;
+    return p.getRpcPort();
+  }
+
+  @Override
+  public void setRpcPort(int port) {
+    maybeInitBuilder();
+    builder.setRpcPort(port);
   }
 
-  private ApplicationMasterProto convertToProtoFormat(ApplicationMaster t) {
-    return ((ApplicationMasterPBImpl)t).getProto();
+  @Override
+  public String getTrackingUrl() {
+    RegisterApplicationMasterRequestProtoOrBuilder p = viaProto ? proto : builder;
+    return p.getTrackingUrl();
   }
 
+  @Override
+  public void setTrackingUrl(String url) {
+    maybeInitBuilder();
+    builder.setTrackingUrl(url);
+  }
 
+  private ApplicationAttemptIdPBImpl convertFromProtoFormat(ApplicationAttemptIdProto p) {
+    return new ApplicationAttemptIdPBImpl(p);
+  }
+
+  private ApplicationAttemptIdProto convertToProtoFormat(ApplicationAttemptId t) {
+    return ((ApplicationAttemptIdPBImpl)t).getProto();
+  }
 
 }  

Added: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationAttemptId.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationAttemptId.java?rev=1153430&view=auto
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationAttemptId.java (added)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationAttemptId.java Wed Aug  3 11:31:34 2011
@@ -0,0 +1,10 @@
+package org.apache.hadoop.yarn.api.records;
+
+public interface ApplicationAttemptId extends Comparable<ApplicationAttemptId>{
+  public abstract ApplicationId getApplicationId();
+  public abstract int getAttemptId();
+  
+  public abstract void setApplicationId(ApplicationId appID);
+  public abstract void setAttemptId(int attemptId);
+  
+}

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationReport.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationReport.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationReport.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationReport.java Wed Aug  3 11:31:34 2011
@@ -41,15 +41,9 @@ public interface ApplicationReport {
   String getClientToken();
   void setClientToken(String clientToken);
 
-  ApplicationStatus getStatus();
-  void setStatus(ApplicationStatus status);
-
   ApplicationState getState();
   void setState(ApplicationState state);
 
-  Container getMasterContainer();
-  void setMasterContainer(Container masterContainer);
-
   String getDiagnostics();
   void setDiagnostics(String diagnostics);
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationState.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationState.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationState.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationState.java Wed Aug  3 11:31:34 2011
@@ -19,16 +19,5 @@
 package org.apache.hadoop.yarn.api.records;
 
 public enum ApplicationState {
-  PENDING, 
-  ALLOCATING, 
-  ALLOCATED, 
-  EXPIRED_PENDING, 
-  LAUNCHING, 
-  LAUNCHED, 
-  RUNNING, 
-  PAUSED, 
-  CLEANUP, 
-  COMPLETED, 
-  KILLED, 
-  FAILED
+  NEW, SUBMITTED, RUNNING, RESTARTING, SUCCEEDED, FAILED, KILLED
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationStatus.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationStatus.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationStatus.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationStatus.java Wed Aug  3 11:31:34 2011
@@ -19,11 +19,11 @@
 package org.apache.hadoop.yarn.api.records;
 
 public interface ApplicationStatus {
+  ApplicationAttemptId getApplicationAttemptId();
   int getResponseId();
-  ApplicationId getApplicationId();
   float getProgress();
-  
+
+  void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId);
   void setResponseId(int id);
-  void setApplicationId(ApplicationId applicationID);
   void setProgress(float progress);
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Container.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Container.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Container.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Container.java Wed Aug  3 11:31:34 2011
@@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.recor
 
 public interface Container extends Comparable<Container> {
   ContainerId getId();
+  NodeId getNodeId();
   String getContainerManagerAddress();
   String getNodeHttpAddress();
   Resource getResource();
@@ -29,6 +30,7 @@ public interface Container extends Compa
   ContainerStatus getContainerStatus();
   
   void setId(ContainerId id);
+  void setNodeId(NodeId nodeId);
   void setContainerManagerAddress(String containerManagerAddress);
   void setNodeHttpAddress(String nodeHttpAddress);
   void setResource(Resource resource);

Copied: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeHealthStatus.java (from r1153017, hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/NodeHealthStatus.java)
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeHealthStatus.java?p2=hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeHealthStatus.java&p1=hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/NodeHealthStatus.java&r1=1153017&r2=1153430&rev=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/NodeHealthStatus.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeHealthStatus.java Wed Aug  3 11:31:34 2011
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.hadoop.yarn.server.api.records;
+package org.apache.hadoop.yarn.api.records;
 
 public interface NodeHealthStatus {
 

Copied: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java (from r1153017, hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java)
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java?p2=hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java&p1=hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java&r1=1153017&r2=1153430&rev=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java Wed Aug  3 11:31:34 2011
@@ -1,6 +1,6 @@
 package org.apache.hadoop.yarn.api.records;
 
-public interface NodeManagerInfo {
+public interface NodeReport {
   String getNodeAddress();
   void setNodeAddress(String nodeAddress);
   String getHttpAddress();
@@ -15,4 +15,6 @@ public interface NodeManagerInfo {
   void setNumContainers(int numContainers);
   NodeId getNodeId();
   void setNodeId(NodeId nodeId);
+  NodeHealthStatus getNodeHealthStatus();
+  void setNodeHealthStatus(NodeHealthStatus nodeHealthStatus);
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java Wed Aug  3 11:31:34 2011
@@ -12,7 +12,6 @@ import org.apache.hadoop.yarn.api.record
 import org.apache.hadoop.yarn.proto.YarnProtos.AMResponseProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.AMResponseProtoOrBuilder;
 import org.apache.hadoop.yarn.proto.YarnProtos.ContainerProto;
-import org.apache.hadoop.yarn.proto.YarnProtos.NodeManagerInfoProtoOrBuilder;
 import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto;
 
 

Added: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationAttemptIdPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationAttemptIdPBImpl.java?rev=1153430&view=auto
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationAttemptIdPBImpl.java (added)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationAttemptIdPBImpl.java Wed Aug  3 11:31:34 2011
@@ -0,0 +1,141 @@
+package org.apache.hadoop.yarn.api.records.impl.pb;
+
+
+import java.text.NumberFormat;
+
+import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationAttemptIdProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationAttemptIdProtoOrBuilder;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto;
+
+public class ApplicationAttemptIdPBImpl extends ProtoBase<ApplicationAttemptIdProto> implements ApplicationAttemptId {
+  ApplicationAttemptIdProto proto = ApplicationAttemptIdProto.getDefaultInstance();
+  ApplicationAttemptIdProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private ApplicationId applicationId = null;
+  protected static final NumberFormat idFormat = NumberFormat.getInstance();
+  static {
+    idFormat.setGroupingUsed(false);
+    idFormat.setMinimumIntegerDigits(4);
+  }
+  
+  protected static final NumberFormat counterFormat = NumberFormat.getInstance();
+  static {
+    counterFormat.setGroupingUsed(false);
+    counterFormat.setMinimumIntegerDigits(6);
+  }
+  
+  
+  public ApplicationAttemptIdPBImpl() {
+    builder = ApplicationAttemptIdProto.newBuilder();
+  }
+
+  public ApplicationAttemptIdPBImpl(ApplicationAttemptIdProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public ApplicationAttemptIdProto getProto() {
+    mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.applicationId != null && !((ApplicationIdPBImpl)applicationId).getProto().equals(builder.getApplicationId())) {
+      builder.setApplicationId(convertToProtoFormat(this.applicationId));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = ApplicationAttemptIdProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public int getAttemptId() {
+    ApplicationAttemptIdProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getAttemptId());
+  }
+
+  @Override
+  public void setAttemptId(int attemptId) {
+    maybeInitBuilder();
+    builder.setAttemptId((attemptId));
+  }
+  @Override
+  public ApplicationId getApplicationId() {
+    ApplicationAttemptIdProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.applicationId != null) {
+      return this.applicationId;
+    }
+    if (!p.hasApplicationId()) {
+      return null;
+    }
+    this.applicationId = convertFromProtoFormat(p.getApplicationId());
+    return this.applicationId;
+  }
+
+  @Override
+  public void setApplicationId(ApplicationId appId) {
+    maybeInitBuilder();
+    if (appId == null) 
+      builder.clearApplicationId();
+    this.applicationId = appId;
+  }
+
+  private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
+    return new ApplicationIdPBImpl(p);
+  }
+
+  private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
+    return ((ApplicationIdPBImpl)t).getProto();
+  }
+
+  @Override
+  public int hashCode() {
+    return getProto().hashCode();
+  }
+
+  @Override
+  public boolean equals(Object other) {
+    if (other.getClass().isAssignableFrom(this.getClass())) {
+      return this.getProto().equals(this.getClass().cast(other).getProto());
+    }
+    return false;
+  }
+
+  @Override
+  public int compareTo(ApplicationAttemptId other) {
+    int compareAppIds = this.getApplicationId().compareTo(
+        other.getApplicationId());
+    if (compareAppIds == 0) {
+      return this.getAttemptId() - other.getAttemptId();
+    } else {
+      return compareAppIds;
+    }
+    
+  }
+  
+  @Override
+  public String toString() {
+    String id = (this.getApplicationId() != null) ? this.getApplicationId().getClusterTimestamp() + "_" +
+        idFormat.format(this.getApplicationId().getId()): "none";
+    return "appattempt_" + id + "_" + counterFormat.format(getAttemptId());
+  }
+}  

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationReportPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationReportPBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationReportPBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationReportPBImpl.java Wed Aug  3 11:31:34 2011
@@ -1,17 +1,14 @@
 package org.apache.hadoop.yarn.api.records.impl.pb;
 
-import org.apache.hadoop.yarn.api.records.ApplicationReport;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ApplicationReport;
 import org.apache.hadoop.yarn.api.records.ApplicationState;
-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.proto.YarnProtos.ApplicationIdProto;
-import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProtoOrBuilder;
 import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProtoOrBuilder;
 import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationStateProto;
-import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationStatusProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ContainerProto;
 import org.apache.hadoop.yarn.util.ProtoUtils;
 
@@ -22,8 +19,6 @@ implements ApplicationReport {
   boolean viaProto = false;
 
   ApplicationId applicationId;
-  ApplicationStatus status;
-  Container masterContainer = null;
 
   public ApplicationReportPBImpl() {
     builder = ApplicationReportProto.newBuilder();
@@ -47,20 +42,6 @@ implements ApplicationReport {
     this.applicationId = convertFromProtoFormat(p.getApplicationId());
     return this.applicationId;
   }
-  
-  @Override
-  public Container getMasterContainer() {
-    if (this.masterContainer != null) {
-      return this.masterContainer;
-    }
-
-    ApplicationReportProtoOrBuilder p = viaProto ? proto : builder;
-    if (!p.hasMasterContainer()) {
-      return null;
-    }
-    this.masterContainer = convertFromProtoFormat(p.getMasterContainer());
-    return this.masterContainer;
-  }
 
   @Override
   public String getTrackingUrl() {
@@ -123,20 +104,6 @@ implements ApplicationReport {
   }
 
   @Override
-  public ApplicationStatus getStatus() {
-    if (this.status != null) {
-      return this.status;
-    }
-
-    ApplicationReportProtoOrBuilder p = viaProto ? proto : builder;
-    if (!p.hasStatus()) {
-      return null;
-    }
-    this.status = convertFromProtoFormat(p.getStatus());
-    return this.status;
-  }
-
-  @Override
   public String getUser() {
     ApplicationReportProtoOrBuilder p = viaProto ? proto : builder;
     if (!p.hasUser()) {
@@ -164,14 +131,6 @@ implements ApplicationReport {
   }
 
   @Override
-  public void setMasterContainer(Container container) {
-    maybeInitBuilder();
-    if (container == null)
-      builder.clearMasterContainer();
-    this.masterContainer = container;
-  }
-
-  @Override
   public void setTrackingUrl(String url) {
     maybeInitBuilder();
     if (url == null) {
@@ -238,14 +197,6 @@ implements ApplicationReport {
   }
 
   @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) {
@@ -279,11 +230,6 @@ implements ApplicationReport {
             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() {
@@ -305,15 +251,6 @@ implements ApplicationReport {
     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);
   }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationStatusPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationStatusPBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationStatusPBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationStatusPBImpl.java Wed Aug  3 11:31:34 2011
@@ -1,10 +1,10 @@
 package org.apache.hadoop.yarn.api.records.impl.pb;
 
 
-import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 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.ApplicationAttemptIdProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationStatusProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationStatusProtoOrBuilder;
 
@@ -15,8 +15,7 @@ public class ApplicationStatusPBImpl ext
   ApplicationStatusProto.Builder builder = null;
   boolean viaProto = false;
   
-  private ApplicationId applicationId = null;
-  
+  private ApplicationAttemptId applicationAttemptId = null;  
   
   
   public ApplicationStatusPBImpl() {
@@ -37,8 +36,8 @@ public class ApplicationStatusPBImpl ext
   }
 
   private void mergeLocalToBuilder() {
-    if (this.applicationId != null && !((ApplicationIdPBImpl)this.applicationId).getProto().equals(builder.getApplicationId())) {
-      builder.setApplicationId(convertToProtoFormat(this.applicationId));
+    if (this.applicationAttemptId != null && !((ApplicationAttemptIdPBImpl)this.applicationAttemptId).getProto().equals(builder.getApplicationAttemptId())) {
+      builder.setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId));
     }
   }
 
@@ -70,29 +69,28 @@ public class ApplicationStatusPBImpl ext
     maybeInitBuilder();
     builder.setResponseId((responseId));
   }
+
   @Override
-  public ApplicationId getApplicationId() {
+  public ApplicationAttemptId getApplicationAttemptId() {
     ApplicationStatusProtoOrBuilder p = viaProto ? proto : builder;
-    if (this.applicationId != null) {
-      return applicationId;
-    } // Else via proto
-    if (!p.hasApplicationId()) {
+    if (this.applicationAttemptId != null) {
+      return this.applicationAttemptId;
+    }
+    if (!p.hasApplicationAttemptId()) {
       return null;
     }
-    applicationId = convertFromProtoFormat(p.getApplicationId());
-    
-    return applicationId;
+    this.applicationAttemptId = convertFromProtoFormat(p.getApplicationAttemptId());
+    return this.applicationAttemptId;
   }
 
   @Override
-  public void setApplicationId(ApplicationId applicationId) {
+  public void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId) {
     maybeInitBuilder();
-    if (applicationId == null) {
-      builder.clearApplicationId();
-    }
-    this.applicationId = applicationId;
-    
+    if (applicationAttemptId == null) 
+      builder.clearApplicationAttemptId();
+    this.applicationAttemptId = applicationAttemptId;
   }
+
   @Override
   public float getProgress() {
     ApplicationStatusProtoOrBuilder p = viaProto ? proto : builder;
@@ -105,12 +103,12 @@ public class ApplicationStatusPBImpl ext
     builder.setProgress((progress));
   }
 
-  private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
-    return new ApplicationIdPBImpl(p);
+  private ApplicationAttemptIdPBImpl convertFromProtoFormat(ApplicationAttemptIdProto p) {
+    return new ApplicationAttemptIdPBImpl(p);
   }
 
-  private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
-    return ((ApplicationIdPBImpl)t).getProto();
+  private ApplicationAttemptIdProto convertToProtoFormat(ApplicationAttemptId t) {
+    return ((ApplicationAttemptIdPBImpl)t).getProto();
   }
 
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java Wed Aug  3 11:31:34 2011
@@ -19,13 +19,12 @@
 package org.apache.hadoop.yarn.api.records.impl.pb;
 
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.yarn.api.records.Container;
 import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.ContainerState;
 import org.apache.hadoop.yarn.api.records.ContainerStatus;
 import org.apache.hadoop.yarn.api.records.ContainerToken;
+import org.apache.hadoop.yarn.api.records.NodeId;
 import org.apache.hadoop.yarn.api.records.ProtoBase;
 import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto;
@@ -34,6 +33,7 @@ import org.apache.hadoop.yarn.proto.Yarn
 import org.apache.hadoop.yarn.proto.YarnProtos.ContainerStateProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ContainerTokenProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto;
 import org.apache.hadoop.yarn.util.ProtoUtils;
 
@@ -46,6 +46,7 @@ public class ContainerPBImpl extends Pro
   boolean viaProto = false;
   
   private ContainerId containerId = null;
+  private NodeId nodeId = null;
   private Resource resource = null;
   private ContainerToken containerToken = null;
   private ContainerStatus containerStatus = null;
@@ -73,6 +74,11 @@ public class ContainerPBImpl extends Pro
             builder.getId())) {
       builder.setId(convertToProtoFormat(this.containerId));
     }
+    if (this.nodeId != null
+        && !((NodeIdPBImpl) nodeId).getProto().equals(
+            builder.getNodeId())) {
+      builder.setNodeId(convertToProtoFormat(this.nodeId));
+    }
     if (this.resource != null
         && !((ResourcePBImpl) this.resource).getProto().equals(
             builder.getResource())) {
@@ -138,12 +144,34 @@ public class ContainerPBImpl extends Pro
   }
 
   @Override
+  public void setNodeId(NodeId nodeId) {
+    maybeInitBuilder();
+    if (nodeId == null)
+      builder.clearNodeId();
+    this.nodeId = nodeId;
+  }
+
+  @Override
+  public NodeId getNodeId() {
+    ContainerProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.nodeId != null) {
+      return this.nodeId;
+    }
+    if (!p.hasNodeId()) {
+      return null;
+    }
+    this.nodeId = convertFromProtoFormat(p.getNodeId());
+    return this.nodeId;
+  }
+
+  @Override
   public void setId(ContainerId id) {
     maybeInitBuilder();
     if (id == null)
       builder.clearId();
     this.containerId = id;
   }
+
   @Override
   public String getContainerManagerAddress() {
     ContainerProtoOrBuilder p = viaProto ? proto : builder;
@@ -256,10 +284,18 @@ public class ContainerPBImpl extends Pro
     return new ContainerIdPBImpl(p);
   }
 
+  private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
+    return new NodeIdPBImpl(p);
+  }
+
   private ContainerIdProto convertToProtoFormat(ContainerId t) {
     return ((ContainerIdPBImpl)t).getProto();
   }
 
+  private NodeIdProto convertToProtoFormat(NodeId t) {
+    return ((NodeIdPBImpl)t).getProto();
+  }
+
   private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
     return new ResourcePBImpl(p);
   }

Copied: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeHealthStatusPBImpl.java (from r1153017, hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/NodeHealthStatusPBImpl.java)
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeHealthStatusPBImpl.java?p2=hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeHealthStatusPBImpl.java&p1=hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/NodeHealthStatusPBImpl.java&r1=1153017&r2=1153430&rev=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/NodeHealthStatusPBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeHealthStatusPBImpl.java Wed Aug  3 11:31:34 2011
@@ -1,9 +1,9 @@
-package org.apache.hadoop.yarn.server.api.records.impl.pb;
+package org.apache.hadoop.yarn.api.records.impl.pb;
 
+import org.apache.hadoop.yarn.api.records.NodeHealthStatus;
 import org.apache.hadoop.yarn.api.records.ProtoBase;
-import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.NodeHealthStatusProto;
-import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.NodeHealthStatusProtoOrBuilder;
-import org.apache.hadoop.yarn.server.api.records.NodeHealthStatus;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeHealthStatusProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeHealthStatusProtoOrBuilder;
 
 public class NodeHealthStatusPBImpl extends ProtoBase<NodeHealthStatusProto>
     implements NodeHealthStatus {

Copied: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeReportPBImpl.java (from r1153017, hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java)
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeReportPBImpl.java?p2=hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeReportPBImpl.java&p1=hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java&r1=1153017&r2=1153430&rev=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeReportPBImpl.java Wed Aug  3 11:31:34 2011
@@ -1,29 +1,32 @@
 package org.apache.hadoop.yarn.api.records.impl.pb;
 
+import org.apache.hadoop.yarn.api.records.NodeHealthStatus;
 import org.apache.hadoop.yarn.api.records.NodeId;
-import org.apache.hadoop.yarn.api.records.NodeManagerInfo;
+import org.apache.hadoop.yarn.api.records.NodeReport;
 import org.apache.hadoop.yarn.api.records.ProtoBase;
 import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeHealthStatusProto;
 import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto;
-import org.apache.hadoop.yarn.proto.YarnProtos.NodeManagerInfoProto;
-import org.apache.hadoop.yarn.proto.YarnProtos.NodeManagerInfoProtoOrBuilder;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeReportProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.NodeReportProtoOrBuilder;
 import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto;
 
-public class NodeManagerInfoPBImpl extends ProtoBase<NodeManagerInfoProto>
-    implements NodeManagerInfo {
+public class NodeReportPBImpl extends ProtoBase<NodeReportProto>
+    implements NodeReport {
 
-  NodeManagerInfoProto proto = NodeManagerInfoProto.getDefaultInstance();
-  NodeManagerInfoProto.Builder builder = null;
-  boolean viaProto = false;
-  NodeId nodeId;
-  Resource used;
-  Resource capability;
+  private NodeReportProto proto = NodeReportProto.getDefaultInstance();
+  private NodeReportProto.Builder builder = null;
+  private boolean viaProto = false;
+  private NodeId nodeId;
+  private Resource used;
+  private Resource capability;
+  private NodeHealthStatus nodeHealthStatus;
   
-  public NodeManagerInfoPBImpl() {
-    builder = NodeManagerInfoProto.newBuilder();
+  public NodeReportPBImpl() {
+    builder = NodeReportProto.newBuilder();
   }
   
-  public NodeManagerInfoPBImpl(NodeManagerInfoProto proto) {
+  public NodeReportPBImpl(NodeReportProto proto) {
     this.proto = proto;
     viaProto = true;
   }
@@ -34,7 +37,7 @@ public class NodeManagerInfoPBImpl exten
       return this.capability;
     }
 
-    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    NodeReportProtoOrBuilder p = viaProto ? proto : builder;
     if (!p.hasCapability()) {
       return null;
     }
@@ -43,26 +46,40 @@ public class NodeManagerInfoPBImpl exten
   }
 
   @Override
+  public NodeHealthStatus getNodeHealthStatus() {
+    if (this.nodeHealthStatus != null) {
+      return this.nodeHealthStatus;
+    }
+
+    NodeReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasNodeHealthStatus()) {
+      return null;
+    }
+    this.nodeHealthStatus = convertFromProtoFormat(p.getNodeHealthStatus());
+    return this.nodeHealthStatus;
+  }
+
+  @Override
   public String getNodeAddress() {
-    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    NodeReportProtoOrBuilder p = viaProto ? proto : builder;
     return (p.hasNodeAddress()) ? p.getNodeAddress() : null;
   }
 
   @Override
   public String getHttpAddress() {
-    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    NodeReportProtoOrBuilder p = viaProto ? proto : builder;
     return (p.hasHttpAddress()) ? p.getHttpAddress() : null;
   }
 
   @Override
   public int getNumContainers() {
-    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    NodeReportProtoOrBuilder p = viaProto ? proto : builder;
     return (p.hasNumContainers()) ? p.getNumContainers() : 0;
   }
 
   @Override
   public String getRackName() {
-    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    NodeReportProtoOrBuilder p = viaProto ? proto : builder;
     return (p.hasRackName()) ? p.getRackName() : null;
   }
 
@@ -72,7 +89,7 @@ public class NodeManagerInfoPBImpl exten
       return this.used;
     }
 
-    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    NodeReportProtoOrBuilder p = viaProto ? proto : builder;
     if (!p.hasUsed()) {
       return null;
     }
@@ -86,7 +103,7 @@ public class NodeManagerInfoPBImpl exten
       return this.nodeId;
     }
     
-    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    NodeReportProtoOrBuilder p = viaProto ? proto : builder;
     if (!p.hasNodeId()) {
       return null;
     }
@@ -111,6 +128,14 @@ public class NodeManagerInfoPBImpl exten
   }
 
   @Override
+  public void setNodeHealthStatus(NodeHealthStatus healthStatus) {
+    maybeInitBuilder();
+    if (healthStatus == null)
+      builder.clearNodeHealthStatus();
+    this.nodeHealthStatus = healthStatus;
+  }
+
+  @Override
   public void setNodeAddress(String nodeAddress) {
     maybeInitBuilder();
     if (nodeAddress == null) {
@@ -159,7 +184,7 @@ public class NodeManagerInfoPBImpl exten
   }
 
   @Override
-  public NodeManagerInfoProto getProto() {
+  public NodeReportProto getProto() {
     mergeLocalToProto();
     proto = viaProto ? proto : builder.build();
     viaProto = true;
@@ -167,6 +192,11 @@ public class NodeManagerInfoPBImpl exten
   }
 
   private void mergeLocalToBuilder() {
+    if (this.nodeId != null
+        && !((NodeIdPBImpl) this.nodeId).getProto().equals(
+            builder.getNodeId())) {
+      builder.setNodeId(convertToProtoFormat(this.nodeId));
+    }
     if (this.used != null
         && !((ResourcePBImpl) this.used).getProto().equals(
             builder.getUsed())) {
@@ -175,7 +205,12 @@ public class NodeManagerInfoPBImpl exten
     if (this.capability != null
         && !((ResourcePBImpl) this.capability).getProto().equals(
             builder.getCapability())) {
-      builder.setCapability(convertToProtoFormat(this.used));
+      builder.setCapability(convertToProtoFormat(this.capability));
+    }
+    if (this.nodeHealthStatus != null
+        && !((NodeHealthStatusPBImpl) this.nodeHealthStatus).getProto().equals(
+            builder.getNodeHealthStatus())) {
+      builder.setNodeHealthStatus(convertToProtoFormat(this.nodeHealthStatus));
     }
   }
 
@@ -189,7 +224,7 @@ public class NodeManagerInfoPBImpl exten
 
   private void maybeInitBuilder() {
     if (viaProto || builder == null) {
-      builder = NodeManagerInfoProto.newBuilder(proto);
+      builder = NodeReportProto.newBuilder(proto);
     }
     viaProto = false;
   }
@@ -211,4 +246,11 @@ public class NodeManagerInfoPBImpl exten
     return ((ResourcePBImpl) r).getProto();
   }
 
+  private NodeHealthStatusPBImpl convertFromProtoFormat(NodeHealthStatusProto p) {
+    return new NodeHealthStatusPBImpl(p);
+  }
+
+  private NodeHealthStatusProto convertToProtoFormat(NodeHealthStatus r) {
+    return ((NodeHealthStatusPBImpl) r).getProto();
+  }
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto Wed Aug  3 11:31:34 2011
@@ -15,6 +15,11 @@ message ApplicationIdProto {
   optional int64 cluster_timestamp = 2;
 }
 
+message ApplicationAttemptIdProto {
+  optional ApplicationIdProto application_id = 1;
+  optional int32 attemptId = 2;
+}
+
 message ContainerIdProto {
   optional ApplicationIdProto app_id = 1;
   optional int32 id = 2;
@@ -39,32 +44,26 @@ message ContainerTokenProto {
 
 message ContainerProto {
   optional ContainerIdProto id = 1;
-  optional string container_manager_address = 2;
-  optional string node_http_address = 3;
-  optional ResourceProto resource = 4;
-  optional ContainerStateProto state = 5;
-  optional ContainerTokenProto container_token = 6;
-  optional ContainerStatusProto container_status = 7;
+  optional NodeIdProto nodeId = 2;
+  optional string container_manager_address = 3;
+  optional string node_http_address = 4;
+  optional ResourceProto resource = 5;
+  optional ContainerStateProto state = 6;
+  optional ContainerTokenProto container_token = 7;
+  optional ContainerStatusProto container_status = 8;
 }
 
 enum ApplicationStateProto {
-  PENDING = 1;
-  ALLOCATING = 2;
-  ALLOCATED = 3;
-  EXPIRED_PENDING=12;
-  LAUNCHING = 4;
-  LAUNCHED = 5;
-  RUNNING = 6;
-  PAUSED = 7;
-  CLEANUP = 8;
-  COMPLETED = 9;
-  KILLED = 10;
-  FAILED = 11;
+  NEW = 1;
+  RUNNING = 2;
+  SUCCEEDED = 3;
+  KILLED = 4;
+  FAILED = 5;
 }
 
 message ApplicationStatusProto {
   optional int32 response_id = 1;
-  optional ApplicationIdProto application_id = 2;
+  optional ApplicationAttemptIdProto application_attempt_id = 2;
   optional float progress = 3;
 }
 
@@ -126,7 +125,13 @@ message NodeIdProto {
   optional int32 id = 1;
 }
 
-message NodeManagerInfoProto {
+message NodeHealthStatusProto {
+  optional bool is_node_healthy = 1;
+  optional string health_report = 2;
+  optional int64 last_health_report_time = 3;
+}
+
+message NodeReportProto {
   optional string nodeAddress = 1;
   optional string httpAddress = 2;
   optional string rackName = 3;
@@ -134,6 +139,7 @@ message NodeManagerInfoProto {
   optional ResourceProto capability = 5;
   optional int32 numContainers = 6;
   optional NodeIdProto nodeId = 7;
+  optional NodeHealthStatusProto node_health_status = 8;
 }
 
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_service_protos.proto
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_service_protos.proto?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_service_protos.proto (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_service_protos.proto Wed Aug  3 11:31:34 2011
@@ -9,7 +9,10 @@ import "yarn_protos.proto";
 /////// AM_RM_Protocol ///////////////////////////////
 //////////////////////////////////////////////////////
 message RegisterApplicationMasterRequestProto {
-  optional ApplicationMasterProto application_master = 1;
+  optional ApplicationAttemptIdProto application_attempt_id = 1;
+  optional string host = 2;
+  optional int32 rpc_port = 3;
+  optional string tracking_url = 4;
 }
 
 message RegisterApplicationMasterResponseProto {
@@ -18,16 +21,21 @@ message RegisterApplicationMasterRespons
 }
 
 message FinishApplicationMasterRequestProto {
-  optional ApplicationMasterProto application_master = 1;
+  optional ApplicationAttemptIdProto application_attempt_id = 1;
+  optional string diagnostics = 2;
+  optional string tracking_url = 3;
+  optional string final_state = 4;
 }
 
 message FinishApplicationMasterResponseProto {
 }
 
 message AllocateRequestProto {
-  optional ApplicationStatusProto application_status = 1;
+  optional ApplicationAttemptIdProto application_attempt_id = 1;
   repeated ResourceRequestProto ask = 2;
   repeated ContainerProto release = 3;
+  optional int32 response_id = 4;
+  optional float progress = 5;
 }
 
 message AllocateResponseProto {
@@ -87,7 +95,7 @@ message GetClusterNodesRequestProto {
 }
 
 message GetClusterNodesResponseProto {
-  repeated NodeManagerInfoProto nodeManagers = 1; 
+  repeated NodeReportProto nodeReports = 1; 
 }
 
 message GetQueueInfoRequestProto {

Added: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/AbstractLivelinessMonitor.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/AbstractLivelinessMonitor.java?rev=1153430&view=auto
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/AbstractLivelinessMonitor.java (added)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/AbstractLivelinessMonitor.java Wed Aug  3 11:31:34 2011
@@ -0,0 +1,122 @@
+/**
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.hadoop.yarn.util;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.yarn.Clock;
+import org.apache.hadoop.yarn.service.AbstractService;
+
+public abstract class AbstractLivelinessMonitor<O> extends AbstractService {
+
+  private static final Log LOG = LogFactory.getLog(AbstractLivelinessMonitor.class);
+
+  //thread which runs periodically to see the last time since a heartbeat is
+  //received.
+  private Thread checkerThread;
+  private volatile boolean stopped;
+  public static int DEFAULT_EXPIRE = 5*60*1000;//5 mins
+  private int expireInterval = DEFAULT_EXPIRE;
+  private int monitorInterval = expireInterval/3;
+
+  private final Clock clock;
+
+  private Map<O, Long> running = new HashMap<O, Long>();
+
+  public AbstractLivelinessMonitor(String name, Clock clock) {
+    super(name);
+    this.clock = clock;
+  }
+
+  @Override
+  public void start() {
+    checkerThread = new Thread(new PingChecker());
+    checkerThread.start();
+    super.start();
+  }
+
+  @Override
+  public void stop() {
+    stopped = true;
+    checkerThread.interrupt();
+    super.stop();
+  }
+
+  protected abstract void expire(O ob);
+
+  protected void setExpireInterval(int expireInterval) {
+    this.expireInterval = expireInterval;
+  }
+
+  protected void setMonitorInterval(int monitorInterval) {
+    this.monitorInterval = monitorInterval;
+  }
+
+  public synchronized void receivedPing(O ob) {
+    //only put for the registered objects
+    if (running.containsKey(ob)) {
+      running.put(ob, clock.getTime());
+    }
+  }
+
+  public synchronized void register(O ob) {
+    running.put(ob, clock.getTime());
+  }
+
+  public synchronized void unregister(O ob) {
+    running.remove(ob);
+  }
+
+  private class PingChecker implements Runnable {
+
+    @Override
+    public void run() {
+      while (!stopped && !Thread.currentThread().isInterrupted()) {
+        synchronized (AbstractLivelinessMonitor.this) {
+          Iterator<Map.Entry<O, Long>> iterator = 
+            running.entrySet().iterator();
+
+          //avoid calculating current time everytime in loop
+          long currentTime = clock.getTime();
+
+          while (iterator.hasNext()) {
+            Map.Entry<O, Long> entry = iterator.next();
+            if (currentTime > entry.getValue() + expireInterval) {
+              iterator.remove();
+              expire(entry.getKey());
+              LOG.info("Expired:" + entry.getKey().toString() + 
+                      " Timed out after " + expireInterval/1000 + " secs");
+            }
+          }
+        }
+        try {
+          Thread.sleep(monitorInterval);
+        } catch (InterruptedException e) {
+          LOG.info(getName() + " thread interrupted");
+          break;
+        }
+      }
+    }
+  }
+
+}

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java Wed Aug  3 11:31:34 2011
@@ -22,18 +22,18 @@ import java.net.URI;
 import java.util.Comparator;
 
 import org.apache.hadoop.yarn.api.records.ApplicationId;
-import org.apache.hadoop.yarn.api.records.ContainerId;
-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.factories.RecordFactory;
+import org.apache.hadoop.yarn.api.records.ApplicationReport;
+import org.apache.hadoop.yarn.api.records.ApplicationState;
 import org.apache.hadoop.yarn.api.records.Container;
 import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.ContainerState;
 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.NodeId;
+import org.apache.hadoop.yarn.api.records.Priority;
 import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.hadoop.yarn.api.records.ResourceRequest;
 import org.apache.hadoop.yarn.factories.RecordFactory;
 import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
 
@@ -54,16 +54,36 @@ public class BuilderUtils {
     }
   }
 
-  public static class ContainerComparator implements
-      java.util.Comparator<Container> {
+  public static class ContainerIdComparator implements
+      java.util.Comparator<ContainerId> {
 
     @Override
-    public int compare(Container c1,
-        Container c2) {
+    public int compare(ContainerId c1,
+        ContainerId c2) {
       return c1.compareTo(c2);
     }
   }
 
+  public static class ResourceRequestComparator 
+  implements java.util.Comparator<org.apache.hadoop.yarn.api.records.ResourceRequest> {
+    @Override
+    public int compare(org.apache.hadoop.yarn.api.records.ResourceRequest r1,
+        org.apache.hadoop.yarn.api.records.ResourceRequest r2) {
+      
+      // Compare priority, host and capability
+      int ret = r1.getPriority().compareTo(r2.getPriority());
+      if (ret == 0) {
+        String h1 = r1.getHostName();
+        String h2 = r2.getHostName();
+        ret = h1.compareTo(h2);
+      }
+      if (ret == 0) {
+        ret = r1.getCapability().compareTo(r2.getCapability());
+      }
+      return ret;
+    }
+  }
+
   public static LocalResource newLocalResource(RecordFactory recordFactory,
       URI uri, LocalResourceType type, LocalResourceVisibility visibility,
       long size, long timestamp) {
@@ -124,6 +144,7 @@ public class BuilderUtils {
     Container container = recordFactory.newRecordInstance(Container.class);
     container.setId(c.getId());
     container.setContainerToken(c.getContainerToken());
+    container.setNodeId(c.getNodeId());
     container.setContainerManagerAddress(c.getContainerManagerAddress());
     container.setNodeHttpAddress(c.getNodeHttpAddress());
     container.setResource(c.getResource());
@@ -132,24 +153,65 @@ public class BuilderUtils {
   }
 
   public static Container newContainer(RecordFactory recordFactory,
-      ApplicationId applicationId, int containerId,
+      ApplicationId applicationId, int containerId, NodeId nodeId,
       String containerManagerAddress, String nodeHttpAddress,
       Resource resource) {
     ContainerId containerID =
         newContainerId(recordFactory, applicationId, containerId);
-    return newContainer(containerID, containerManagerAddress,
+    return newContainer(containerID, nodeId, containerManagerAddress,
         nodeHttpAddress, resource);
   }
 
-  public static Container newContainer(ContainerId containerId,
+  public static Container newContainer(ContainerId containerId, NodeId nodeId,
       String containerManagerAddress, String nodeHttpAddress,
       Resource resource) {
     Container container = recordFactory.newRecordInstance(Container.class);
     container.setId(containerId);
+    container.setNodeId(nodeId);
     container.setContainerManagerAddress(containerManagerAddress);
     container.setNodeHttpAddress(nodeHttpAddress);
     container.setResource(resource);
     container.setState(ContainerState.INITIALIZING);
     return container;
   }
+
+  public static ResourceRequest newResourceRequest(Priority priority,
+      String hostName, Resource capability, int numContainers) {
+    ResourceRequest request = recordFactory
+        .newRecordInstance(ResourceRequest.class);
+    request.setPriority(priority);
+    request.setHostName(hostName);
+    request.setCapability(capability);
+    request.setNumContainers(numContainers);
+    return request;
+  }
+
+  public static ResourceRequest newResourceRequest(ResourceRequest r) {
+    ResourceRequest request = recordFactory
+        .newRecordInstance(ResourceRequest.class);
+    request.setPriority(r.getPriority());
+    request.setHostName(r.getHostName());
+    request.setCapability(r.getCapability());
+    request.setNumContainers(r.getNumContainers());
+    return request;
+  }
+
+  public static ApplicationReport newApplicationReport(
+      ApplicationId applicationId, String user, String queue, String name,
+      String host, int rpcPort, String clientToken, ApplicationState state,
+      String diagnostics, String url) {
+    ApplicationReport report = recordFactory
+        .newRecordInstance(ApplicationReport.class);
+    report.setApplicationId(applicationId);
+    report.setUser(user);
+    report.setQueue(queue);
+    report.setName(name);
+    report.setHost(host);
+    report.setRpcPort(rpcPort);
+    report.setClientToken(clientToken);
+    report.setState(state);
+    report.setDiagnostics(diagnostics);
+    report.setTrackingUrl(url);
+    return report;
+  }
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-common/src/test/java/org/apache/hadoop/yarn/MockApps.java Wed Aug  3 11:31:34 2011
@@ -18,19 +18,20 @@
 
 package org.apache.hadoop.yarn;
 
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Lists;
-
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.hadoop.yarn.api.records.ApplicationReport;
+import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ApplicationReport;
 import org.apache.hadoop.yarn.api.records.ApplicationState;
 import org.apache.hadoop.yarn.api.records.ApplicationStatus;
 import org.apache.hadoop.yarn.api.records.Container;
 import org.apache.hadoop.yarn.util.Records;
 
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+
 /**
  * Utilities to generate fake test apps
  */
@@ -182,6 +183,13 @@ public class MockApps {
     return id;
   }
 
+  public static ApplicationAttemptId newAppAttemptID(ApplicationId appId, int i) {
+    ApplicationAttemptId id = Records.newRecord(ApplicationAttemptId.class);
+    id.setApplicationId(appId);
+    id.setAttemptId(i);
+    return id;
+  }
+
   public static ApplicationStatus newAppStatus() {
     ApplicationStatus status = Records.newRecord(ApplicationStatus.class);
     status.setProgress((float)Math.random());

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/NodeHealthCheckerService.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/NodeHealthCheckerService.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/NodeHealthCheckerService.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/NodeHealthCheckerService.java Wed Aug  3 11:31:34 2011
@@ -31,7 +31,7 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.util.Shell.ExitCodeException;
 import org.apache.hadoop.util.Shell.ShellCommandExecutor;
 import org.apache.hadoop.util.StringUtils;
-import org.apache.hadoop.yarn.server.api.records.NodeHealthStatus;
+import org.apache.hadoop.yarn.api.records.NodeHealthStatus;
 import org.apache.hadoop.yarn.service.AbstractService;
 
 /**

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/HeartbeatResponse.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/HeartbeatResponse.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/HeartbeatResponse.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/HeartbeatResponse.java Wed Aug  3 11:31:34 2011
@@ -20,30 +20,30 @@ package org.apache.hadoop.yarn.server.ap
 import java.util.List;
 
 import org.apache.hadoop.yarn.api.records.ApplicationId;
-import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ContainerId;
 
 public interface HeartbeatResponse {
-  public abstract int getResponseId();
-  public abstract boolean getReboot();
+  int getResponseId();
+  boolean getReboot();
   
-  public abstract List<Container> getContainersToCleanupList();
-  public abstract Container getContainerToCleanup(int index);
-  public abstract int getContainersToCleanupCount();
+  List<ContainerId> getContainersToCleanupList();
+  ContainerId getContainerToCleanup(int index);
+  int getContainersToCleanupCount();
   
-  public abstract List<ApplicationId> getApplicationsToCleanupList();
-  public abstract ApplicationId getApplicationsToCleanup(int index);
-  public abstract int getApplicationsToCleanupCount();
+  List<ApplicationId> getApplicationsToCleanupList();
+  ApplicationId getApplicationsToCleanup(int index);
+  int getApplicationsToCleanupCount();
   
-  public abstract void setResponseId(int responseId);
-  public abstract void setReboot(boolean reboot);
+  void setResponseId(int responseId);
+  void setReboot(boolean reboot);
   
-  public abstract void addAllContainersToCleanup(List<Container> containers);
-  public abstract void addContainerToCleanup(Container container);
-  public abstract void removeContainerToCleanup(int index);
-  public abstract void clearContainersToCleanup();
+  void addAllContainersToCleanup(List<ContainerId> containers);
+  void addContainerToCleanup(ContainerId container);
+  void removeContainerToCleanup(int index);
+  void clearContainersToCleanup();
   
-  public abstract void addAllApplicationsToCleanup(List<ApplicationId> applications);
-  public abstract void addApplicationToCleanup(ApplicationId applicationId);
-  public abstract void removeApplicationToCleanup(int index);
-  public abstract void clearApplicationsToCleanup();
+  void addAllApplicationsToCleanup(List<ApplicationId> applications);
+  void addApplicationToCleanup(ApplicationId applicationId);
+  void removeApplicationToCleanup(int index);
+  void clearApplicationsToCleanup();
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/NodeStatus.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/NodeStatus.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/NodeStatus.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/NodeStatus.java Wed Aug  3 11:31:34 2011
@@ -20,7 +20,9 @@ package org.apache.hadoop.yarn.server.ap
 import java.util.List;
 import java.util.Map;
 
+import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.NodeHealthStatus;
 import org.apache.hadoop.yarn.api.records.NodeId;
 
 
@@ -29,8 +31,8 @@ public interface NodeStatus {
   public abstract NodeId getNodeId();
   public abstract int getResponseId();
   
-  public abstract Map<String, List<Container>> getAllContainers();
-  public abstract List<Container> getContainers(String key);
+  public abstract Map<ApplicationId, List<Container>> getAllContainers();
+  public abstract List<Container> getContainers(ApplicationId key);
 
   NodeHealthStatus getNodeHealthStatus();
   void setNodeHealthStatus(NodeHealthStatus healthStatus);
@@ -38,8 +40,8 @@ public interface NodeStatus {
   public abstract void setNodeId(NodeId nodeId);
   public abstract void setResponseId(int responseId);
   
-  public abstract void addAllContainers(Map<String, List<Container>> containers);
-  public abstract void setContainers(String key, List<Container> containers);
-  public abstract void removeContainers(String key);
+  public abstract void addAllContainers(Map<ApplicationId, List<Container>> containers);
+  public abstract void setContainers(ApplicationId key, List<Container> containers);
+  public abstract void removeContainers(ApplicationId key);
   public abstract void clearContainers();
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/HeartbeatResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/HeartbeatResponsePBImpl.java?rev=1153430&r1=1153429&r2=1153430&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/HeartbeatResponsePBImpl.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/HeartbeatResponsePBImpl.java Wed Aug  3 11:31:34 2011
@@ -6,12 +6,12 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.hadoop.yarn.api.records.ApplicationId;
-import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.ProtoBase;
 import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl;
-import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl;
+import org.apache.hadoop.yarn.api.records.impl.pb.ContainerIdPBImpl;
 import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto;
-import org.apache.hadoop.yarn.proto.YarnProtos.ContainerProto;
+import org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto;
 import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.HeartbeatResponseProto;
 import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.HeartbeatResponseProtoOrBuilder;
 import org.apache.hadoop.yarn.server.api.records.HeartbeatResponse;
@@ -23,7 +23,7 @@ public class HeartbeatResponsePBImpl ext
   HeartbeatResponseProto.Builder builder = null;
   boolean viaProto = false;
   
-  private List<Container> containersToCleanup = null;
+  private List<ContainerId> containersToCleanup = null;
   
   private List<ApplicationId> applicationsToCleanup = null;
   
@@ -93,12 +93,12 @@ public class HeartbeatResponsePBImpl ext
     builder.setReboot((reboot));
   }
   @Override
-  public List<Container> getContainersToCleanupList() {
+  public List<ContainerId> getContainersToCleanupList() {
     initContainersToCleanup();
     return this.containersToCleanup;
   }
   @Override
-  public Container getContainerToCleanup(int index) {
+  public ContainerId getContainerToCleanup(int index) {
     initContainersToCleanup();
     return this.containersToCleanup.get(index);
   }
@@ -113,16 +113,16 @@ public class HeartbeatResponsePBImpl ext
       return;
     }
     HeartbeatResponseProtoOrBuilder p = viaProto ? proto : builder;
-    List<ContainerProto> list = p.getContainersToCleanupList();
-    this.containersToCleanup = new ArrayList<Container>();
+    List<ContainerIdProto> list = p.getContainersToCleanupList();
+    this.containersToCleanup = new ArrayList<ContainerId>();
 
-    for (ContainerProto c : list) {
+    for (ContainerIdProto c : list) {
       this.containersToCleanup.add(convertFromProtoFormat(c));
     }
   }
   
   @Override
-  public void addAllContainersToCleanup(final List<Container> containersToCleanup) {
+  public void addAllContainersToCleanup(final List<ContainerId> containersToCleanup) {
     if (containersToCleanup == null)
       return;
     initContainersToCleanup();
@@ -134,12 +134,12 @@ public class HeartbeatResponsePBImpl ext
     builder.clearContainersToCleanup();
     if (containersToCleanup == null)
       return;
-    Iterable<ContainerProto> iterable = new Iterable<ContainerProto>() {
+    Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {
       @Override
-      public Iterator<ContainerProto> iterator() {
-        return new Iterator<ContainerProto>() {
+      public Iterator<ContainerIdProto> iterator() {
+        return new Iterator<ContainerIdProto>() {
 
-          Iterator<Container> iter = containersToCleanup.iterator();
+          Iterator<ContainerId> iter = containersToCleanup.iterator();
 
           @Override
           public boolean hasNext() {
@@ -147,7 +147,7 @@ public class HeartbeatResponsePBImpl ext
           }
 
           @Override
-          public ContainerProto next() {
+          public ContainerIdProto next() {
             return convertToProtoFormat(iter.next());
           }
 
@@ -163,7 +163,7 @@ public class HeartbeatResponsePBImpl ext
     builder.addAllContainersToCleanup(iterable);
   }
   @Override
-  public void addContainerToCleanup(Container containersToCleanup) {
+  public void addContainerToCleanup(ContainerId containersToCleanup) {
     initContainersToCleanup();
     this.containersToCleanup.add(containersToCleanup);
   }
@@ -263,12 +263,12 @@ public class HeartbeatResponsePBImpl ext
     this.applicationsToCleanup.clear();
   }
 
-  private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {
-    return new ContainerPBImpl(p);
+  private ContainerIdPBImpl convertFromProtoFormat(ContainerIdProto p) {
+    return new ContainerIdPBImpl(p);
   }
 
-  private ContainerProto convertToProtoFormat(Container t) {
-    return ((ContainerPBImpl)t).getProto();
+  private ContainerIdProto convertToProtoFormat(ContainerId t) {
+    return ((ContainerIdPBImpl)t).getProto();
   }
 
   private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {



Mime
View raw message