java.lang.Object
net.i2p.i2ptunnel.TunnelControllerGroup.RunnerHandler
Enclosing class:
TunnelControllerGroup

static class TunnelControllerGroup.RunnerHandlerextends Object
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

    Fields
    Modifier and Type
    Field
    Description
    (package private) int
    This tunnel's explicit runner-thread cap, or 0 to follow the Tuner-managed default at each rebalance.
    (package private) int
    The highest this pool has been elevated to under demand, or 0.
    (package private) ThreadPoolExecutor
    The per-tunnel pool, created on first use; null until then.
    (package private) long
    The pool's completed-task count as last observed while it was busy.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RunnerHandler(int ceiling)
    Creates the holder without a pool.
  • Method Summary

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ceiling

      volatile int ceiling
      This tunnel's explicit runner-thread cap, or 0 to follow the Tuner-managed default at each rebalance.
    • elevatedMax

      volatile int elevatedMax
      The highest this pool has been elevated to under demand, or 0. Kept separate from ceiling so 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 idleSinceCompleted
      The 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

      volatile ThreadPoolExecutor 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