Interface TaskHandler

All Known Implementing Classes:
ActivityBasedTaskHandler

public interface TaskHandler
Author:
Radovan Semancik
  • Method Details

    • run

      TaskRunResult run(@NotNull @NotNull RunningTask task) throws TaskException
      Executes a task handler. TODO better description
      Throws:
      TaskException
    • heartbeat

      default Long heartbeat(Task task)
    • refreshStatus

      default void refreshStatus(Task task)
    • getDefaultChannel

      default String getDefaultChannel()
      Returns:
      Channel URI for tasks managed by this handler, if applicable.
    • getStatisticsCollectionStrategy

      @NotNull default @NotNull StatisticsCollectionStrategy getStatisticsCollectionStrategy()
    • onNodeDown

      default void onNodeDown(@NotNull @NotNull TaskType task, @NotNull @NotNull OperationResult result) throws CommonException
      Should update the state of the task (or related tasks) when the node on which this task executed was found down. Currently this means releasing buckets allocated to this task. In the future we plan to execute this method within a dynamic repo transaction.
      Throws:
      CommonException
    • onTaskStalled

      default void onTaskStalled(@NotNull @NotNull RunningTask task, long stalledSince, @NotNull @NotNull OperationResult result) throws CommonException
      Should update the state of the task when the task manager finds that the task is stalled, i.e. did not update its progress for a given (long) time.
      Throws:
      CommonException