@Singleton @OsgiServiceProvider(classes={JobCoordinator.class,JobCoordinatorMonitor.class}) public class JobCoordinatorImpl extends Object implements JobCoordinator, JobCoordinatorMonitor
DEFAULT_MAX_RETRIES
Constructor and Description |
---|
JobCoordinatorImpl()
Deprecated.
This no-arg constructor (and related changes) temporarily
allowing a JobCoordinatorImpl without specifying a global shared
MetricProvider will be removed again as soon as https://git.opendaylight.org/gerrit/#/c/67516/
and https://git.opendaylight.org/gerrit/#/c/67641/ are finally merged...
|
JobCoordinatorImpl(MetricProvider metricProvider) |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
enqueueJob(String key,
Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker)
Enqueues a job with DEFAULT_MAX_RETRIES (3) retries.
|
void |
enqueueJob(String key,
Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker,
int maxRetries)
Enqueues a job with max retries.
|
void |
enqueueJob(String key,
Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker,
RollbackCallable rollbackWorker)
Enqueues a job with a rollback task and DEFAULT_MAX_RETRIES (3) retries..
|
void |
enqueueJob(String key,
Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> 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 |
getExecuteAttempts()
Returns the job execution attempts.
|
long |
getFailedJobCount()
Returns the failed jobs count.
|
long |
getIncompleteTaskCount()
Returns the incomplete task count.
|
protected Thread |
getJobQueueHandlerThread() |
long |
getPendingTaskCount()
Returns the pending task count.
|
long |
getRetriesCount()
Returns the retry jobs count.
|
String |
toString() |
@Deprecated public JobCoordinatorImpl()
@Inject public JobCoordinatorImpl(MetricProvider metricProvider)
@PreDestroy public void destroy()
public void enqueueJob(String key, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker)
JobCoordinator
enqueueJob
in interface JobCoordinator
key
- The job's key. Jobs with the same key are run sequentially.
Jobs with different keys are run in parallel.mainWorker
- The task that runs for the job.public void enqueueJob(String key, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker, RollbackCallable rollbackWorker)
JobCoordinator
enqueueJob
in interface JobCoordinator
rollbackWorker
- The rollback task which runs in case the job's main task
fails.JobCoordinator.enqueueJob(String, Callable)
public void enqueueJob(String key, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker, int maxRetries)
JobCoordinator
enqueueJob
in interface JobCoordinator
maxRetries
- The maximum number of retries for the job's main task until it
succeeds.JobCoordinator.enqueueJob(String, Callable)
public void enqueueJob(String key, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker, @Nullable RollbackCallable rollbackWorker, int maxRetries)
JobCoordinator
enqueueJob
in interface JobCoordinator
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.JobCoordinator.enqueueJob(String, Callable, RollbackCallable)
,
JobCoordinator.enqueueJob(String, Callable, int)
public long getClearedTaskCount()
JobCoordinatorMonitor
getClearedTaskCount
in interface JobCoordinatorMonitor
public long getCreatedTaskCount()
JobCoordinatorMonitor
getCreatedTaskCount
in interface JobCoordinatorMonitor
public long getIncompleteTaskCount()
JobCoordinatorMonitor
getIncompleteTaskCount
in interface JobCoordinatorMonitor
public long getPendingTaskCount()
JobCoordinatorMonitor
getPendingTaskCount
in interface JobCoordinatorMonitor
public long getFailedJobCount()
JobCoordinatorMonitor
getFailedJobCount
in interface JobCoordinatorMonitor
public long getRetriesCount()
JobCoordinatorMonitor
getRetriesCount
in interface JobCoordinatorMonitor
public long getExecuteAttempts()
JobCoordinatorMonitor
getExecuteAttempts
in interface JobCoordinatorMonitor
protected Thread getJobQueueHandlerThread()
public String toString()
toString
in interface JobCoordinatorMonitor
toString
in class Object
Copyright © 2019 OpenDaylight. All rights reserved.