public class JobQueue extends Object
Constructor and Description |
---|
JobQueue(RouterContext context)
Does not start the pumper.
|
Modifier and Type | Method and Description |
---|---|
void |
addJob(Job job)
Enqueue the specified job
|
void |
allowParallelOperation() |
int |
getJobs(Collection<Job> readyJobs,
Collection<Job> timedJobs,
Collection<Job> activeJobs,
Collection<Job> justFinishedJobs)
Dump the current state.
|
Collection<JobStats> |
getJobStats()
Current job stats.
|
Job |
getLastJob()
retrieve the most recently begin and still currently active job, or null if
no jobs are running
|
long |
getLastJobBegin()
When did the most recently begin job start?
|
long |
getLastJobEnd()
When did the most recently begin job start?
|
long |
getMaxLag() |
(package private) Job |
getNext()
Blocking call to retrieve the next ready job
|
int |
getReadyCount() |
(package private) boolean |
isAlive() |
boolean |
isJobActive(Job job)
Deprecated.
unused
|
void |
removeJob(Job job) |
(package private) void |
removeRunner(int id) |
void |
renderStatusHTML(Writer out)
Deprecated.
moved to router console
|
void |
restart()
Deprecated.
do you really want to do this?
|
void |
runQueue(int numThreads)
Start up the queue with the specified number of concurrent processors.
|
(package private) void |
shutdown() |
void |
startup()
Start the pumper.
|
void |
timingUpdated()
Deprecated.
contention - see JobTiming.setStartAfter() comments
|
(package private) void |
updateStats(Job job,
long doStart,
long origStartAfter,
long duration)
calculate and update the job timings
if it was lagged too much or took too long to run, spit out
a warning (and if its really excessive, kill the router)
|
public JobQueue(RouterContext context)
public void addJob(Job job)
public void removeJob(Job job)
@Deprecated public boolean isJobActive(Job job)
true
if a given job is waiting or running;
false
if the job is finished or doesn't exist in the queue.@Deprecated public void timingUpdated()
public int getReadyCount()
public long getMaxLag()
public void allowParallelOperation()
public void startup()
@Deprecated public void restart()
void shutdown()
boolean isAlive()
public long getLastJobBegin()
public long getLastJobEnd()
public Job getLastJob()
Job getNext()
public void runQueue(int numThreads)
void removeRunner(int id)
void updateStats(Job job, long doStart, long origStartAfter, long duration)
public int getJobs(Collection<Job> readyJobs, Collection<Job> timedJobs, Collection<Job> activeJobs, Collection<Job> justFinishedJobs)
readyJobs
- out parametertimedJobs
- out parameteractiveJobs
- out parameterjustFinishedJobs
- out parameterpublic Collection<JobStats> getJobStats()
@Deprecated public void renderStatusHTML(Writer out) throws IOException
IOException