Class TaskExecutorImpl

java.lang.Object
org.apache.polaris.service.task.TaskExecutorImpl
All Implemented Interfaces:
TaskExecutor

public class TaskExecutorImpl extends Object implements TaskExecutor
Given a list of registered TaskHandlers, execute tasks asynchronously with the provided CallContext.
  • Constructor Details

  • Method Details

    • init

      public void init()
    • addTaskHandler

      public void addTaskHandler(TaskHandler taskHandler)
      Add a TaskHandler. TaskEntitys will be tested against the TaskHandler.canHandleTask(TaskEntity) method and will be handled by the first handler that responds true.
    • addTaskHandlerContext

      public void addTaskHandlerContext(long taskEntityId, org.apache.polaris.core.context.CallContext callContext)
      Register a CallContext for a specific task id. That task will be loaded and executed asynchronously with a clone of the provided CallContext.
      Specified by:
      addTaskHandlerContext in interface TaskExecutor
    • handleTask

      protected void handleTask(long taskEntityId, org.apache.polaris.core.context.CallContext ctx, int attempt)