*
* Added for use by queue scheduling algorithms.
* @param currentTime
*/
boolean canBeSpeculated(long currentTime) {
DataStatistics taskStats = job.getRunningTaskStatistics(isMapTask());
if (LOG.isDebugEnabled()) {
LOG.debug("activeTasks.size(): " + activeTasks.size() + " "
+ activeTasks.firstKey() + " task's progressrate: " +
getCurrentProgressRate(currentTime) +
" taskStats : " + taskStats);
}
return (!skipping && isRunnable() && isRunning() &&
activeTasks.size() <= MAX_TASK_EXECS &&
currentTime - lastDispatchTime >= SPECULATIVE_LAG &&
completes == 0 && !isOnlyCommitPending() &&
(taskStats.mean() - getCurrentProgressRate(currentTime) >
taskStats.std() * job.getSlowTaskThreshold()));
}