YARN-6992. Kill application button is visible even if the application is FINISHED in RM UI. Contributed by Suma Shivaprasad.

(cherry picked from commit 6f101e7df1)
This commit is contained in:
Sunil G 2017-09-07 13:16:20 +05:30
parent 8ff2523687
commit f3c9b2e40e
1 changed files with 8 additions and 1 deletions

View File

@ -144,7 +144,8 @@ public class AppBlock extends HtmlBlock {
&& webUiType.equals(YarnWebParams.RM_WEB_UI)
&& conf.getBoolean(YarnConfiguration.RM_WEBAPP_UI_ACTIONS_ENABLED,
YarnConfiguration.DEFAULT_RM_WEBAPP_UI_ACTIONS_ENABLED)
&& !unsecuredUIForSecuredCluster) {
&& !unsecuredUIForSecuredCluster
&& !isAppInFinalState(app)) {
// Application Kill
html.div()
.button()
@ -419,4 +420,10 @@ public class AppBlock extends HtmlBlock {
}
return ret;
}
private boolean isAppInFinalState(AppInfo app) {
return app.getAppState() == YarnApplicationState.FINISHED
|| app.getAppState() == YarnApplicationState.FAILED
|| app.getAppState() == YarnApplicationState.KILLED;
}
}