public class FifoMappedJobQueue extends Object implements MappedJobQueue
JobQueue that ensures
 the FIFO execution of jobs.| Constructor and Description | 
|---|
| FifoMappedJobQueue(int maxSize,
                  JobRepository repo) | 
| Modifier and Type | Method and Description | 
|---|---|
| String | addJob(JobSpec spec)Persists a  JobSpecto the queue. | 
| void | addQueue(String queueName)Add a queue with the given name. | 
| int | getCapacity()This method returns the number of jobs in any given queue that can be
 retained in the queue. | 
| JobRepository | getJobRepository() | 
| JobSpec | getNextJob()Gets the next  JobSpecfrom the queue, and correspondingly removes
 it from persitance. | 
| JobSpec | getNextJob(String queueName)Gets the next  JobSpecin the queue with the given name. | 
| List | getQueuedJobs() | 
| List<JobSpec> | getQueuedJobs(String queueName)Gets a list of all queued jobs that belong to the queue with the given
 name. | 
| List<String> | getQueueNames() | 
| int | getSize()Gets the number of jobs in queue | 
| int | getSize(String queueName)Gets the number of jobs in the queue with the given name. | 
| boolean | isEmpty()Returns a boolean value representing whether or not the queue is empty. | 
| boolean | isEmpty(String queueName)Returns a boolean value representing whether or not the job queue contains
 jobs in the given queue. | 
| void | promoteJob(JobSpec spec) | 
| void | promoteKeyValPair(String key,
                 String val) | 
| void | purge()Purges all  JobSpecs from the queue. | 
| void | removeJob(JobSpec spec)Removes the  JobSpecwith the given ID from the queue. | 
| void | removeQueue(String queueName)Remove the queue with the given name. | 
| String | requeueJob(JobSpec spec)Re-adds a  JobSpecto the back of the queue. | 
public FifoMappedJobQueue(int maxSize,
                          JobRepository repo)
public String addJob(JobSpec spec) throws JobQueueException
JobQueueJobSpec to the queue.addJob in interface JobQueueaddJob in interface MappedJobQueuespec - The JobSpec to persist.JobQueueException - If there is any error queueing the JobSpec.org.apache.oodt.cas.resource.jobqueue.JobQueue.addJob(JobSpec)public String requeueJob(JobSpec spec) throws JobQueueException
JobQueueJobSpec to the back of the queue.requeueJob in interface JobQueuerequeueJob in interface MappedJobQueuespec - The JobSpec to re-add.JobQueueException - If there is any error requeueing the JobSpec.org.apache.oodt.cas.resource.jobqueue.JobQueue.requeueJob(JobSpec)public List getQueuedJobs()
JobQueuegetQueuedJobs in interface JobQueueList of queued JobSpecs.org.apache.oodt.cas.resource.jobqueue.JobQueue.getQueuedJobs()public List<JobSpec> getQueuedJobs(String queueName) throws JobQueueException, JobRepositoryException
MappedJobQueuegetQueuedJobs in interface MappedJobQueuequeueName - The name of the queue whose members will be given.List of queued s from the given queue.JobQueueException - If the given queue name is null or if no queue with the given
           name exists.JobRepositoryExceptionpublic void purge()
JobQueueJobSpecs from the queue.public boolean isEmpty()
JobQueuepublic boolean isEmpty(String queueName) throws JobQueueException
MappedJobQueueisEmpty in interface MappedJobQueuequeueName - The name of the queue which you are checking.JobQueueException - If the given queue name is null or if no queue with that name
           exists.public JobSpec getNextJob()
JobQueueJobSpec from the queue, and correspondingly removes
 it from persitance.getNextJob in interface JobQueueJobSpec from the queue.org.apache.oodt.cas.resource.jobqueue.JobQueue.getNextJob()public JobSpec getNextJob(String queueName) throws JobQueueException, JobRepositoryException
MappedJobQueueJobSpec in the queue with the given name.getNextJob in interface MappedJobQueuequeueName - The name of the queue from which the next JobSpec will be
          returned.JobSpec from the jobqueue belonging to the queue
         with the given name.JobQueueException - If the given queue name is null or if no queue with that name
           exists.JobRepositoryExceptionpublic JobRepository getJobRepository()
JobQueuegetJobRepository in interface JobQueueJobRepository.org.apache.oodt.cas.resource.jobqueue.JobQueue.getJobRepository()public int getSize()
JobQueuepublic int getSize(String queueName) throws JobQueueException
MappedJobQueuegetSize in interface MappedJobQueuequeueName - The name of the queue whos size will be given.JobSpecs in the queue with the given name.JobQueueException - If the given queue name is null or if no queue with that name
           exists.public int getCapacity()
getCapacity in interface JobQueuepublic void removeJob(JobSpec spec) throws JobQueueException
MappedJobQueueJobSpec with the given ID from the queue.removeJob in interface MappedJobQueueJobQueueException - If no JobSpec has the given ID.public void addQueue(String queueName) throws JobQueueException
MappedJobQueueaddQueue in interface MappedJobQueuequeueName - The name of the queue to be created.JobQueueException - If the given queue name is null or if a queue with the given name
           already exists.public void removeQueue(String queueName) throws JobQueueException
MappedJobQueueremoveQueue in interface MappedJobQueuequeueName - The name of the queue to be removed.JobQueueException - If the given queue name is null or if no queue with the given
           name exists.public void promoteJob(JobSpec spec) throws JobQueueException
promoteJob in interface MappedJobQueueJobQueueExceptionpublic void promoteKeyValPair(String key, String val) throws JobQueueException, JobRepositoryException
promoteKeyValPair in interface MappedJobQueueJobQueueExceptionJobRepositoryExceptionCopyright © 1999–2017 Apache OODT. All rights reserved.