public class QueueJobCache extends Object
Constructor and Description |
---|
QueueJobCache(JobManagerConfiguration configuration,
QueueConfiguration.Type queueType,
Set<String> topics)
Create a new queue job cache
|
Modifier and Type | Method and Description |
---|---|
JobImpl |
getNextJob()
Get the next job.
|
Set<String> |
getTopics()
All topics of this queue.
|
void |
handleNewTopics(Set<String> topics)
Inform the queue cache about topics containing new jobs
|
boolean |
isEmpty()
Check whether there are jobs for this queue
|
void |
reschedule(JobHandler handler)
Reschedule a job
Reschedule the job and add it back into the cache.
|
public QueueJobCache(JobManagerConfiguration configuration, QueueConfiguration.Type queueType, Set<String> topics)
configuration
- Current job manager configurationinfo
- The queue infotopics
- The topics handled by this queue.public boolean isEmpty()
true
if there is any job outstanding.public JobImpl getNextJob()
#reschedule(JobImpl)
and #handleNewTopics(String)
can be called concurrently.public void handleNewTopics(Set<String> topics)
topics
- The set of topics to scanpublic void reschedule(JobHandler handler)
handler
- The job handlerCopyright © 2007–2014 The Apache Software Foundation. All rights reserved.