|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.JobQueue
public class JobQueue
Manage the pending jobs according to whatever algorithm is appropriate, giving preference to earlier scheduled jobs. For use by the router only. Not to be used by applications or plugins.
Constructor Summary | |
---|---|
JobQueue(RouterContext context)
Does not start the pumper. |
Method Summary | |
---|---|
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) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JobQueue(RouterContext context)
Method Detail |
---|
public void addJob(Job job)
public void removeJob(Job job)
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.
public void timingUpdated()
public int getReadyCount()
public long getMaxLag()
public void allowParallelOperation()
public void startup()
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 parameter
public Collection<JobStats> getJobStats()
public void renderStatusHTML(Writer out) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |