From 40cab68409a90a88e41e5b2e1d076fa8e53f85af Mon Sep 17 00:00:00 2001 From: Bikas Saha Date: Tue, 18 Jun 2013 21:14:28 +0000 Subject: [PATCH] YARN-850. Rename getClusterAvailableResources to getAvailableResources in AMRMClients (Jian He via bikas) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1494309 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 4af7cc01431..37e9e4355e0 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -196,6 +196,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) {