From 68d97a6aacf5d2601b578f25b3ce651e134ecf4a Mon Sep 17 00:00:00 2001 From: Bikas Saha Date: Tue, 18 Jun 2013 21:22:48 +0000 Subject: [PATCH] Merge r1494309 from trunk to branch-2 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@1494311 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/yarn/client/api/AMRMClient.java | 2 +- .../apache/hadoop/yarn/client/api/async/AMRMClientAsync.java | 2 +- .../yarn/client/api/async/impl/AMRMClientAsyncImpl.java | 4 ++-- .../apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java | 2 +- .../yarn/client/api/async/impl/TestAMRMClientAsync.java | 4 ++-- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 2f8fe0434fb..d54e4e990be 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -176,6 +176,9 @@ Release 2.1.0-beta - UNRELEASED YARN-841. Move Auxiliary service to yarn-api, annotate and document it. (vinodkv) + YARN-850. Rename getClusterAvailableResources to getAvailableResources in + AMRMClients (Jian He via bikas) + NEW FEATURES YARN-482. FS: Extend SchedulingMode to intermediate queues. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java index e497005470e..f1890a84724 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java +++ b/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 extends * A valid value is available after a call to allocate has been made * @return Currently available resources */ - public abstract Resource getClusterAvailableResources(); + public abstract Resource getAvailableResources(); /** * Get the current number of nodes in the cluster. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/AMRMClientAsync.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/AMRMClientAsync.java index d24750efbbf..8d551dcd0a4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/AMRMClientAsync.java +++ b/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 * @return Currently available resources */ - public abstract Resource getClusterAvailableResources(); + public abstract Resource getAvailableResources(); /** * Get the current number of nodes in the cluster. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/AMRMClientAsyncImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/AMRMClientAsyncImpl.java index c188231d0ee..e667e37c240 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/AMRMClientAsyncImpl.java +++ b/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 { * A valid value is available after a call to allocate has been made * @return Currently available resources */ - public Resource getClusterAvailableResources() { - return client.getClusterAvailableResources(); + public Resource getAvailableResources() { + return client.getAvailableResources(); } /** diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java index a61ae0c9678..74c86b9826e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java +++ b/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 extends AMRMClient { } @Override - public synchronized Resource getClusterAvailableResources() { + public synchronized Resource getAvailableResources() { return clusterAvailableResources; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/async/impl/TestAMRMClientAsync.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/async/impl/TestAMRMClientAsync.java index 6c1fcb2ad4c..b50742df688 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/async/impl/TestAMRMClientAsync.java +++ b/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); when(client.registerApplicationMaster(anyString(), anyInt(), anyString())) .thenReturn(null); - when(client.getClusterAvailableResources()).thenAnswer(new Answer() { + when(client.getAvailableResources()).thenAnswer(new Answer() { @Override public Resource answer(InvocationOnMock invocation) throws Throwable { @@ -123,7 +123,7 @@ public class TestAMRMClientAsync { // heartbeat will be blocked. make sure we can call client methods at this // time. Checks that heartbeat is not holding onto client lock assert(secondHeartbeatSync.get() < 2); - asyncClient.getClusterAvailableResources(); + asyncClient.getAvailableResources(); // method returned. now unblock heartbeat assert(secondHeartbeatSync.get() < 2); synchronized (heartbeatBlock) {