Package io.prestosql.server.remotetask
Class TaskInfoFetcher
- java.lang.Object
-
- io.prestosql.server.remotetask.TaskInfoFetcher
-
- All Implemented Interfaces:
SimpleHttpResponseCallback<TaskInfo>
public class TaskInfoFetcher extends Object implements SimpleHttpResponseCallback<TaskInfo>
-
-
Constructor Summary
Constructors Constructor Description TaskInfoFetcher(Consumer<Throwable> onFail, TaskInfo initialTask, io.airlift.http.client.HttpClient httpClient, io.airlift.units.Duration updateInterval, io.airlift.json.JsonCodec<TaskInfo> taskInfoCodec, io.airlift.units.Duration maxErrorDuration, boolean summarizeTaskInfo, Executor executor, ScheduledExecutorService updateScheduledExecutor, ScheduledExecutorService errorScheduledExecutor, RemoteTaskStats stats)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFinalTaskInfoListener(StateMachine.StateChangeListener<TaskInfo> stateChangeListener)
Add a listener for the final task info.void
failed(Throwable cause)
void
fatal(Throwable cause)
TaskInfo
getTaskInfo()
void
start()
void
success(TaskInfo newValue)
-
-
-
Constructor Detail
-
TaskInfoFetcher
public TaskInfoFetcher(Consumer<Throwable> onFail, TaskInfo initialTask, io.airlift.http.client.HttpClient httpClient, io.airlift.units.Duration updateInterval, io.airlift.json.JsonCodec<TaskInfo> taskInfoCodec, io.airlift.units.Duration maxErrorDuration, boolean summarizeTaskInfo, Executor executor, ScheduledExecutorService updateScheduledExecutor, ScheduledExecutorService errorScheduledExecutor, RemoteTaskStats stats)
-
-
Method Detail
-
getTaskInfo
public TaskInfo getTaskInfo()
-
start
public void start()
-
addFinalTaskInfoListener
public void addFinalTaskInfoListener(StateMachine.StateChangeListener<TaskInfo> stateChangeListener)
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 leakingthis
when adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution.
-
success
public void success(TaskInfo newValue)
- Specified by:
success
in interfaceSimpleHttpResponseCallback<TaskInfo>
-
failed
public void failed(Throwable cause)
- Specified by:
failed
in interfaceSimpleHttpResponseCallback<TaskInfo>
-
fatal
public void fatal(Throwable cause)
- Specified by:
fatal
in interfaceSimpleHttpResponseCallback<TaskInfo>
-
-