浏览代码

Merge r1494311 from branch-2 to branch-2.1-beta for YARN-850. Rename getClusterAvailableResources to getAvailableResources in AMRMClients (Jian He via bikas)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.1-beta@1494315 13f79535-47bb-0310-9956-ffa450edef68
Bikas Saha 12 年之前
父节点
当前提交
5ba831743f

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

@@ -152,6 +152,9 @@ Release 2.1.0-beta - UNRELEASED
     YARN-841. Move Auxiliary service to yarn-api, annotate and document it.
     YARN-841. Move Auxiliary service to yarn-api, annotate and document it.
     (vinodkv)
     (vinodkv)
 
 
+    YARN-850. Rename getClusterAvailableResources to getAvailableResources in
+    AMRMClients (Jian He via bikas)
+
   NEW FEATURES
   NEW FEATURES
 
 
     YARN-482. FS: Extend SchedulingMode to intermediate queues. 
     YARN-482. FS: Extend SchedulingMode to intermediate queues. 

+ 1 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java

@@ -225,7 +225,7 @@ public abstract class AMRMClient<T extends AMRMClient.ContainerRequest> extends
    * A valid value is available after a call to allocate has been made
    * A valid value is available after a call to allocate has been made
    * @return Currently available resources
    * @return Currently available resources
    */
    */
-  public abstract Resource getClusterAvailableResources();
+  public abstract Resource getAvailableResources();
   
   
   /**
   /**
    * Get the current number of nodes in the cluster.
    * Get the current number of nodes in the cluster.

+ 1 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/AMRMClientAsync.java

@@ -189,7 +189,7 @@ extends AbstractService {
    * A valid value is available after a call to allocate has been made
    * A valid value is available after a call to allocate has been made
    * @return Currently available resources
    * @return Currently available resources
    */
    */
-  public abstract Resource getClusterAvailableResources();
+  public abstract Resource getAvailableResources();
 
 
   /**
   /**
    * Get the current number of nodes in the cluster.
    * Get the current number of nodes in the cluster.

+ 2 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/AMRMClientAsyncImpl.java

@@ -203,8 +203,8 @@ extends AMRMClientAsync<T> {
    * A valid value is available after a call to allocate has been made
    * A valid value is available after a call to allocate has been made
    * @return Currently available resources
    * @return Currently available resources
    */
    */
-  public Resource getClusterAvailableResources() {
-    return client.getClusterAvailableResources();
+  public Resource getAvailableResources() {
+    return client.getAvailableResources();
   }
   }
 
 
   /**
   /**

+ 1 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java

@@ -380,7 +380,7 @@ public class AMRMClientImpl<T extends ContainerRequest> extends AMRMClient<T> {
   }
   }
   
   
   @Override
   @Override
-  public synchronized Resource getClusterAvailableResources() {
+  public synchronized Resource getAvailableResources() {
     return clusterAvailableResources;
     return clusterAvailableResources;
   }
   }
   
   

+ 2 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/async/impl/TestAMRMClientAsync.java

@@ -95,7 +95,7 @@ public class TestAMRMClientAsync {
     }).thenReturn(emptyResponse);
     }).thenReturn(emptyResponse);
     when(client.registerApplicationMaster(anyString(), anyInt(), anyString()))
     when(client.registerApplicationMaster(anyString(), anyInt(), anyString()))
       .thenReturn(null);
       .thenReturn(null);
-    when(client.getClusterAvailableResources()).thenAnswer(new Answer<Resource>() {
+    when(client.getAvailableResources()).thenAnswer(new Answer<Resource>() {
       @Override
       @Override
       public Resource answer(InvocationOnMock invocation)
       public Resource answer(InvocationOnMock invocation)
           throws Throwable {
           throws Throwable {
@@ -123,7 +123,7 @@ public class TestAMRMClientAsync {
     // heartbeat will be blocked. make sure we can call client methods at this
     // heartbeat will be blocked. make sure we can call client methods at this
     // time. Checks that heartbeat is not holding onto client lock
     // time. Checks that heartbeat is not holding onto client lock
     assert(secondHeartbeatSync.get() < 2);
     assert(secondHeartbeatSync.get() < 2);
-    asyncClient.getClusterAvailableResources();
+    asyncClient.getAvailableResources();
     // method returned. now unblock heartbeat
     // method returned. now unblock heartbeat
     assert(secondHeartbeatSync.get() < 2);
     assert(secondHeartbeatSync.get() < 2);
     synchronized (heartbeatBlock) {
     synchronized (heartbeatBlock) {