hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1095271 [1/2] - in /hadoop/mapreduce/branches/MR-279: mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/ mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/ ...
Date Wed, 20 Apr 2011 05:38:59 GMT
Author: vinodkv
Date: Wed Apr 20 05:38:57 2011
New Revision: 1095271

URL: http://svn.apache.org/viewvc?rev=1095271&view=rev
Log:
Introducing web-UI for NodeManager and linking it from RM UI. Contributed by Vinod Kumar Vavilapalli.

Added:
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/ResourceView.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllContainersPage.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ApplicationPage.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ContainerPage.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMController.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMView.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebParams.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/WebServer.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServer.java
Removed:
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/WebServer.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ApplicationID.java
Modified:
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto
    hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/ConverterUtils.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerRequest.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerRequestPBImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/proto/yarn_server_common_service_protos.proto
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/CMgrCompletedAppsEvent.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NMConfig.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdater.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/Application.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitor.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/LocalRMInterface.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeStatusUpdater.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/ApplicationsManagerImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/Container.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resourcetracker/NodeInfo.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resourcetracker/RMResourceTrackerImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Application.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/NodeManagerImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/Application.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockNodes.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/NodeManager.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceManager.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestApplicationCleanup.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/resourcetracker/TestNMExpiry.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/resourcetracker/TestRMNMRPCResponseId.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java Wed Apr 20 05:38:57 2011
@@ -121,7 +121,7 @@ public abstract class TaskAttemptImpl im
       EventHandler<TaskAttemptEvent> {
 
   private static final Log LOG = LogFactory.getLog(TaskAttemptImpl.class);
-  private final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
+  private final static RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
 
   protected final Configuration conf;
   protected final Path jobFile;
@@ -610,7 +610,7 @@ public abstract class TaskAttemptImpl im
         }
         container.setLocalResource(
             name.toUri().getPath(),
-            BuilderUtils.newLocalResource(
+            BuilderUtils.newLocalResource(recordFactory,
                 uris[i], type, 
                 visibilities[i]
                   ? LocalResourceVisibility.PUBLIC

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java Wed Apr 20 05:38:57 2011
@@ -209,8 +209,8 @@ public class TestRMContainerAllocator {
     nodeId.setId(0);
     Resource resource = recordFactory.newRecordInstance(Resource.class);
     resource.setMemory(memory);
-    NodeManager nodeManager = new NodeManagerImpl(nodeId, nodeName,
-        RMResourceTrackerImpl.resolve(nodeName), resource
+    NodeManager nodeManager = new NodeManagerImpl(nodeId, nodeName, 
+        "localhost:0", RMResourceTrackerImpl.resolve(nodeName), resource
         );
     scheduler.addNode(nodeManager); // Node registration
     return nodeManager;

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java Wed Apr 20 05:38:57 2011
@@ -362,7 +362,7 @@ public class TypeConverter {
   }
 
   public static TaskTrackerInfo fromYarn(NodeManagerInfo node) {
-    TaskTrackerInfo taskTracker = new TaskTrackerInfo(node.getNodeName());
+    TaskTrackerInfo taskTracker = new TaskTrackerInfo(node.getNodeAddress());
     return taskTracker;
   }
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeManagerInfo.java Wed Apr 20 05:38:57 2011
@@ -1,8 +1,10 @@
 package org.apache.hadoop.yarn.api.records;
 
 public interface NodeManagerInfo {
-  String getNodeName();
-  void setNodeName(String nodeName);
+  String getNodeAddress();
+  void setNodeAddress(String nodeAddress);
+  String getHttpAddress();
+  void setHttpAddress(String httpAddress);
   String getRackName();
   void setRackName(String rackName);
   Resource getUsed();        

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/NodeManagerInfoPBImpl.java Wed Apr 20 05:38:57 2011
@@ -41,9 +41,15 @@ public class NodeManagerInfoPBImpl exten
   }
 
   @Override
-  public String getNodeName() {
+  public String getNodeAddress() {
     NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
-    return (p.hasNodeName()) ? p.getNodeName() : null;
+    return (p.hasNodeAddress()) ? p.getNodeAddress() : null;
+  }
+
+  @Override
+  public String getHttpAddress() {
+    NodeManagerInfoProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.hasHttpAddress()) ? p.getHttpAddress() : null;
   }
 
   @Override
@@ -81,13 +87,23 @@ public class NodeManagerInfoPBImpl exten
   }
 
   @Override
-  public void setNodeName(String nodeName) {
+  public void setNodeAddress(String nodeAddress) {
+    maybeInitBuilder();
+    if (nodeAddress == null) {
+      builder.clearNodeAddress();
+      return;
+    }
+    builder.setNodeAddress(nodeAddress);
+  }
+
+  @Override
+  public void setHttpAddress(String httpAddress) {
     maybeInitBuilder();
-    if (nodeName == null) {
-      builder.clearNodeName();
+    if (httpAddress == null) {
+      builder.clearHttpAddress();
       return;
     }
-    builder.setNodeName(nodeName);
+    builder.setHttpAddress(httpAddress);
   }
 
   @Override

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/proto/yarn_protos.proto Wed Apr 20 05:38:57 2011
@@ -115,11 +115,12 @@ message ApplicationProto {
 }
 
 message NodeManagerInfoProto {
-  optional string nodeName = 1;
-  optional string rackName = 2;
-  optional ResourceProto used = 3;
-  optional ResourceProto capability = 4;
-  optional int32 numContainers = 5;
+  optional string nodeAddress = 1;
+  optional string httpAddress = 2;
+  optional string rackName = 3;
+  optional ResourceProto used = 4;
+  optional ResourceProto capability = 5;
+  optional int32 numContainers = 6;
 }
 
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java Wed Apr 20 05:38:57 2011
@@ -19,11 +19,14 @@
 package org.apache.hadoop.yarn.util;
 
 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.factory.providers.RecordFactoryProvider;
+import org.apache.hadoop.yarn.factories.RecordFactory;
 
 /**
  * Builder utilities to construct various objects.
@@ -31,10 +34,20 @@ import org.apache.hadoop.yarn.factory.pr
  */
 public class BuilderUtils {
 
-  public static LocalResource newLocalResource(URI uri, 
-      LocalResourceType type, LocalResourceVisibility visibility, 
+  public static class ApplicationIdComparator implements
+      Comparator<ApplicationId> {  
+
+    @Override
+    public int compare(ApplicationId a1, ApplicationId a2) {
+      return a1.compareTo(a2);
+    }
+    
+  }
+
+  public static LocalResource newLocalResource(RecordFactory recordFactory,
+      URI uri, LocalResourceType type, LocalResourceVisibility visibility,
       long size, long timestamp) {
-    LocalResource resource = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(LocalResource.class);
+    LocalResource resource = recordFactory.newRecordInstance(LocalResource.class);
     resource.setResource(ConverterUtils.getYarnUrlFromURI(uri));
     resource.setType(type);
     resource.setVisibility(visibility);
@@ -43,4 +56,30 @@ public class BuilderUtils {
     return resource;
   }
 
+  public static ApplicationId newApplicationId(RecordFactory recordFactory,
+      long clustertimestamp, CharSequence id) {
+    ApplicationId applicationId =
+        recordFactory.newRecordInstance(ApplicationId.class);
+    applicationId.setId(Integer.valueOf(id.toString()));
+    applicationId.setClusterTimestamp(clustertimestamp);
+    return applicationId;
+  }
+
+  public static ApplicationId newApplicationId(RecordFactory recordFactory,
+      long clusterTimeStamp, int id) {
+    ApplicationId applicationId =
+        recordFactory.newRecordInstance(ApplicationId.class);
+    applicationId.setId(id);
+    applicationId.setClusterTimestamp(clusterTimeStamp);
+    return applicationId;
+  }
+
+  public static ContainerId newContainerId(RecordFactory recordFactory,
+      ApplicationId applicationId, int containerId) {
+    ContainerId id = recordFactory.newRecordInstance(ContainerId.class);
+    id.setAppId(applicationId);
+    id.setId(containerId);
+    return id;
+  }
+
 }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/ConverterUtils.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/ConverterUtils.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/ConverterUtils.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/util/ConverterUtils.java Wed Apr 20 05:38:57 2011
@@ -18,10 +18,13 @@
 
 package org.apache.hadoop.yarn.util;
 
+import static org.apache.hadoop.yarn.util.StringHelper._split;
+
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.text.NumberFormat;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -29,8 +32,10 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.URL;
+import org.apache.hadoop.yarn.factories.RecordFactory;
 import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
 
+
 /**
  * This class contains a set of utilities which help converting data structures
  * from/to 'serializableFormat' to/from hadoop/nativejava data structures.
@@ -38,6 +43,8 @@ import org.apache.hadoop.yarn.factory.pr
  */
 public class ConverterUtils {
 
+  public static final String APPLICATION_PREFIX = "application";
+
   /**
    * return a hadoop path from a given url
    * 
@@ -111,11 +118,28 @@ public class ConverterUtils {
 
   public static String toString(ApplicationId appId) {
     StringBuilder sb = new StringBuilder();
-    sb.append("application_").append(appId.getClusterTimestamp()).append("_");
+    sb.append(APPLICATION_PREFIX + "_").append(appId.getClusterTimestamp())
+        .append("_");
     sb.append(appIdFormat.get().format(appId.getId()));
     return sb.toString();
   }
 
+  public static ApplicationId toApplicationId(RecordFactory recordFactory,
+      String appIdStr) {
+    Iterator<String> it = _split(appIdStr).iterator();
+    it.next(); // prefix. TODO: Validate application prefix
+    return toApplicationId(recordFactory, it);
+  }
+
+  private static ApplicationId toApplicationId(RecordFactory recordFactory,
+      Iterator<String> it) {
+    ApplicationId appId =
+        recordFactory.newRecordInstance(ApplicationId.class);
+    appId.setClusterTimestamp(Long.parseLong(it.next()));
+    appId.setId(Integer.parseInt(it.next()));
+    return appId;
+  }
+
   public static String toString(ContainerId cId) {
     StringBuilder sb = new StringBuilder();
     ApplicationId appId = cId.getAppId();
@@ -124,4 +148,16 @@ public class ConverterUtils {
     sb.append(containerIdFormat.get().format(cId.getId()));
     return sb.toString();
   }
+
+  public static ContainerId toContainerId(RecordFactory recordFactory,
+      String containerIdStr) {
+    Iterator<String> it = _split(containerIdStr).iterator();
+    it.next(); // prefix. TODO: Validate container prefix
+    ApplicationId appID = toApplicationId(recordFactory, it);
+    ContainerId containerId =
+        recordFactory.newRecordInstance(ContainerId.class);
+    containerId.setAppId(appID);
+    containerId.setId(Integer.parseInt(it.next()));
+    return containerId;
+  }
 }
\ No newline at end of file

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerRequest.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerRequest.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerRequest.java Wed Apr 20 05:38:57 2011
@@ -1,11 +1,33 @@
+/**
+* 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.server.api.protocolrecords;
 
 import org.apache.hadoop.yarn.api.records.Resource;
 
 public interface RegisterNodeManagerRequest {
-  public abstract String getNode();
-  public abstract Resource getResource();
+  String getHost();
+  int getContainerManagerPort();
+  int getHttpPort();
+  Resource getResource();
   
-  public abstract void setNode(String node);
-  public abstract void setResource(Resource resource);
+  void setHost(String host);
+  void setContainerManagerPort(int port);
+  void setHttpPort(int port);
+  void setResource(Resource resource);
 }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerRequestPBImpl.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerRequestPBImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerRequestPBImpl.java Wed Apr 20 05:38:57 2011
@@ -77,21 +77,52 @@ public class RegisterNodeManagerRequestP
       builder.clearResource();
     this.resource = resource;
   }
+
+  @Override
+  public int getContainerManagerPort() {
+    RegisterNodeManagerRequestProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasContainerManagerPort()) {
+      return 0;
+    }
+    return (p.getContainerManagerPort());
+  }
+
+  @Override
+  public void setContainerManagerPort(int port) {
+    maybeInitBuilder();
+    builder.setContainerManagerPort(port);
+  }
+
+  @Override
+  public int getHttpPort() {
+    RegisterNodeManagerRequestProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasHttpPort()) {
+      return 0;
+    }
+    return (p.getHttpPort());
+  }
+
+  @Override
+  public void setHttpPort(int httpPort) {
+    maybeInitBuilder();
+    builder.setHttpPort(httpPort);
+  }
+
   @Override
-  public String getNode() {
+  public String getHost() {
     RegisterNodeManagerRequestProtoOrBuilder p = viaProto ? proto : builder;
-    if (!p.hasNode()) {
+    if (!p.hasHost()) {
       return null;
     }
-    return (p.getNode());
+    return (p.getHost());
   }
 
   @Override
-  public void setNode(String node) {
+  public void setHost(String host) {
     maybeInitBuilder();
-    if (node == null) 
-      builder.clearNode();
-    builder.setNode((node));
+    if (host == null) 
+      builder.clearHost();
+    builder.setHost((host));
   }
 
   private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/proto/yarn_server_common_service_protos.proto
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/proto/yarn_server_common_service_protos.proto?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/proto/yarn_server_common_service_protos.proto (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-common/src/main/proto/yarn_server_common_service_protos.proto Wed Apr 20 05:38:57 2011
@@ -7,8 +7,10 @@ import "yarn_protos.proto";
 import "yarn_server_common_protos.proto";
 
 message RegisterNodeManagerRequestProto {
-  optional string node = 1;
-  optional ResourceProto resource = 2;
+  optional string host = 1;
+  optional int32 container_manager_port = 2;
+  optional int32 http_port = 3;
+  optional ResourceProto resource = 4;
 }
 message RegisterNodeManagerResponseProto {
   optional RegistrationResponseProto registration_response = 1;

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/CMgrCompletedAppsEvent.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/CMgrCompletedAppsEvent.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/CMgrCompletedAppsEvent.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/CMgrCompletedAppsEvent.java Wed Apr 20 05:38:57 2011
@@ -26,7 +26,7 @@ import org.apache.hadoop.yarn.server.nod
 
 public class CMgrCompletedAppsEvent extends ContainerManagerEvent {
 
-  private List<ApplicationId> appsToCleanup;
+  private final List<ApplicationId> appsToCleanup;
 
   public CMgrCompletedAppsEvent(List<ApplicationId> appsToCleanup) {
     super(ContainerManagerEventType.FINISH_APPS);

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NMConfig.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NMConfig.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NMConfig.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NMConfig.java Wed Apr 20 05:38:57 2011
@@ -32,6 +32,11 @@ public class NMConfig {
   /** host:port address to which to bind to **/
   public static final String NM_BIND_ADDRESS = NM_PREFIX + "address";
 
+  public static final String DEFAULT_NM_HTTP_BIND_ADDRESS = "localhost:9999";
+
+  /** host:port address to which webserver has to bind to **/
+  public static final String NM_HTTP_BIND_ADDRESS = NM_PREFIX + "http-address";
+
   public static final String DEFAULT_NM_LOCALIZER_BIND_ADDRESS = "0.0.0.0:4344";
 
   public static final String NM_LOCALIZER_BIND_ADDRESS =

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java Wed Apr 20 05:38:57 2011
@@ -37,13 +37,14 @@ import org.apache.hadoop.yarn.api.record
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.event.AsyncDispatcher;
 import org.apache.hadoop.yarn.event.Dispatcher;
-import org.apache.hadoop.yarn.factories.RecordFactory;
 import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
 import org.apache.hadoop.yarn.server.YarnServerConfig;
 import org.apache.hadoop.yarn.server.api.records.NodeHealthStatus;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.ContainerManagerImpl;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
+import org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitor;
+import org.apache.hadoop.yarn.server.nodemanager.webapp.WebServer;
 import org.apache.hadoop.yarn.service.CompositeService;
 import org.apache.hadoop.yarn.service.Service;
 
@@ -62,7 +63,7 @@ public class NodeManager extends Composi
     addService(del);
 
     // NodeManager level dispatcher
-    Dispatcher dispatcher = new AsyncDispatcher();
+    AsyncDispatcher dispatcher = new AsyncDispatcher();
 
     NodeHealthCheckerService healthChecker = null;
     if (NodeHealthCheckerService.shouldRun(conf)) {
@@ -84,10 +85,12 @@ public class NodeManager extends Composi
         createContainerManager(context, exec, del, nodeStatusUpdater);
     addService(containerManager);
 
-    Service webServer = createWebServer();
+    Service webServer =
+        createWebServer(context, containerManager.getContainersMonitor());
     addService(webServer);
 
     dispatcher.register(ContainerManagerEventType.class, containerManager);
+    addService(dispatcher);
   }
 
   protected NodeStatusUpdater createNodeStatusUpdater(Context context,
@@ -105,8 +108,9 @@ public class NodeManager extends Composi
     return new ContainerManagerImpl(context, exec, del, nodeStatusUpdater);
   }
 
-  protected WebServer createWebServer() {
-    return new WebServer();
+  protected WebServer createWebServer(Context nmContext,
+      ResourceView resourceView) {
+    return new WebServer(nmContext, resourceView);
   }
 
   protected void doSecureLogin() throws IOException {

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdater.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdater.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdater.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdater.java Wed Apr 20 05:38:57 2011
@@ -24,7 +24,7 @@ public interface NodeStatusUpdater exten
 
   byte[] getRMNMSharedSecret();
 
-  String getNodeName();
+  String getContainerManagerBindAddress();
 
   void sendOutofBandHeartBeat();
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java Wed Apr 20 05:38:57 2011
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.nodemanager;
 
+import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -63,14 +64,17 @@ public class NodeStatusUpdaterImpl exten
 
   private final Object heartbeatMonitor = new Object();
 
-  private Context context;
-  private Dispatcher dispatcher;
+  private final Context context;
+  private final Dispatcher dispatcher;
 
   private long heartBeatInterval;
   private ResourceTracker resourceTracker;
   private String rmAddress;
   private Resource totalResource;
-  private String nodeName;
+  private String containerManagerBindAddress;
+  private String hostName;
+  private int containerManagerPort;
+  private int httpPort;
   private NodeId nodeId;
   private byte[] secretKeyBytes = new byte[0];
   private boolean isStopped;
@@ -102,15 +106,24 @@ public class NodeStatusUpdaterImpl exten
 
   @Override
   public void start() {
-    String bindAddress =
+    String cmBindAddressStr =
         getConfig().get(NMConfig.NM_BIND_ADDRESS,
             NMConfig.DEFAULT_NM_BIND_ADDRESS);
-    InetSocketAddress addr = NetUtils.createSocketAddr(bindAddress);
+    InetSocketAddress cmBindAddress =
+        NetUtils.createSocketAddr(cmBindAddressStr);
+    String httpBindAddressStr =
+      getConfig().get(NMConfig.NM_HTTP_BIND_ADDRESS,
+          NMConfig.DEFAULT_NM_HTTP_BIND_ADDRESS);
+    InetSocketAddress httpBindAddress =
+      NetUtils.createSocketAddr(httpBindAddressStr);
     try {
-      this.nodeName =
-          addr.getAddress().getLocalHost().getHostAddress() + ":"
-              + addr.getPort();
-      LOG.info("Configured ContainerManager Address is " + this.nodeName);
+      this.hostName = InetAddress.getLocalHost().getHostAddress();
+      this.containerManagerPort = cmBindAddress.getPort();
+      this.httpPort = httpBindAddress.getPort();
+      this.containerManagerBindAddress =
+          this.hostName + ":" + this.containerManagerPort;
+      LOG.info("Configured ContainerManager Address is "
+          + this.containerManagerBindAddress);
       // Registration has to be in start so that ContainerManager can get the
       // perNM tokens needed to authenticate ContainerTokens.
       registerWithRM();
@@ -143,7 +156,9 @@ public class NodeStatusUpdaterImpl exten
     LOG.info("Connected to ResourceManager at " + this.rmAddress);
     
     RegisterNodeManagerRequest request = recordFactory.newRecordInstance(RegisterNodeManagerRequest.class);
-    request.setNode(this.nodeName);
+    request.setHost(this.hostName);
+    request.setContainerManagerPort(this.containerManagerPort);
+    request.setHttpPort(this.httpPort);
     request.setResource(this.totalResource);
     RegistrationResponse regResponse =
         this.resourceTracker.registerNodeManager(request).getRegistrationResponse();
@@ -152,13 +167,13 @@ public class NodeStatusUpdaterImpl exten
       this.secretKeyBytes = regResponse.getSecretKey().array();
     }
 
-    LOG.info("Registered with ResourceManager as " + this.nodeName
+    LOG.info("Registered with ResourceManager as " + this.containerManagerBindAddress
         + " with total resource of " + this.totalResource);
   }
 
   @Override
-  public String getNodeName() {
-    return this.nodeName;
+  public String getContainerManagerBindAddress() {
+    return this.containerManagerBindAddress;
   }
 
   @Override
@@ -192,7 +207,7 @@ public class NodeStatusUpdaterImpl exten
 
         // Clone the container to send it to the RM
         org.apache.hadoop.yarn.api.records.Container c = container.cloneAndGetContainer();
-        c.setHostName(this.nodeName);
+        c.setHostName(this.containerManagerBindAddress);
         applicationContainers.add(c);
         ++numActiveContainers;
         LOG.info("Sending out status for container: " + c);
@@ -206,7 +221,7 @@ public class NodeStatusUpdaterImpl exten
       }
     }
 
-    LOG.debug(this.nodeName + " sending out status for " + numActiveContainers
+    LOG.debug(this.containerManagerBindAddress + " sending out status for " + numActiveContainers
         + " containers");
 
     NodeHealthStatus nodeHealthStatus = this.context.getNodeHealthStatus();

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/ResourceView.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/ResourceView.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/ResourceView.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/ResourceView.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,26 @@
+/**
+* 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.server.nodemanager;
+
+public interface ResourceView {
+
+  long getVmemAllocatedForContainers();
+
+  long getPmemAllocatedForContainers();
+}

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java Wed Apr 20 05:38:57 2011
@@ -90,6 +90,7 @@ public class ContainerManagerImpl extend
   private static final Log LOG = LogFactory.getLog(ContainerManagerImpl.class);
 
   final Context context;
+  private final ContainersMonitor containersMonitor;
   private Server server;
   private InetSocketAddress cmAddr;
   private final ResourceLocalizationService rsrcLocalizationSrvc;
@@ -103,7 +104,7 @@ public class ContainerManagerImpl extend
   
   protected AsyncDispatcher dispatcher;
 
-  private DeletionService deletionService;
+  private final DeletionService deletionService;
 
   public ContainerManagerImpl(Context context, ContainerExecutor exec,
       DeletionService deletionContext, NodeStatusUpdater nodeStatusUpdater) {
@@ -132,9 +133,9 @@ public class ContainerManagerImpl extend
     auxiluaryServices.register(this);
     addService(auxiluaryServices);
 
-    ContainersMonitor containersMonitor =
+    this.containersMonitor =
         new ContainersMonitorImpl(exec, dispatcher);
-    addService(containersMonitor);
+    addService(this.containersMonitor);
 
     dispatcher.register(ContainerEventType.class,
         new ContainerEventDispatcher());
@@ -147,6 +148,10 @@ public class ContainerManagerImpl extend
     addService(dispatcher);
   }
 
+  public ContainersMonitor getContainersMonitor() {
+    return this.containersMonitor;
+  }
+
   protected ResourceLocalizationService createResourceLocalizationService(
       ContainerExecutor exec, DeletionService deletionContext) {
     return new ResourceLocalizationService(this.dispatcher, exec,
@@ -179,7 +184,7 @@ public class ContainerManagerImpl extend
       // RM gives the shared secret in registration during StatusUpdter#start()
       // itself.
       this.containerTokenSecretManager.setSecretKey(
-          this.nodeStatusUpdater.getNodeName(),
+          this.nodeStatusUpdater.getContainerManagerBindAddress(),
           this.nodeStatusUpdater.getRMNMSharedSecret());
     }
     server =

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/Application.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/Application.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/Application.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/Application.java Wed Apr 20 05:38:57 2011
@@ -24,9 +24,11 @@ import java.util.Map;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.security.Credentials;
 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.LocalResourceVisibility;
 import org.apache.hadoop.yarn.event.EventHandler;
+import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
 
 
 public interface Application extends EventHandler<ApplicationEvent> {
@@ -39,6 +41,8 @@ public interface Application extends Eve
 
   String getUser();
 
+  Map<ContainerId, Container> getContainers();
+
   ApplicationId getAppId();
 
   ApplicationState getApplicationState();

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java Wed Apr 20 05:38:57 2011
@@ -115,6 +115,11 @@ public class ApplicationImpl implements 
   }
 
   @Override
+  public Map<ContainerId, Container> getContainers() {
+    return this.containers;
+  }
+
+  @Override
   public Map<String, String> getEnvironment() {
     return env;
   }
@@ -346,10 +351,10 @@ public class ApplicationImpl implements 
       if (app.containers.isEmpty()) {
         // All containers are cleanedup.
         app.handleAppFinishWithContainersCleanedup();
-        return ApplicationState.FINISHING_CONTAINERS_WAIT;
+        return ApplicationState.APPLICATION_RESOURCES_CLEANINGUP;
       }
 
-      return ApplicationState.APPLICATION_RESOURCES_CLEANINGUP;
+      return ApplicationState.FINISHING_CONTAINERS_WAIT;
     }
 
   }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitor.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitor.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitor.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitor.java Wed Apr 20 05:38:57 2011
@@ -19,9 +19,10 @@
 package org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor;
 
 import org.apache.hadoop.yarn.event.EventHandler;
+import org.apache.hadoop.yarn.server.nodemanager.ResourceView;
 import org.apache.hadoop.yarn.service.Service;
 
 public interface ContainersMonitor extends Service,
-    EventHandler<ContainersMonitorEvent> {
+    EventHandler<ContainersMonitorEvent>, ResourceView {
 
 }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java Wed Apr 20 05:38:57 2011
@@ -465,6 +465,16 @@ public class ContainersMonitorImpl exten
   }
 
   @Override
+  public long getVmemAllocatedForContainers() {
+    return this.maxVmemAllottedForContainers;
+  }
+
+  @Override
+  public long getPmemAllocatedForContainers() {
+    return this.maxPmemAllottedForContainers;
+  }
+
+  @Override
   public void handle(ContainersMonitorEvent monitoringEvent) {
 
     if (!(doCheckPhysicalMemory() || doCheckVirtualMemory())) {

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,101 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES_ID;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.tableInit;
+
+import java.util.Map.Entry;
+
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.server.nodemanager.Context;
+import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application;
+import org.apache.hadoop.yarn.util.ConverterUtils;
+import org.apache.hadoop.yarn.webapp.SubView;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.BODY;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TBODY;
+import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
+
+import com.google.inject.Inject;
+
+public class AllApplicationsPage extends NMView {
+
+  @Override protected void preHead(Page.HTML<_> html) {
+    commonPreHead(html);
+    setTitle("Applications running on this node");
+    set(DATATABLES_ID, "applications");
+    set(initID(DATATABLES, "applications"), appsTableInit());
+    setTableStyles(html, "applications");
+  }
+
+  private String appsTableInit() {
+    return tableInit().
+        // applicationid, applicationstate
+        append(", aoColumns:[null, null]} ").toString();
+  }
+
+  @Override
+  protected Class<? extends SubView> content() {
+    return AllApplicationsBlock.class;
+  }
+
+  public static class AllApplicationsBlock extends HtmlBlock implements
+      NMWebParams {
+
+    private final Context nmContext;
+
+    @Inject
+    public AllApplicationsBlock(Context nmContext) {
+      this.nmContext = nmContext;
+    }
+
+    @Override
+    protected void render(Block html) {
+
+      TBODY<TABLE<BODY<Hamlet>>> tableBody =
+        html
+          .body()
+            .table("#applications")
+              .thead()
+                .tr()
+                  .td()._("ApplicationId")._()
+                  .td()._("ApplicationState")._()
+                ._()
+               ._()
+               .tbody();
+      for (Entry<ApplicationId, Application> entry : this.nmContext
+          .getApplications().entrySet()) {
+        ApplicationId appId = entry.getKey();
+        Application app = entry.getValue();
+        String appIdStr = ConverterUtils.toString(appId);
+        tableBody
+          .tr()
+            .td().a(url($(NM_HTTP_URL), "yarn", "application", appIdStr), appIdStr)._()
+            .td()._(app.getApplicationState())
+            ._()
+          ._();
+      }
+      tableBody._()._()._();
+    }
+  }
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllContainersPage.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllContainersPage.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllContainersPage.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllContainersPage.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,100 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES_ID;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.tableInit;
+
+import java.util.Map.Entry;
+
+import org.apache.hadoop.yarn.api.records.ContainerId;
+import org.apache.hadoop.yarn.server.nodemanager.Context;
+import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
+import org.apache.hadoop.yarn.util.ConverterUtils;
+import org.apache.hadoop.yarn.webapp.SubView;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.BODY;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TBODY;
+import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
+
+import com.google.inject.Inject;
+
+public class AllContainersPage extends NMView {
+
+  @Override protected void preHead(Page.HTML<_> html) {
+    commonPreHead(html);
+    setTitle("All containers running on this node");
+    set(DATATABLES_ID, "containers");
+    set(initID(DATATABLES, "containers"), containersTableInit());
+    setTableStyles(html, "containers");
+  }
+
+  private String containersTableInit() {
+    return tableInit().
+        // containerid, containerid, log-url
+        append(", aoColumns:[null, null, {bSearchable:false}]} ").toString();
+  }
+
+  @Override
+  protected Class<? extends SubView> content() {
+    return AllContainersBlock.class;
+  }
+
+  public static class AllContainersBlock extends HtmlBlock implements
+      NMWebParams {
+
+    private final Context nmContext;
+
+    @Inject
+    public AllContainersBlock(Context nmContext) {
+      this.nmContext = nmContext;
+    }
+
+    @Override
+    protected void render(Block html) {
+      TBODY<TABLE<BODY<Hamlet>>> tableBody = html.body()
+        .table("#containers")
+          .thead()
+            .tr()
+              .td()._("ContainerId")._()
+              .td()._("ContainerState")._()
+              .td()._("logs-url")._()
+            ._()
+          ._().tbody();
+      for (Entry<ContainerId, Container> entry : this.nmContext
+          .getContainers().entrySet()) {
+        ContainerId containerId = entry.getKey();
+        Container container = entry.getValue();
+        String containerIdStr = ConverterUtils.toString(containerId);
+        tableBody
+          .tr()
+            .td().a(url($(NM_HTTP_URL), "yarn", "container", containerIdStr), 
+                containerIdStr)._()
+            .td()._(container.getContainerState())._()
+            .td()._("TODO")._()
+          ._();
+      }
+      tableBody._()._()._();
+    }
+
+  }
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ApplicationPage.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ApplicationPage.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ApplicationPage.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ApplicationPage.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,101 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES_ID;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.tableInit;
+
+import java.util.Map;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ContainerId;
+import org.apache.hadoop.yarn.factories.RecordFactory;
+import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
+import org.apache.hadoop.yarn.server.nodemanager.Context;
+import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application;
+import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
+import org.apache.hadoop.yarn.util.ConverterUtils;
+import org.apache.hadoop.yarn.webapp.SubView;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE;
+import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
+import org.apache.hadoop.yarn.webapp.view.InfoBlock;
+
+import com.google.inject.Inject;
+
+public class ApplicationPage extends NMView implements NMWebParams {
+
+  @Override protected void preHead(Page.HTML<_> html) {
+    commonPreHead(html);
+    set(DATATABLES_ID, "containers");
+    set(initID(DATATABLES, "containers"), containersTableInit());
+    setTableStyles(html, "containers");
+  }
+
+  private String containersTableInit() {
+    return tableInit().append(",aoColumns:[null]}").toString();
+  }
+
+  @Override
+  protected Class<? extends SubView> content() {
+    return ApplicationBlock.class;
+  }
+
+  public static class ApplicationBlock extends HtmlBlock implements
+      NMWebParams {
+
+    private final Context nmContext;
+    private final Configuration conf;
+    private final RecordFactory recordFactory;
+
+    @Inject
+    public ApplicationBlock(Context nmContext, Configuration conf) {
+      this.conf = conf;
+      this.nmContext = nmContext;
+      this.recordFactory = RecordFactoryProvider.getRecordFactory(this.conf);
+    }
+
+    @Override
+    protected void render(Block html) {
+      ApplicationId applicationID =
+          ConverterUtils.toApplicationId(this.recordFactory,
+              $(APPLICATION_ID));
+      Application app = this.nmContext.getApplications().get(applicationID);
+      Map<ContainerId, Container> containers = app.getContainers();
+      info("Application's information")
+            ._("ApplicationId", ConverterUtils.toString(app.getAppId()))
+            ._("ApplicationState", app.getApplicationState().toString())
+            ._("User", app.getUser());
+      TABLE<Hamlet> containersListBody = html._(InfoBlock.class)
+          .table("#containers");
+      for (ContainerId containerId : containers.keySet()) {
+        String containerIdStr = ConverterUtils.toString(containerId);
+        containersListBody
+               .tr().td()
+                 .a(url($(NM_HTTP_URL), "yarn", "container", containerIdStr),
+                     containerIdStr)
+                 ._()._();
+      }
+      containersListBody._();
+    }
+  }
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ContainerPage.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ContainerPage.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ContainerPage.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/ContainerPage.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,75 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.ACCORDION;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.yarn.api.records.ContainerId;
+import org.apache.hadoop.yarn.factories.RecordFactory;
+import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
+import org.apache.hadoop.yarn.server.nodemanager.Context;
+import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
+import org.apache.hadoop.yarn.util.ConverterUtils;
+import org.apache.hadoop.yarn.webapp.SubView;
+import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
+import org.apache.hadoop.yarn.webapp.view.InfoBlock;
+
+import com.google.inject.Inject;
+
+public class ContainerPage extends NMView implements NMWebParams {
+
+  @Override
+  protected void preHead(Page.HTML<_> html) {
+    commonPreHead(html);
+    setTitle("Container " + $(CONTAINER_ID));
+    set(initID(ACCORDION, "nav"), "{autoHeight:false, active:2}");
+  }
+
+  @Override
+  protected Class<? extends SubView> content() {
+    return ContainerBlock.class;
+  }
+
+  public static class ContainerBlock extends HtmlBlock implements NMWebParams {
+
+    private final Configuration conf;
+    private final Context nmContext;
+    private final RecordFactory recordFactory;
+
+    @Inject
+    public ContainerBlock(Configuration conf, Context nmContext) {
+      this.conf = conf;
+      this.nmContext = nmContext;
+      this.recordFactory = RecordFactoryProvider.getRecordFactory(this.conf);
+    }
+
+    @Override
+    protected void render(Block html) {
+      ContainerId containerID =
+        ConverterUtils.toContainerId(this.recordFactory, $(CONTAINER_ID));
+    Container container = this.nmContext.getContainers().get(containerID);
+    info("Container information")
+      ._("ContainerID", $(CONTAINER_ID))
+      ._("ContainerState", container.getContainerState());
+    html._(InfoBlock.class);
+    }
+  }
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMController.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMController.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMController.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMController.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,69 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import static org.apache.hadoop.yarn.util.StringHelper.join;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.yarn.server.nodemanager.NMConfig;
+import org.apache.hadoop.yarn.webapp.Controller;
+
+import com.google.inject.Inject;
+
+public class NMController extends Controller implements NMWebParams {
+
+  @Inject
+  public NMController(Configuration nmConf, RequestContext requestContext) {
+    super(requestContext);
+    set(NM_HTTP_URL,
+        join("http://", nmConf.get(NMConfig.NM_HTTP_BIND_ADDRESS,
+            NMConfig.DEFAULT_NM_HTTP_BIND_ADDRESS)));
+  }
+
+  @Override
+  // TODO: What use of this with info() in?
+  public void index() {
+    setTitle(join("NodeManager - ", $(NM_NODENAME)));
+  }
+
+  public void info() {
+    info("NodeManager:\n" + $(NM_HTTP_URL));
+    render(NodePage.class);    
+  }
+
+  public void node() {
+    render(NodePage.class);
+  }
+
+  public void allApplications() {
+    render(AllApplicationsPage.class);
+  }
+
+  public void allContainers() {
+    render(AllContainersPage.class);
+  }
+
+  public void application() {
+    render(ApplicationPage.class);
+  }
+
+  public void container() {
+    render(ContainerPage.class);
+  }
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMView.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMView.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMView.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMView.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,46 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.ACCORDION;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.ACCORDION_ID;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.THEMESWITCHER_ID;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID;
+
+import org.apache.hadoop.yarn.webapp.SubView;
+import org.apache.hadoop.yarn.webapp.view.TwoColumnLayout;
+
+public class NMView extends TwoColumnLayout {
+
+  @Override protected void preHead(Page.HTML<_> html) {
+      commonPreHead(html);
+    }
+
+  protected void commonPreHead(Page.HTML<_> html) {
+    html.meta_http("refresh", "10");
+    set(ACCORDION_ID, "nav");
+    set(initID(ACCORDION, "nav"), "{autoHeight:false, active:1}");
+    set(THEMESWITCHER_ID, "themeswitcher");
+  }
+
+  @Override
+  protected Class<? extends SubView> nav() {
+    return NavBlock.class;
+  }
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebParams.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebParams.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebParams.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebParams.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,26 @@
+/**
+* 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.server.nodemanager.webapp;
+
+public interface NMWebParams {
+  public static final String NM_NODENAME = "nm.id";
+  public static final String NM_HTTP_URL = "nm.http-url";
+  public static final String APPLICATION_ID = "nm.appId";
+  public static final String CONTAINER_ID = "nm.containerId";
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,44 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
+
+public class NavBlock extends HtmlBlock implements NMWebParams {
+
+  @Override
+  protected void render(Block html) {
+    html
+      .div("#nav")
+        .h3()._("NodeManager")._() // TODO: Problem if no header like this
+        .ul()
+          .li()
+            .a(url($(NM_HTTP_URL), "yarn", "node"), "Node Information")._()
+          .li()
+            .a(url($(NM_HTTP_URL), "yarn", "allApplications"), "List of Applications")
+            ._()
+          .li()
+            .a(url($(NM_HTTP_URL), "yarn","allContainers"), "List of Containers")._()
+        ._()
+        .h3()._("Tools")._()
+      ._()
+      .div("#themeswitcher")._();
+  }
+
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,73 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.ACCORDION;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID;
+
+import org.apache.hadoop.yarn.server.nodemanager.Context;
+import org.apache.hadoop.yarn.server.nodemanager.ResourceView;
+import org.apache.hadoop.yarn.webapp.SubView;
+import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML;
+import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
+import org.apache.hadoop.yarn.webapp.view.InfoBlock;
+
+import com.google.inject.Inject;
+
+public class NodePage extends NMView {
+
+  @Override
+  protected void commonPreHead(HTML<_> html) {
+    super.commonPreHead(html);
+    set(initID(ACCORDION, "nav"), "{autoHeight:false, active:1}");
+  }
+
+  @Override
+  protected Class<? extends SubView> content() {
+    return NodeBlock.class;
+  }
+
+  public static class NodeBlock extends HtmlBlock {
+
+    private final Context context;
+    private final ResourceView resourceView;
+
+    @Inject
+    public NodeBlock(Context context, ResourceView resourceView) {
+      this.context = context;
+      this.resourceView = resourceView;
+    }
+
+    @Override
+    protected void render(Block html) {
+      info("NodeManager information")
+          ._("Total Vmem allocated for Containers",
+              this.resourceView.getVmemAllocatedForContainers() + "bytes")
+          ._("Total Pmem allocated for Container",
+              this.resourceView.getPmemAllocatedForContainers() + "bytes")
+          ._("NodeHealthyStatus",
+              this.context.getNodeHealthStatus().getIsNodeHealthy())
+          ._("LastNodeHealthTime",
+              this.context.getNodeHealthStatus().getLastHealthReportTime())
+          ._("NodeHealthReport",
+              this.context.getNodeHealthStatus().getHealthReport());
+      html._(InfoBlock.class);
+    }
+  }
+}

Added: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/WebServer.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/WebServer.java?rev=1095271&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/WebServer.java (added)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/WebServer.java Wed Apr 20 05:38:57 2011
@@ -0,0 +1,102 @@
+/**
+* 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.server.nodemanager.webapp;
+
+import static org.apache.hadoop.yarn.util.StringHelper.pajoin;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.yarn.YarnException;
+import org.apache.hadoop.yarn.server.nodemanager.Context;
+import org.apache.hadoop.yarn.server.nodemanager.NMConfig;
+import org.apache.hadoop.yarn.server.nodemanager.ResourceView;
+import org.apache.hadoop.yarn.service.AbstractService;
+import org.apache.hadoop.yarn.webapp.WebApp;
+import org.apache.hadoop.yarn.webapp.WebApps;
+
+public class WebServer extends AbstractService {
+
+  private static final Log LOG = LogFactory.getLog(WebServer.class);
+
+  private final Context nmContext;
+  private final ResourceView resourceView;
+  private WebApp webApp;
+  private String bindAddress;
+
+  public WebServer(Context nmContext, ResourceView resourceView) {
+    super(WebServer.class.getName());
+    this.nmContext = nmContext;
+    this.resourceView = resourceView;
+  }
+
+  @Override
+  public synchronized void init(Configuration conf) {
+    super.init(conf);
+  }
+
+  @Override
+  public synchronized void start() {
+    this.bindAddress = getConfig().get(NMConfig.NM_HTTP_BIND_ADDRESS,
+        NMConfig.DEFAULT_NM_HTTP_BIND_ADDRESS);
+    LOG.info("Instantiating NMWebApp at " + this.bindAddress);
+    try {
+      this.webApp =
+          WebApps.$for("yarn", Context.class, this.nmContext)
+              .at(this.bindAddress).with(getConfig())
+              .start(new NMWebApp(this.resourceView));
+    } catch (Exception e) {
+      String msg = "NMWebapps failed to start.";
+      LOG.error(msg, e);
+      throw new YarnException(msg);
+    }
+    super.start();
+  }
+
+  @Override
+  public synchronized void stop() {
+    if (this.webApp != null) {
+      this.webApp.stop();
+    }
+    super.stop();
+  }
+
+  public class NMWebApp extends WebApp implements NMWebParams {
+
+    private final ResourceView resourceView;
+
+    public NMWebApp(ResourceView resourceView) {
+      this.resourceView = resourceView;
+    }
+
+    @Override
+    public void setup() {
+      bind(ResourceView.class).toInstance(this.resourceView);
+      route("/", NMController.class, "info");
+      route("/node", NMController.class, "node");
+      route("/allApplications", NMController.class, "allApplications");
+      route("/allContainers", NMController.class, "allContainers");
+      route(pajoin("/application", APPLICATION_ID), NMController.class,
+          "application");
+      route(pajoin("/container", CONTAINER_ID), NMController.class,
+          "container");
+    }
+
+  }
+}

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/LocalRMInterface.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/LocalRMInterface.java?rev=1095271&r1=1095270&r2=1095271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/LocalRMInterface.java (original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/LocalRMInterface.java Wed Apr 20 05:38:57 2011
@@ -36,7 +36,9 @@ public class LocalRMInterface implements
   
   @Override
   public RegisterNodeManagerResponse registerNodeManager(RegisterNodeManagerRequest request) throws YarnRemoteException {
-    String node = request.getNode();
+    String host = request.getHost();
+    int cmPort = request.getContainerManagerPort();
+    String node = host + ":" + cmPort;
     Resource resource = request.getResource();
     RegistrationResponse registrationResponse = recordFactory.newRecordInstance(RegistrationResponse.class);
     registrationResponse.setNodeId(recordFactory.newRecordInstance(NodeId.class));



Mime
View raw message