Class TaskTideExecutor<T extends TaskTideModel<T>>
java.lang.Object
org.tasktide.engine.executor.TaskTideExecutor<T>
- All Implemented Interfaces:
TaskTideWorkerUnit<T>
- Direct Known Subclasses:
ItemTaskExecutor
public abstract class TaskTideExecutor<T extends TaskTideModel<T>>
extends Object
implements TaskTideWorkerUnit<T>
Abstract class to handle the nuances of workload execution
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.logging.log4j.Loggerprotected final TaskTideEngineObserver<T> protected intprotected final ProcessExecutorprotected static final AtomicInteger -
Constructor Summary
ConstructorsConstructorDescriptionTaskTideExecutor(TaskTideEngineObserver<T> observer, org.apache.logging.log4j.Logger LOGGER) Construct worker with workload and process runner -
Method Summary
Modifier and TypeMethodDescriptionvoidDecrement countabstract booleanexecuteTask(T task) Abstract method to allow sub-classes to define logic around task executionstatic intFetch value atomic counterintGet process countvoidhandleFailure(T task, Exception ex) Abstract method to allow sub-classes to define logic around handling failed task executionvoidIncrement process countvoidThread safe execution of tasks in a workload
-
Field Details
-
LOGGER
protected final org.apache.logging.log4j.Logger LOGGER -
processExecutor
-
processCount
protected int processCount -
observer
-
-
Constructor Details
-
TaskTideExecutor
Construct worker with workload and process runner- Parameters:
observer-LOGGER-
-
-
Method Details
-
runTasks
-
executeTask
Abstract method to allow sub-classes to define logic around task execution- Parameters:
task-- Returns:
- boolean
- Throws:
IOExceptionInterruptedException
-
handleFailure
-
getGlobalCount
public static int getGlobalCount()Fetch value atomic counter- Returns:
- int
-
getProcesCount
public int getProcesCount()Get process count- Returns:
- int
-
incrementCount
public void incrementCount()Increment process count -
decrementCount
public void decrementCount()Decrement count
-