public void generateSummaryTable ( JspWriter out , JobTracker tracker ) throws IOException { ClusterStatus status = tracker . getClusterStatus ( ) ; int maxMapTasks = status . getMaxMapTasks ( ) ; int maxReduceTasks = status . getMaxReduceTasks ( ) ; int numTaskTrackers = status . getTaskTrackers ( ) ; String tasksPerNodeStr ; if ( numTaskTrackers > 0 ) { double tasksPerNodePct = ( double ) ( maxMapTasks + maxReduceTasks ) / ( double ) numTaskTrackers ; tasksPerNodeStr = percentFormat . format ( tasksPerNodePct ) ; } else { tasksPerNodeStr = "-" ; } out . print ( "<maps>" + status . getMapTasks ( ) + "</maps>\n" + "<reduces>" + status . getReduceTasks ( ) + "</reduces>\n" + "<total_submissions>" + tracker . getTotalSubmissions ( ) + "</total_submissions>\n" + "<nodes>" + status . getTaskTrackers ( ) + "</nodes>\n" + "<map_task_capacity>" + status . getMaxMapTasks ( ) + "</map_task_capacity>\n" + "<reduce_task_capacity>" + status . getMaxReduceTasks ( ) + "</reduce_task_capacity>\n" + "<avg_tasks_per_node>" + tasksPerNodeStr + "</avg_tasks_per_node>\n" ) ; }
Generates an XML - formatted block that summarizes the state of the JobTracker .