java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
net.i2p.router.JobQueueRunner
- All Implemented Interfaces:
Runnable
Worker thread that executes jobs from the router job queue. Handles job execution, timing collection, error handling, and performance monitoring for individual job processing threads.
Nested Class Summary
Nested classes/interfaces inherited from class I2PThread
I2PThread.OOMEventListenerModifier and TypeClassDescriptionstatic interfaceListener for out-of-memory events.Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandlerField Summary
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYConstructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionThe job currently being executed.longTime the last job began.longTime the last job ended.The most recently completed job.intIdentifier for this runner.voidrun()Run the thread, catching and reporting OOM and other failures.voidStart the runner.voidStop the runner.Methods inherited from class I2PThread
addOOMEventListener, fireOOM, removeOOMEventListener, startModifier and TypeMethodDescriptionstatic voidRegister a new component that wants notification of OOM events.protected voidfireOOM(OutOfMemoryError oom) Notify listeners that an OutOfMemoryError occurred.static voidUnregister a component that wants notification of OOM events.voidstart()Overridden to provide useful info to users on OOM, and to prevent shutting down the whole JVM for what is most likely not a heap issue.Methods inherited from class Thread
activeCount, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, threadId, toString, yield
Constructor Details
JobQueueRunner
Create a new job queue runner.- Parameters:
context- the router contextid- the runner id
Method Details
getCurrentJob
getLastJob
getRunnerId
public int getRunnerId()Identifier for this runner.- Returns:
- the runner id
stopRunning
public void stopRunning()Stop the runner.startRunning
public void startRunning()Start the runner.getLastBegin
public long getLastBegin()Time the last job began.- Returns:
- the time the last job began
getLastEnd
public long getLastEnd()Time the last job ended.- Returns:
- the time the last job ended
run