Class OSGiJobCoordinator
- java.lang.Object
-
- org.opendaylight.infrautils.jobcoordinator.internal.OSGiJobCoordinator
-
- All Implemented Interfaces:
JobCoordinator
,JobCoordinatorMonitor
@Beta public final class OSGiJobCoordinator extends Object implements JobCoordinator, JobCoordinatorMonitor
-
-
Field Summary
-
Fields inherited from interface org.opendaylight.infrautils.jobcoordinator.JobCoordinator
DEFAULT_MAX_RETRIES
-
-
Constructor Summary
Constructors Constructor Description OSGiJobCoordinator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enqueueJob(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.long
getClearedTaskCount()
Returns the cleared task count.long
getCreatedTaskCount()
Returns the created task count.long
getFailedJobCount()
Returns the failed jobs count.long
getIncompleteTaskCount()
Returns the incomplete task count.long
getPendingTaskCount()
Returns the pending task count.long
getRetriesCount()
Returns the retry jobs count.String
toString()
-
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
-
-
-
-
Method Detail
-
getClearedTaskCount
public long getClearedTaskCount()
Description copied from interface:JobCoordinatorMonitor
Returns the cleared task count.- Specified by:
getClearedTaskCount
in interfaceJobCoordinatorMonitor
-
getCreatedTaskCount
public long getCreatedTaskCount()
Description copied from interface:JobCoordinatorMonitor
Returns the created task count.- Specified by:
getCreatedTaskCount
in interfaceJobCoordinatorMonitor
-
getIncompleteTaskCount
public long getIncompleteTaskCount()
Description copied from interface:JobCoordinatorMonitor
Returns the incomplete task count.- Specified by:
getIncompleteTaskCount
in interfaceJobCoordinatorMonitor
-
getPendingTaskCount
public long getPendingTaskCount()
Description copied from interface:JobCoordinatorMonitor
Returns the pending task count.- Specified by:
getPendingTaskCount
in interfaceJobCoordinatorMonitor
-
getFailedJobCount
public long getFailedJobCount()
Description copied from interface:JobCoordinatorMonitor
Returns the failed jobs count.- Specified by:
getFailedJobCount
in interfaceJobCoordinatorMonitor
-
getRetriesCount
public long getRetriesCount()
Description copied from interface:JobCoordinatorMonitor
Returns the retry jobs count.- Specified by:
getRetriesCount
in interfaceJobCoordinatorMonitor
-
enqueueJob
public void enqueueJob(String key, Callable<List<? extends com.google.common.util.concurrent.ListenableFuture<?>>> mainWorker, RollbackCallable rollbackWorker, int maxRetries)
Description copied from interface:JobCoordinator
Enqueues a job with a rollback task and max retries. See class level documentation above for details re. the retry strategy.- Specified by:
enqueueJob
in interfaceJobCoordinator
rollbackWorker
- 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)
-
toString
public String toString()
- Specified by:
toString
in interfaceJobCoordinatorMonitor
- Overrides:
toString
in classObject
-
-