public class StackTraceSampleCoordinator extends Object
|Constructor and Description|
Creates a new coordinator for the job.
|Modifier and Type||Method and Description|
Cancels a pending sample.
Collects stack traces of a task.
Shuts down the coordinator.
Triggers a stack trace sample to all tasks.
public StackTraceSampleCoordinator(Executor executor, long sampleTimeout)
executor- to use to execute the futures
sampleTimeout- Time out after the expected sampling duration. This is added to the expected duration of a sample, which is determined by the number of samples and the delay between each sample.
public Future<StackTraceSample> triggerStackTraceSample(ExecutionVertex tasksToSample, int numSamples, Time delayBetweenSamples, int maxStackTraceDepth)
tasksToSample- Tasks to sample.
numSamples- Number of stack trace samples to collect.
delayBetweenSamples- Delay between consecutive samples.
maxStackTraceDepth- Maximum depth of the stack trace. 0 indicates no maximum and keeps the complete stack trace.
public void cancelStackTraceSample(int sampleId, Throwable cause)
sampleId- ID of the sample to cancel.
cause- Cause of the cancelling (can be
public void shutDown()
After shut down, no further operations are executed.
public void collectStackTraces(int sampleId, ExecutionAttemptID executionId, List<StackTraceElement> stackTraces)
sampleId- ID of the sample.
executionId- ID of the sampled task.
stackTraces- Stack traces of the sampled task.
IllegalStateException- If unknown sample ID and not recently finished or cancelled sample.
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.