java.lang.Object
net.i2p.router.tunnel.pool.TestJob.BatchState
- Enclosing class:
TestJob
Runtime state owned by a single router context: the first-test buffer and its pump flag, the instance and in-flight gauges, and the running-test map. State is keyed by context because RouterContext documents multiple router instances in one JVM — a static buffer would let a pump for context A drain context B's candidates using A's clock, queue, stats, and dispatcher.
Field Summary
FieldsModifier and TypeFieldDescriptionTunnel keys currently in firstTestBuffer, for offer-time dedupe.(package private) final ObjectGuards firstTestBuffer and bufferedKeys.(package private) final Deque<TestJob.PendingTest> First-test candidates awaiting batched dispatch, oldest first.(package private) final AtomicIntegerTests dispatched to the network and awaiting a reply or timeout, across all pools.(package private) final AtomicLongLast time a batch-denial INFO line was logged (global rate limit).(package private) final ConcurrentHashMap<String, AtomicInteger> Per-pool dispatched tests awaiting completion, for the client and exploratory per-pool budget gates.(package private) final ConcurrentHashMap<String, AtomicInteger> Outstanding test-instance claims per pool, one per created TestJob (queued or running), released exactly once when the instance terminates.(package private) final AtomicBooleanSet while a PumpJob is queued or running; cleared when the buffer drains.(package private) booleanTrue while a restart or shutdown is draining the subsystem: offers and dispatch are refused until the reset finishes.(package private) final ConcurrentHashMap<Long, TestJob> Which tunnels currently have a test instance registered, so a duplicate cannot be created.(package private) final AtomicIntegerTestJob instances (queued + running) in this context; the memory bound checked againstTestJob.getHardLimit(RouterContext).Constructor Summary
ConstructorsMethod Summary
Field Details
totalTestJobs
TestJob instances (queued + running) in this context; the memory bound checked againstTestJob.getHardLimit(RouterContext).runningTests
Which tunnels currently have a test instance registered, so a duplicate cannot be created. Key: tunnel key, Value: the instance.poolTestCounts
Outstanding test-instance claims per pool, one per created TestJob (queued or running), released exactly once when the instance terminates. Feeds the per-pool budget inTestJob.shouldSchedule(RouterContext, PooledTunnelCreatorConfig). Key: pool identifier, Value: outstanding claims in that pool.inFlight
Tests dispatched to the network and awaiting a reply or timeout, across all pools. Unlike runningTests (which also counts delayed retests parked in the queue), this measures pressure actually on the wire and is the capacity gate for the batched first-test pump.poolInFlight
Per-pool dispatched tests awaiting completion, for the client and exploratory per-pool budget gates. Key: pool identifier, Value: in-flight tests in that pool.bufferLock
Guards firstTestBuffer and bufferedKeys.firstTestBuffer
First-test candidates awaiting batched dispatch, oldest first.bufferedKeys
pumpQueued
Set while a PumpJob is queued or running; cleared when the buffer drains.lastDenialLog
Last time a batch-denial INFO line was logged (global rate limit).quiesced
volatile boolean quiescedTrue while a restart or shutdown is draining the subsystem: offers and dispatch are refused until the reset finishes.
Constructor Details
BatchState
BatchState()Holds nothing beyond the field initializers below.