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
This commit is contained in:
Bikas Saha 2013-06-18 21:22:48 +00:00
parent 6feda0aa3b
commit 68d97a6aac
6 changed files with 10 additions and 7 deletions

View File

@ -176,6 +176,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.

View File

@ -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.

View File

@ -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.

View File

@ -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() { public Resource getAvailableResources() {
return client.getClusterAvailableResources(); return client.getAvailableResources();
} }
/** /**

View File

@ -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;
} }

View File

@ -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) {