From 3757915dacc3e148611dc4fb04eaf087494c7c70 Mon Sep 17 00:00:00 2001 From: Sahil Aggarwal Date: Thu, 22 Feb 2018 01:50:01 +0530 Subject: [PATCH] HBASE-19075: Fix the 'tasks' table on master info page to not scroll up on clicking the tab --- .../hbase/tmpl/common/TaskMonitorTmpl.jamon | 135 ++++++++++++------ 1 file changed, 92 insertions(+), 43 deletions(-) diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon index ca3a0a1033b..79b163441b7 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon @@ -26,52 +26,101 @@ TaskMonitor taskMonitor = TaskMonitor.get(); String filter = "general"; String format = "html"; -<%java> -// apply requested filter -List tasks = taskMonitor.getTasks(filter); -long now = System.currentTimeMillis(); -Collections.sort(tasks, (t1, t2) -> Long.compare(t1.getStateTime(), t2.getStateTime())); -boolean first = true; - -<%if format.equals("json")%> -[<%for MonitoredTask task : tasks%><%if first%><%java>first = false;<%else>,<% task.toJSON() %>] -<%else> -

Tasks

- - <%if tasks.isEmpty()%> -

No tasks currently running on this node.

- <%else> - - - - - - - - <%for MonitoredTask task : tasks %> - - - - - - - -
Start TimeDescriptionStateStatus
<% new Date(task.getStartTime()) %><% task.getDescription() %><% task.getState() %> - (since <% StringUtils.formatTimeDiff(now, task.getStateTime()) %> ago) - <% task.getStatus() %> - (since <% StringUtils.formatTimeDiff(now, task.getStatusTime()) %> - ago)
- +<%if format.equals("json")%> + <& renderTasks; filter=filter &> +<%else> +

Tasks

+ +
+ +
+
+ <& jsonView; filter="all" &> + <& renderTasks; filter="all" &> +
+
+ <& jsonView; filter="general" &> + <& renderTasks; filter="general" &> +
+
+ <& jsonView; filter="handler" &> + <& renderTasks; filter="handler" &> +
+
+ <& jsonView; filter="rpc" &> + <& renderTasks; filter="rpc" &> +
+
+ <& jsonView; filter="operation" &> + <& renderTasks; filter="operation" &> +
+
+
+<%def jsonView> + <%args> + String filter; + + View as JSON + + +<%def renderTasks> + <%args> + String filter; + + <%java> + List tasks = taskMonitor.getTasks(filter); + long now = System.currentTimeMillis(); + Collections.sort(tasks, (t1, t2) -> Long.compare(t1.getStateTime(), t2.getStateTime())); + boolean first = true; + + <%if format.equals("json") %> + [<%for MonitoredTask task : tasks%><%if first%><%java>first = false;<%else>,<% task.toJSON() %>] + <%else> + <%if tasks.isEmpty()%> +

No tasks currently running on this node.

+ <%else> + + + + + + + + <%for MonitoredTask task : tasks %> + + + + + + + +
Start TimeDescriptionStateStatus
<% new Date(task.getStartTime()) %><% task.getDescription() %><% task.getState() %> + (since <% StringUtils.formatTimeDiff(now, task.getStateTime()) %> ago) + <% task.getStatus() %> + (since <% StringUtils.formatTimeDiff(now, task.getStatusTime()) %> + ago)
+ + + <%def stateCss> <%args>