protected void fetchData ( ) throws IOException { // if not connected to the collector, wait for a while then try connecting if ( rpcCollector == null ) { try { Thread . sleep ( RECONNECT_PERIOD ) ; } catch ( InterruptedException e ) { // do nothing } connect ( ) ; } try { clusterUtil = rpcCollector . getClusterUtilization ( ) ; for ( JobUtilization job : rpcCollector . getAllRunningJobUtilization ( ) ) { allJobUtil . put ( job . getJobId ( ) , job ) ; } for ( TaskTrackerUtilization tt : rpcCollector . getAllTaskTrackerUtilization ( ) ) { allTaskTrackerUtil . put ( tt . getHostName ( ) , tt ) ; } } catch ( Exception e ) { // When the Collector is down, clear the old data clusterUtil = null ; allJobUtil . clear ( ) ; allTaskTrackerUtil . clear ( ) ; LOG . warn ( "Error obtaining data from Collector." ) ; } }
Mirror data from the Collector