Browse Source

YARN-831. Removed minimum resource from GetNewApplicationResponse as a follow-up to YARN-787. Contributed Jian He.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1493626 13f79535-47bb-0310-9956-ffa450edef68
Arun Murthy 12 years ago
parent
commit
6b75a5c3b5

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -166,6 +166,9 @@ Release 2.1.0-beta - UNRELEASED
     ContainerManager -> ContainerManagementProtocol
     (vinodkv via acmurthy)
 
+    YARN-831. Removed minimum resource from GetNewApplicationResponse as a
+    follow-up to YARN-787. (Jian He via acmurthy)
+
   NEW FEATURES
 
     YARN-482. FS: Extend SchedulingMode to intermediate queues. 

+ 1 - 15
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationResponse.java

@@ -43,7 +43,6 @@ public abstract class GetNewApplicationResponse {
     GetNewApplicationResponse response =
         Records.newRecord(GetNewApplicationResponse.class);
     response.setApplicationId(applicationId);
-    response.setMinimumResourceCapability(minCapability);
     response.setMaximumResourceCapability(maxCapability);
     return response;
   }
@@ -61,20 +60,7 @@ public abstract class GetNewApplicationResponse {
   @Private
   @Unstable
   public abstract void setApplicationId(ApplicationId applicationId);
-  
-  /**
-   * Get the minimum capability for any {@link Resource} allocated by the 
-   * <code>ResourceManager</code> in the cluster.
-   * @return minimum capability of allocated resources in the cluster
-   */
-  @Public
-  @Stable
-  public abstract Resource getMinimumResourceCapability();
-  
-  @Private
-  @Unstable
-  public abstract void setMinimumResourceCapability(Resource capability);
-  
+
   /**
    * Get the maximum capability for any {@link Resource} allocated by the 
    * <code>ResourceManager</code> in the cluster.

+ 1 - 29
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetNewApplicationResponsePBImpl.java

@@ -35,7 +35,6 @@ public class GetNewApplicationResponsePBImpl extends GetNewApplicationResponse {
   boolean viaProto = false;
   
   private ApplicationId applicationId = null;
-  private Resource minimumResourceCapability = null;
   private Resource maximumResourceCapability = null;
   
   public GetNewApplicationResponsePBImpl() {
@@ -78,9 +77,6 @@ public class GetNewApplicationResponsePBImpl extends GetNewApplicationResponse {
     if (applicationId != null) {
       builder.setApplicationId(convertToProtoFormat(this.applicationId));
     }
-    if (minimumResourceCapability != null) {
-    	builder.setMinimumCapability(convertToProtoFormat(this.minimumResourceCapability));
-    }
     if (maximumResourceCapability != null) {
     	builder.setMaximumCapability(convertToProtoFormat(this.maximumResourceCapability));
     }
@@ -140,21 +136,6 @@ public class GetNewApplicationResponsePBImpl extends GetNewApplicationResponse {
     return this.maximumResourceCapability;
   }
 
-  @Override
-  public Resource getMinimumResourceCapability() {
-    if (this.minimumResourceCapability != null) {
-      return this.minimumResourceCapability;
-    }
-    
-    GetNewApplicationResponseProtoOrBuilder p = viaProto ? proto : builder;
-    if (!p.hasMinimumCapability()) {
-      return null;
-    }
-    
-    this.minimumResourceCapability = convertFromProtoFormat(p.getMinimumCapability());
-    return this.minimumResourceCapability;
-  }
-
   @Override
   public void setMaximumResourceCapability(Resource capability) {
     maybeInitBuilder();
@@ -163,16 +144,7 @@ public class GetNewApplicationResponsePBImpl extends GetNewApplicationResponse {
     }
     this.maximumResourceCapability = capability;
   }
-
-  @Override
-  public void setMinimumResourceCapability(Resource capability) {
-    maybeInitBuilder();
-    if(minimumResourceCapability == null) {
-      builder.clearMinimumCapability();
-    }
-    this.minimumResourceCapability = capability;
-  }
-    
+ 
   private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
     return new ApplicationIdPBImpl(p);
   }

+ 1 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_service_protos.proto

@@ -84,8 +84,7 @@ message GetNewApplicationRequestProto {
 
 message GetNewApplicationResponseProto {
   optional ApplicationIdProto application_id = 1;
-  optional ResourceProto minimumCapability = 2;
-  optional ResourceProto maximumCapability = 3;
+  optional ResourceProto maximumCapability = 2;
 }
 
 message GetApplicationReportRequestProto {

+ 2 - 12
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java

@@ -359,21 +359,11 @@ public class Client extends YarnClientImpl {
     // the required resources from the RM for the app master
     // Memory ask has to be a multiple of min and less than max. 
     // Dump out information about cluster capability as seen by the resource manager
-    int minMem = newApp.getMinimumResourceCapability().getMemory();
     int maxMem = newApp.getMaximumResourceCapability().getMemory();
-    LOG.info("Min mem capabililty of resources in this cluster " + minMem);
     LOG.info("Max mem capabililty of resources in this cluster " + maxMem);
 
-    // A resource ask has to be atleast the minimum of the capability of the cluster, the value has to be 
-    // a multiple of the min value and cannot exceed the max. 
-    // If it is not an exact multiple of min, the RM will allocate to the nearest multiple of min
-    if (amMemory < minMem) {
-      LOG.info("AM memory specified below min threshold of cluster. Using min value."
-          + ", specified=" + amMemory
-          + ", min=" + minMem);
-      amMemory = minMem; 
-    } 
-    else if (amMemory > maxMem) {
+    // A resource ask cannot exceed the max. 
+    if (amMemory > maxMem) {
       LOG.info("AM memory specified above max threshold of cluster. Using max value."
           + ", specified=" + amMemory
           + ", max=" + maxMem);

+ 0 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java

@@ -208,8 +208,6 @@ public class ClientRMService extends AbstractService implements
         .newRecordInstance(GetNewApplicationResponse.class);
     response.setApplicationId(getNewApplicationId());
     // Pick up min/max resource from scheduler...
-    response.setMinimumResourceCapability(scheduler
-        .getMinimumResourceCapability());
     response.setMaximumResourceCapability(scheduler
         .getMaximumResourceCapability());       
     

+ 0 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRM.java

@@ -58,7 +58,6 @@ public class TestRM {
     
     GetNewApplicationResponse resp = rm.getNewAppId();
     assert (resp.getApplicationId().getId() != 0);    
-    assert (resp.getMinimumResourceCapability().getMemory() > 0);
     assert (resp.getMaximumResourceCapability().getMemory() > 0);    
     rm.stop();
   }