Class JobCoordinatorImpl
- java.lang.Object
-
- org.opendaylight.infrautils.jobcoordinator.internal.JobCoordinatorImpl
-
- All Implemented Interfaces:
JobCoordinator,JobCoordinatorMonitor
@Singleton public class JobCoordinatorImpl extends Object implements JobCoordinator, JobCoordinatorMonitor
-
-
Field Summary
-
Fields inherited from interface org.opendaylight.infrautils.jobcoordinator.JobCoordinator
DEFAULT_MAX_RETRIES
-
-
Constructor Summary
Constructors Constructor Description JobCoordinatorImpl(MetricProvider metricProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()voidenqueueJob(String key, Callable<List<? extends com.google.common.util.concurrent.ListenableFuture<?>>> mainWorker, RollbackCallable rollbackWorker, int maxRetries)Enqueues a job with a rollback task and max retries.longgetClearedTaskCount()Returns the cleared task count.longgetCreatedTaskCount()Returns the created task count.longgetFailedJobCount()Returns the failed jobs count.longgetIncompleteTaskCount()Returns the incomplete task count.protected ThreadgetJobQueueHandlerThread()longgetPendingTaskCount()Returns the pending task count.longgetRetriesCount()Returns the retry jobs count.voidinitialize()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opendaylight.infrautils.jobcoordinator.JobCoordinator
enqueueJob, enqueueJob, enqueueJob
-
-
-
-
Constructor Detail
-
JobCoordinatorImpl
@Inject public JobCoordinatorImpl(MetricProvider metricProvider)
-
-
Method Detail
-
initialize
@PostConstruct public void initialize()
-
destroy
@PreDestroy public void destroy()
-
enqueueJob
public void enqueueJob(String key, Callable<List<? extends com.google.common.util.concurrent.ListenableFuture<?>>> mainWorker, RollbackCallable rollbackWorker, int maxRetries)
Description copied from interface:JobCoordinatorEnqueues a job with a rollback task and max retries. See class level documentation above for details re. the retry strategy.- Specified by:
enqueueJobin interfaceJobCoordinatorrollbackWorker- The rollback task which runs in case the job's main task fails.maxRetries- The maximum number of retries for the job's main task until it succeeds.- See Also:
JobCoordinator.enqueueJob(String, Callable, RollbackCallable),JobCoordinator.enqueueJob(String, Callable, int)
-
getClearedTaskCount
public long getClearedTaskCount()
Description copied from interface:JobCoordinatorMonitorReturns the cleared task count.- Specified by:
getClearedTaskCountin interfaceJobCoordinatorMonitor
-
getCreatedTaskCount
public long getCreatedTaskCount()
Description copied from interface:JobCoordinatorMonitorReturns the created task count.- Specified by:
getCreatedTaskCountin interfaceJobCoordinatorMonitor
-
getIncompleteTaskCount
public long getIncompleteTaskCount()
Description copied from interface:JobCoordinatorMonitorReturns the incomplete task count.- Specified by:
getIncompleteTaskCountin interfaceJobCoordinatorMonitor
-
getPendingTaskCount
public long getPendingTaskCount()
Description copied from interface:JobCoordinatorMonitorReturns the pending task count.- Specified by:
getPendingTaskCountin interfaceJobCoordinatorMonitor
-
getFailedJobCount
public long getFailedJobCount()
Description copied from interface:JobCoordinatorMonitorReturns the failed jobs count.- Specified by:
getFailedJobCountin interfaceJobCoordinatorMonitor
-
getRetriesCount
public long getRetriesCount()
Description copied from interface:JobCoordinatorMonitorReturns the retry jobs count.- Specified by:
getRetriesCountin interfaceJobCoordinatorMonitor
-
getJobQueueHandlerThread
protected Thread getJobQueueHandlerThread()
-
toString
public String toString()
- Specified by:
toStringin interfaceJobCoordinatorMonitor- Overrides:
toStringin classObject
-
-