Class DefaultSpeculator
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.mapreduce.v2.app.speculate.DefaultSpeculator
- All Implemented Interfaces:
Closeable,AutoCloseable,Speculator,org.apache.hadoop.service.Service,org.apache.hadoop.yarn.event.EventHandler<SpeculatorEvent>
public class DefaultSpeculator
extends org.apache.hadoop.service.AbstractService
implements Speculator
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATENested classes/interfaces inherited from interface org.apache.hadoop.mapreduce.v2.app.speculate.Speculator
Speculator.EventType -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSpeculator(org.apache.hadoop.conf.Configuration conf, AppContext context) DefaultSpeculator(org.apache.hadoop.conf.Configuration conf, AppContext context, TaskRuntimeEstimator estimator, org.apache.hadoop.yarn.util.Clock clock) DefaultSpeculator(org.apache.hadoop.conf.Configuration conf, AppContext context, org.apache.hadoop.yarn.util.Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSpeculativeAttempt(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskID) booleanintdoubledoublelonglongvoidhandle(SpeculatorEvent event) voidvoidprotected voidprotected voidprotected voidstatusUpdate(TaskAttemptStatusUpdateEvent.TaskAttemptStatus reportedStatus, long timestamp) Absorbs one TaskAttemptStatusMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
DefaultSpeculator
-
DefaultSpeculator
public DefaultSpeculator(org.apache.hadoop.conf.Configuration conf, AppContext context, org.apache.hadoop.yarn.util.Clock clock) -
DefaultSpeculator
public DefaultSpeculator(org.apache.hadoop.conf.Configuration conf, AppContext context, TaskRuntimeEstimator estimator, org.apache.hadoop.yarn.util.Clock clock)
-
-
Method Details
-
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
handleAttempt
- Specified by:
handleAttemptin interfaceSpeculator
-
eventQueueEmpty
public boolean eventQueueEmpty() -
scanForSpeculations
public void scanForSpeculations() -
statusUpdate
protected void statusUpdate(TaskAttemptStatusUpdateEvent.TaskAttemptStatus reportedStatus, long timestamp) Absorbs one TaskAttemptStatus- Parameters:
reportedStatus- the status report that we got from a task attempt that we want to fold into the speculation data for this jobtimestamp- the time this status corresponds to. This matters because statuses contain progress.
-
addSpeculativeAttempt
protected void addSpeculativeAttempt(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskID) -
handle
- Specified by:
handlein interfaceorg.apache.hadoop.yarn.event.EventHandler<SpeculatorEvent>
-
getSoonestRetryAfterNoSpeculate
@VisibleForTesting public long getSoonestRetryAfterNoSpeculate() -
getSoonestRetryAfterSpeculate
@VisibleForTesting public long getSoonestRetryAfterSpeculate() -
getProportionRunningTasksSpeculatable
@VisibleForTesting public double getProportionRunningTasksSpeculatable() -
getProportionTotalTasksSpeculatable
@VisibleForTesting public double getProportionTotalTasksSpeculatable() -
getMinimumAllowedSpeculativeTasks
@VisibleForTesting public int getMinimumAllowedSpeculativeTasks()
-