| Modifier and Type | Class and Description |
|---|---|
static class |
Task.TaskStat
Metrics and stats to track current task.
|
| Constructor and Description |
|---|
Task(Job job,
int taskId)
constructs Task.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Task o) |
boolean |
equals(java.lang.Object obj) |
void |
execute(BlockWorkerClient client,
WorkerInfo workerInfo)
run the task and set the response future.
|
Job |
getJob()
Get the job this task belongs to.
|
WorkerInfo |
getMyRunningWorker()
Get the worker info this task runs on.
|
int |
getPriority() |
com.google.common.util.concurrent.ListenableFuture<V> |
getResponseFuture() |
int |
getTaskId()
Get task id.
|
Task.TaskStat |
getTaskStat() |
int |
hashCode() |
protected abstract com.google.common.util.concurrent.ListenableFuture<V> |
run(BlockWorkerClient client)
run the task.
|
void |
setJob(Job job)
Set the job.
|
void |
setMyRunningWorker(WorkerInfo workerInfo)
Set the worker info this task runs on.
|
void |
setPriority(int priority)
Set priority.
|
java.lang.String |
toString() |
protected Job mMyJob
public Task(Job job, int taskId)
job - taskId - protected abstract com.google.common.util.concurrent.ListenableFuture<V> run(BlockWorkerClient client)
public WorkerInfo getMyRunningWorker()
public void setMyRunningWorker(WorkerInfo workerInfo)
workerInfo - public int getTaskId()
public com.google.common.util.concurrent.ListenableFuture<V> getResponseFuture()
public void execute(BlockWorkerClient client, WorkerInfo workerInfo)
client - worker clientworkerInfo - the worker informationpublic void setJob(Job job)
job - the jobpublic Job getJob()
public Task.TaskStat getTaskStat()
public int getPriority()
public void setPriority(int priority)
priority - public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(Task o)
compareTo in interface java.lang.Comparable<Task>public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2024. All Rights Reserved.