From b094b94d43a46af9ddb910da24f792b95f614b08 Mon Sep 17 00:00:00 2001 From: Eric E Payne Date: Thu, 2 May 2019 19:39:26 +0000 Subject: [PATCH] YARN-9285: RM UI progress column is of wrong type. Contributed by Ahmed Hussein. --- .../yarn/server/webapp/WebPageUtils.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java index 8ab5de1ba6e..06a5f1df144 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java @@ -47,21 +47,27 @@ public class WebPageUtils { private static String getAppsTableColumnDefs( boolean isFairSchedulerPage, boolean isResourceManager) { + // default progress column index is 11 + String progressIndex = "[11]"; StringBuilder sb = new StringBuilder(); sb.append("[\n") .append("{'sType':'natural', 'aTargets': [0]") .append(", 'mRender': parseHadoopID }") .append("\n, {'sType':'num-ignore-str', 'aTargets': [6, 7, 8]") - .append(", 'mRender': renderHadoopDate }") - .append("\n, {'sType':'num-ignore-str', 'aTargets': [11, 12, 13, 14, 15] }") - .append("\n, {'sType':'numeric', bSearchable:false, 'aTargets':"); - if (isFairSchedulerPage) { - sb.append("[15]"); - } else if (isResourceManager) { - sb.append("[17]"); - } else { - sb.append("[10]"); + .append(", 'mRender': renderHadoopDate }"); + if (isResourceManager) { + // Update following line if any column added in RM page before column 11 + sb.append("\n, {'sType':'num-ignore-str', 'aTargets': [11, 12, 13, 14, 15] }"); + // set progress column index to 18 + progressIndex = "[18]"; + } else if (isFairSchedulerPage) { + // Update following line if any column added in scheduler page before column 11 + sb.append("\n, {'sType':'num-ignore-str', 'aTargets': [11, 12, 13, 14, 15] }"); + // set progress column index to 16 + progressIndex = "[16]"; } + sb.append("\n, {'sType':'numeric', bSearchable:false, 'aTargets':"); + sb.append(progressIndex); sb.append(", 'mRender': parseHadoopProgress }]"); return sb.toString(); }