java.lang.Object
net.i2p.i2ptunnel.TunnelControllerGroup.RunnerHandler
- Enclosing class:
TunnelControllerGroup
Per-tunnel runner pool state: the explicit per-tunnel ceiling and the lazily created executor.
ceiling is the tunnel's own configured cap, or 0 when it follows the Tuner-managed default. It is deliberately NOT the resolved number: resolving it at registration freezes the default as it stood then, and TunnelControllerGroup.rebalanceRunnerPools() would keep dividing the frozen figure after the default had grown. Callers ask TunnelControllerGroup.runnerCeilingFor(RunnerHandler) for the live value.
Field Summary
FieldsModifier and TypeFieldDescription(package private) intThis tunnel's explicit runner-thread cap, or 0 to follow the Tuner-managed default at each rebalance.(package private) intThe highest this pool has been elevated to under demand, or 0.(package private) ThreadPoolExecutorThe per-tunnel pool, created on first use; null until then.(package private) longThe pool's completed-task count as last observed while it was busy.Constructor Summary
ConstructorsMethod Summary
Field Details
ceiling
volatile int ceilingThis tunnel's explicit runner-thread cap, or 0 to follow the Tuner-managed default at each rebalance.elevatedMax
volatile int elevatedMaxThe highest this pool has been elevated to under demand, or 0. Kept separate fromceilingso the two compose: an elevation survives the next rebalance, and a later rise in the Tuner default is still picked up. Decays back to 0 once the pool has done enough work while quiet, because the budget is shared and a one-off spike must not reallocate it permanently.idleSinceCompleted
volatile long idleSinceCompletedThe pool's completed-task count as last observed while it was busy. Decay measures idle work against this, so the rule is expressed in the pool's own throughput rather than in wall-clock seconds.executor
The per-tunnel pool, created on first use; null until then.
Constructor Details
RunnerHandler
RunnerHandler(int ceiling) Creates the holder without a pool.- Parameters:
ceiling- the maximum number of worker threads this tunnel's pool may grow to