Package io.trino.execution
Interface RemoteTask
- All Known Implementing Classes:
HttpRemoteTask
public interface RemoteTask
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voidaddFinalTaskInfoListener(StateMachine.StateChangeListener<TaskInfo> stateChangeListener) Add a listener for the final task info.voidaddSplits(com.google.common.collect.Multimap<PlanNodeId, Split> splits) voidaddStateChangeListener(StateMachine.StateChangeListener<TaskStatus> stateChangeListener) Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthiswhen adding a listener in a constructor.voidcancel()voidfailLocallyImmediately(Throwable cause) Fails task from the coordinator perspective immediately, without waiting for acknowledgement from the remote taskvoidfailRemotely(Throwable cause) Fails task remotely; only transitions to failed state when we receive confirmation that remote operation is completedintvoidnoMoreSplits(PlanNodeId sourceId) Retrieves spooling output stats.voidsetOutputBuffers(OutputBuffers outputBuffers) voidsetSpeculative(boolean speculative) voidstart()com.google.common.util.concurrent.ListenableFuture<Void> whenSplitQueueHasSpace(long weightThreshold)
-
Method Details
-
getTaskId
TaskId getTaskId() -
getNodeId
String getNodeId() -
getTaskInfo
TaskInfo getTaskInfo() -
getTaskStatus
TaskStatus getTaskStatus() -
start
void start() -
addSplits
-
noMoreSplits
-
setOutputBuffers
-
setSpeculative
void setSpeculative(boolean speculative) -
addStateChangeListener
Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthiswhen adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution. -
addFinalTaskInfoListener
Add a listener for the final task info. This notification is guaranteed to be fired only once. Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthiswhen adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution. -
whenSplitQueueHasSpace
com.google.common.util.concurrent.ListenableFuture<Void> whenSplitQueueHasSpace(long weightThreshold) -
cancel
void cancel() -
abort
void abort() -
getPartitionedSplitsInfo
PartitionedSplitsInfo getPartitionedSplitsInfo() -
failLocallyImmediately
Fails task from the coordinator perspective immediately, without waiting for acknowledgement from the remote task -
failRemotely
Fails task remotely; only transitions to failed state when we receive confirmation that remote operation is completed -
getQueuedPartitionedSplitsInfo
PartitionedSplitsInfo getQueuedPartitionedSplitsInfo() -
getUnacknowledgedPartitionedSplitCount
int getUnacknowledgedPartitionedSplitCount() -
retrieveAndDropSpoolingOutputStats
SpoolingOutputStats.Snapshot retrieveAndDropSpoolingOutputStats()Retrieves spooling output stats. Stats are available only for tasks that are in theTaskState.FINISHEDstate and have received the final task info (seeaddFinalTaskInfoListener(StateChangeListener). Stats can be retrieved only once and are discarded upon retrieval. Subsequent calls to the method after initial retrieval will fail.The retrieve-and-drop semantics is necessary to avoid unnecessary memory overhead of keeping the
SpoolingOutputStats.Snapshotfor every task as usually only the total output of the entire stage is of interest.- Returns:
- spooling output statistics
-