public interface JobCoordinator
Enqueued jobs are stored in unbounded queues until they are run, this should be kept in mind as it might lead to an OOM.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_RETRIES |
Modifier and Type | Method and Description |
---|---|
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.
|
static final int DEFAULT_MAX_RETRIES
void enqueueJob(String key, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker)
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.void enqueueJob(String key, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker, RollbackCallable rollbackWorker)
rollbackWorker
- The rollback task which runs in case the job's main task
fails.enqueueJob(String, Callable)
void enqueueJob(String key, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker, int maxRetries)
maxRetries
- The maximum number of retries for the job's main task until it
succeeds.enqueueJob(String, Callable)
void enqueueJob(String key, Callable<List<com.google.common.util.concurrent.ListenableFuture<Void>>> mainWorker, RollbackCallable rollbackWorker, int maxRetries)
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.enqueueJob(String, Callable, RollbackCallable)
,
enqueueJob(String, Callable, int)
Copyright © 2019 OpenDaylight. All rights reserved.