Constructor and Description |
---|
JobStack(int maxSize,
JobRepository repo) |
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. |
public JobStack(int maxSize, JobRepository repo)
public String addJob(JobSpec spec) throws JobQueueException
JobQueue
JobSpec
to the queue.addJob
in interface JobQueue
spec
- The JobSpec
to persist.JobQueueException
- If there is any error queueing the JobSpec
.public String requeueJob(JobSpec spec) throws JobQueueException
JobQueue
JobSpec
to the back of the queue.requeueJob
in interface JobQueue
spec
- The JobSpec
to re-add.JobQueueException
- If there is any error requeueing the JobSpec
.public List getQueuedJobs()
JobQueue
getQueuedJobs
in interface JobQueue
List
of queued JobSpec
s.public void purge()
JobQueue
JobSpec
s from the queue.public boolean isEmpty()
JobQueue
public JobSpec getNextJob()
JobQueue
JobSpec
from the queue, and correspondingly removes
it from persitance.getNextJob
in interface JobQueue
JobSpec
from the queue.public JobRepository getJobRepository()
JobQueue
getJobRepository
in interface JobQueue
JobRepository
.public int getCapacity()
JobQueue
getCapacity
in interface JobQueue
Copyright © 1999–2017 Apache OODT. All rights reserved.