public void updateProgressRate ( long currentTime ) { double bestProgressRate = 0 ; for ( TaskStatus ts : taskStatuses . values ( ) ) { if ( ts . getRunState ( ) == TaskStatus . State . RUNNING || ts . getRunState ( ) == TaskStatus . State . SUCCEEDED || ts . getRunState ( ) == TaskStatus . State . COMMIT_PENDING ) { double tsProgressRate = ts . getProgress ( ) / Math . max ( 1 , currentTime - getDispatchTime ( ts . getTaskID ( ) ) ) ; if ( tsProgressRate > bestProgressRate ) { bestProgressRate = tsProgressRate ; } } } DataStatistics taskStats = job . getRunningTaskStatistics ( isMapTask ( ) ) ; taskStats . updateStatistics ( progressRate , bestProgressRate ) ; progressRate = bestProgressRate ; }
update progress rate for a task