public interface JobQueue
An interface for persisting JobSpec
s used by a
JobQueueController
.
Modifier and Type | Method and Description |
---|---|
String |
addJob(JobSpec spec)
Persists a
JobSpec to the queue. |
int |
getCapacity()
Gets the max number of jobs allowed in
queue at any given time
|
JobRepository |
getJobRepository()
|
JobSpec |
getNextJob()
Gets the next
JobSpec from the queue, and correspondingly removes
it from persitance. |
List |
getQueuedJobs()
|
int |
getSize()
Gets the number of jobs in queue
|
boolean |
isEmpty()
Returns a boolean value representing whether or not the queue is empty.
|
void |
purge()
Purges all
JobSpec s from the queue. |
String |
requeueJob(JobSpec spec)
Re-adds a
JobSpec to the back of the queue. |
String addJob(JobSpec spec) throws JobQueueException
JobSpec
to the queue.spec
- The JobSpec
to persist.JobQueueException
- If there is any error queueing the JobSpec
.String requeueJob(JobSpec spec) throws JobQueueException
JobSpec
to the back of the queue.spec
- The JobSpec
to re-add.JobQueueException
- If there is any error requeueing the JobSpec
.List getQueuedJobs()
List
of queued JobSpec
s.JobQueueException
- If there is any error obtaining the queued jobs.void purge()
JobSpec
s from the queue.JobQueueException
- If there is any error purging all the JobSpec
s.boolean isEmpty()
JobSpec getNextJob()
JobSpec
from the queue, and correspondingly removes
it from persitance.JobSpec
from the queue.JobQueueException
- If there is any error getting the next JobSpec
.JobRepository getJobRepository()
JobRepository
.int getSize()
int getCapacity()
Copyright © 1999–2017 Apache OODT. All rights reserved.