@Override public long estimatedRuntime(TaskAttemptId id) { Long startTime = startTimes.get(id); if (startTime == null) { return -1L; } EstimateVector vector = getEstimateVector(id); if (vector == null) { return -1L; } long sunkTime = vector.atTime - startTime; double value = vector.value; float progress = vector.basedOnProgress; if (value == 0) { return -1L; } double rate = smoothedValue == SmoothedValue.RATE ? value : 1.0 / value; if (rate == 0.0) { return -1L; } double remainingTime = (1.0 - progress) / rate; return sunkTime + (long)remainingTime; }
@Override public long estimatedRuntime(TaskAttemptId id) { Long startTime = startTimes.get(id); if (startTime == null) { return -1L; } EstimateVector vector = getEstimateVector(id); if (vector == null) { return -1L; } long sunkTime = vector.atTime - startTime; double value = vector.value; float progress = vector.basedOnProgress; if (value == 0) { return -1L; } double rate = smoothedValue == SmoothedValue.RATE ? value : 1.0 / value; if (rate == 0.0) { return -1L; } double remainingTime = (1.0 - progress) / rate; return sunkTime + (long)remainingTime; }
@Override public long estimatedRuntime(TaskAttemptId id) { Long startTime = startTimes.get(id); if (startTime == null) { return -1L; } EstimateVector vector = getEstimateVector(id); if (vector == null) { return -1L; } long sunkTime = vector.atTime - startTime; double value = vector.value; float progress = vector.basedOnProgress; if (value == 0) { return -1L; } double rate = smoothedValue == SmoothedValue.RATE ? value : 1.0 / value; if (rate == 0.0) { return -1L; } double remainingTime = (1.0 - progress) / rate; return sunkTime + (long)remainingTime; }