Class Task<V>

  • Type Parameters:
    V - the response type of the task
    All Implemented Interfaces:
    java.lang.Comparable<Task>

    public abstract class Task<V>
    extends java.lang.Object
    implements java.lang.Comparable<Task>
    A task that can be executed on a worker. Belongs to a Job.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Task.TaskStat
      State of a task.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Job mMyJob  
    • Constructor Summary

      Constructors 
      Constructor Description
      Task()
      Constructor.
    • Field Detail

      • mMyJob

        protected Job mMyJob
    • Constructor Detail

      • Task

        public Task()
        Constructor.
    • Method Detail

      • run

        protected abstract com.google.common.util.concurrent.ListenableFuture<V> run​(alluxio.client.block.stream.BlockWorkerClient client)
        run the task.
      • getMyRunningWorker

        public alluxio.wire.WorkerInfo getMyRunningWorker()
        Returns:
        my running worker
      • getResponseFuture

        public com.google.common.util.concurrent.ListenableFuture<V> getResponseFuture()
        Returns:
        the response future
      • execute

        public void execute​(alluxio.client.block.stream.BlockWorkerClient client,
                            alluxio.wire.WorkerInfo workerInfo)
        run the task and set the response future.
        Parameters:
        client - worker client
        workerInfo - the worker information
      • withJob

        public Task withJob​(Job job)
        Parameters:
        job - the job
        Returns:
        the task
      • getTaskStat

        public Task.TaskStat getTaskStat()
        Returns:
        task stat
      • getPriority

        public int getPriority()
        Returns:
        priority
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(Task o)
        Specified by:
        compareTo in interface java.lang.Comparable<V>
      • onComplete

        public void onComplete​(java.util.concurrent.Executor executor)
        Parameters:
        executor - the executor