Package org.apache.polaris.service.task
Class TaskExecutorImpl
java.lang.Object
org.apache.polaris.service.task.TaskExecutorImpl
- All Implemented Interfaces:
TaskExecutor
Given a list of registered
TaskHandlers, execute tasks asynchronously with the provided
CallContext.-
Constructor Summary
ConstructorsConstructorDescriptionTaskExecutorImpl(Executor executor, org.apache.polaris.core.persistence.MetaStoreManagerFactory metaStoreManagerFactory, TaskFileIOSupplier fileIOSupplier, PolarisEventListener polarisEventListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTaskHandler(TaskHandler taskHandler) Add aTaskHandler.voidaddTaskHandlerContext(long taskEntityId, org.apache.polaris.core.context.CallContext callContext) Register aCallContextfor a specific task id.protected voidhandleTask(long taskEntityId, org.apache.polaris.core.context.CallContext ctx, int attempt) voidinit()
-
Constructor Details
-
TaskExecutorImpl
public TaskExecutorImpl(Executor executor, org.apache.polaris.core.persistence.MetaStoreManagerFactory metaStoreManagerFactory, TaskFileIOSupplier fileIOSupplier, PolarisEventListener polarisEventListener)
-
-
Method Details
-
init
public void init() -
addTaskHandler
Add aTaskHandler.TaskEntitys will be tested against theTaskHandler.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 aCallContextfor a specific task id. That task will be loaded and executed asynchronously with a clone of the providedCallContext.- Specified by:
addTaskHandlerContextin interfaceTaskExecutor
-
handleTask
protected void handleTask(long taskEntityId, org.apache.polaris.core.context.CallContext ctx, int attempt)
-