T - Type of the result collected from tasks.V - Type of the result assembled and returned when all tasks where sampled.@NotThreadSafe protected abstract static class TaskStatsRequestCoordinator.PendingStatsRequest<T,V> extends Object
Has to be accessed in lock scope.
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
isDiscarded |
protected Set<ExecutionAttemptID> |
pendingTasks
All tasks what did not yet return a result.
|
protected int |
requestId
ID of the sampling request to this coordinator.
|
protected CompletableFuture<V> |
resultFuture
The future with the final result.
|
protected long |
startTime
The time when the request is created.
|
protected Map<ExecutionAttemptID,T> |
statsResultByTask
Results returned by individual tasks and stored by the tasks'
ExecutionAttemptID. |
| 限定符 | 构造器和说明 |
|---|---|
protected |
PendingStatsRequest(int requestId,
Collection<ExecutionAttemptID> tasksToCollect)
Creates new
TaskStatsRequestCoordinator.PendingStatsRequest. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract V |
assembleCompleteStats(long endTime)
A method that is called when responses from all tasks were collected successfully.
|
protected void |
checkDiscarded() |
protected void |
collectTaskStats(ExecutionAttemptID executionId,
T taskStatsResult)
Collects result from one of the tasks.
|
protected void |
completePromiseAndDiscard() |
protected void |
discard(Throwable cause) |
CompletableFuture<V> |
getStatsFuture()
A Future, which will either complete successfully if all of the samples from individual
tasks are collected or exceptionally, if at least one of the task responses fails.
|
protected boolean |
isComplete() |
protected final int requestId
protected final long startTime
protected final Set<ExecutionAttemptID> pendingTasks
protected final Map<ExecutionAttemptID,T> statsResultByTask
ExecutionAttemptID.protected final CompletableFuture<V> resultFuture
protected boolean isDiscarded
protected PendingStatsRequest(int requestId,
Collection<ExecutionAttemptID> tasksToCollect)
TaskStatsRequestCoordinator.PendingStatsRequest.requestId - ID of the request.tasksToCollect - tasks from which the stats responses are expected.protected boolean isComplete()
protected void discard(Throwable cause)
protected void collectTaskStats(ExecutionAttemptID executionId, T taskStatsResult)
executionId - ID of the Task.taskStatsResult - Result of the stats sample from the Task.protected void checkDiscarded()
protected void completePromiseAndDiscard()
public CompletableFuture<V> getStatsFuture()
protected abstract V assembleCompleteStats(long endTime)
Map<ExecutionAttemptID, T> statsResultByTask
variable.endTime - The time when the final sample was collected.CompletableFuture<V> getStatsFuture methodCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.