public class QueueJobCache extends Object
Constructor and Description |
---|
QueueJobCache(JobManagerConfiguration configuration,
String queueName,
StatisticsManager statisticsManager,
QueueConfiguration.Type queueType,
Set<String> topics)
Create a new queue job cache
|
Modifier and Type | Method and Description |
---|---|
JobHandler |
getNextJob(JobConsumerManager jobConsumerManager,
StatisticsManager statisticsManager,
Queue queue,
boolean doFull)
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(String queueName,
JobHandler handler,
StatisticsManager statisticsManager)
Reschedule a job
Reschedule the job and add it back into the cache.
|
void |
setIsBlocked(boolean value) |
public QueueJobCache(JobManagerConfiguration configuration, String queueName, StatisticsManager statisticsManager, QueueConfiguration.Type queueType, Set<String> topics)
configuration
- Current job manager configurationqueueType
- The queue typetopics
- The topics handled by this queue.public boolean isEmpty()
true
if there is any job outstanding.public void setIsBlocked(boolean value)
public JobHandler getNextJob(JobConsumerManager jobConsumerManager, StatisticsManager statisticsManager, Queue queue, boolean doFull)
#reschedule(JobHandler)
and handleNewTopics(Set)
can be called concurrently.public void handleNewTopics(Set<String> topics)
topics
- The set of topics to scanpublic void reschedule(String queueName, JobHandler handler, StatisticsManager statisticsManager)
handler
- The job handlerCopyright © 2007–2015 The Apache Software Foundation. All rights reserved.