%! /** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ %> <%@ page import="javax.servlet.*" import="javax.servlet.http.*" import="java.io.*" import="java.text.*" import="java.util.*" import="java.text.DecimalFormat" import="org.apache.hadoop.http.HtmlQuoting" import="org.apache.hadoop.mapred.*" import="org.apache.hadoop.mapreduce.*" import="org.apache.hadoop.util.*" import="org.codehaus.jackson.map.ObjectMapper" %> <%!static SimpleDateFormat dateFormat = new SimpleDateFormat( "d-MMM-yyyy HH:mm:ss"); %> <%! private static final long serialVersionUID = 1L; %> <%! private static DecimalFormat percentFormat = new DecimalFormat("##0.00"); public void generateSummaryTable(JspWriter out, ClusterMetrics metrics, JobTracker tracker) throws IOException { String tasksPerNode = metrics.getTaskTrackerCount() > 0 ? percentFormat.format(((double)(metrics.getMapSlotCapacity() + metrics.getReduceSlotCapacity())) / metrics.getTaskTrackerCount()): "-"; out.print("
Running Map Tasks | Running Reduce Tasks | " + "Total Submissions | " + "Nodes | " + "Occupied Map Slots | Occupied Reduce Slots | " + "Reserved Map Slots | Reserved Reduce Slots | " + "Map Task Capacity | " + "Reduce Task Capacity | Avg. Tasks/Node | " + "Blacklisted Nodes | " + "Graylisted Nodes | " + "Excluded Nodes |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
" + metrics.getRunningMaps() + " | " + metrics.getRunningReduces() + " | " + metrics.getTotalJobSubmissions() + " | " + metrics.getTaskTrackerCount() + " | " + metrics.getOccupiedMapSlots() + " | " + metrics.getOccupiedReduceSlots() + " | " + metrics.getReservedMapSlots() + " | " + metrics.getReservedReduceSlots() + " | " + metrics.getMapSlotCapacity() + " | " + metrics.getReduceSlotCapacity() + " | " + tasksPerNode + " | " + metrics.getBlackListedTaskTrackerCount() + "" + " | " + metrics.getGrayListedTaskTrackerCount() + "" + " | " + metrics.getDecommissionedTaskTrackerCount() + "" + " |
Queue Name | State | Scheduling Information |
<%=queueName%> | <%=state%> | <%=HtmlQuoting.quoteHtmlChars(schedulingInformation).replaceAll("\n"," ") %> |