Merge r1594421 from trunk: YARN-1362. Distinguish between nodemanager shutdown for decommission vs shutdown for restart. (Contributed by Jason Lowe

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1594422 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Junping Du 2014-05-14 00:25:08 +00:00
parent 2d932cb8aa
commit ffb0d24fef
5 changed files with 21 additions and 1 deletions

View File

@ -11,6 +11,9 @@ Release 2.5.0 - UNRELEASED
YARN-1864. Fair Scheduler Dynamic Hierarchical User Queues (Ashwin Shankar
via Sandy Ryza)
YARN-1362. Distinguish between nodemanager shutdown for decommission vs shutdown
for restart. (Jason Lowe via junping_du)
IMPROVEMENTS
YARN-1479. Invalid NaN values in Hadoop REST API JSON response (Chen He via

View File

@ -66,4 +66,8 @@ public interface Context {
LocalDirsHandlerService getLocalDirsHandler();
ApplicationACLsManager getApplicationACLsManager();
boolean getDecommissioned();
void setDecommissioned(boolean isDecommissioned);
}

View File

@ -272,7 +272,8 @@ public class NodeManager extends CompositeService
private WebServer webServer;
private final NodeHealthStatus nodeHealthStatus = RecordFactoryProvider
.getRecordFactory(null).newRecordInstance(NodeHealthStatus.class);
private boolean isDecommissioned = false;
public NMContext(NMContainerTokenSecretManager containerTokenSecretManager,
NMTokenSecretManagerInNM nmTokenSecretManager,
LocalDirsHandlerService dirsHandler, ApplicationACLsManager aclsManager) {
@ -349,6 +350,16 @@ public class NodeManager extends CompositeService
public ApplicationACLsManager getApplicationACLsManager() {
return aclsManager;
}
@Override
public boolean getDecommissioned() {
return isDecommissioned;
}
@Override
public void setDecommissioned(boolean isDecommissioned) {
this.isDecommissioned = isDecommissioned;
}
}

View File

@ -493,6 +493,7 @@ public class NodeStatusUpdaterImpl extends AbstractService implements
+ " hence shutting down.");
LOG.warn("Message from ResourceManager: "
+ response.getDiagnosticsMessage());
context.setDecommissioned(true);
dispatcher.getEventHandler().handle(
new NodeManagerEvent(NodeManagerEventType.SHUTDOWN));
break;

View File

@ -930,6 +930,7 @@ public class TestNodeStatusUpdater {
Thread.sleep(500);
}
Assert.assertFalse(heartBeatID < 1);
Assert.assertTrue(nm.getNMContext().getDecommissioned());
// NM takes a while to reach the STOPPED state.
waitCount = 0;