Packages that use PooledTunnelCreatorConfig
Package
Description
Tunnel pool management: pool lifecycle, peer selection, build scheduling and failure handling for client and exploratory tunnels.
Uses of PooledTunnelCreatorConfig in net.i2p.router.tunnel.pool
Fields in net.i2p.router.tunnel.pool declared as PooledTunnelCreatorConfigModifier and TypeFieldDescriptionprivate final PooledTunnelCreatorConfigBuildRequestor.TunnelBuildFirstHopFailJob._cfgThe tunnel whose build failed.private final PooledTunnelCreatorConfigTestJob._cfgThe pool's tunnel configuration.(package private) final PooledTunnelCreatorConfigBuildHandler.BuildEndMessageState.cfgThe tunnel being built.(package private) final PooledTunnelCreatorConfigTestJob.PendingTest.cfgThe tunnel build config this candidate will test.(package private) final PooledTunnelCreatorConfigExpireJob.TunnelExpiration.configThe tunnel's config.Fields in net.i2p.router.tunnel.pool with type parameters of type PooledTunnelCreatorConfigModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<Long, PooledTunnelCreatorConfig> BuildExecutor._currentlyBuildingMapTunnels currently being built, by reply id.private final List<PooledTunnelCreatorConfig> TunnelPool._inProgressConfigs with builds in flight, guarded by the manager.private final ConcurrentHashMap<Long, PooledTunnelCreatorConfig> BuildExecutor._recentlyBuildingMapRecently finished builds, by reply id.private List<PooledTunnelCreatorConfig> TunnelPool.TunnelStats.lastChanceTestsLazily created: stale UNTESTED tunnels kept for one last-chance test.private List<PooledTunnelCreatorConfig> TunnelPool.TunnelStats.strandedTestsLazily created: stranded UNTESTED tunnels whose first test was never scheduled.Methods in net.i2p.router.tunnel.pool that return PooledTunnelCreatorConfigModifier and TypeMethodDescription(package private) PooledTunnelCreatorConfigAliasedTunnelPool.configureNewTunnel()(package private) PooledTunnelCreatorConfigTunnelPool.configureNewTunnel()This only sets the peers and creation/expiration times in the configuration.private PooledTunnelCreatorConfigTunnelPool.configureNewTunnel(boolean forceZeroHop) This only sets the peers and creation/expiration times in the configuration.(package private) PooledTunnelCreatorConfigTunnelPool.configureNewTunnel(boolean forceZeroHop, Set<Hash> excludeFirstHops) Configure a new tunnel, optionally excluding peers from first-hop selection.private PooledTunnelCreatorConfigTunnelPool.createConfig(TunnelPoolSettings settings, List<Hash> peers, long now, long expiration) Build the config with the given peers, endpoint first.private PooledTunnelCreatorConfigTunnelPool.findPairedInPool(TunnelPool pool, TunnelId pairedGW) Look up the paired tunnel in the given pool.private PooledTunnelCreatorConfigBuildExecutor.getOldestBuildingConfiguration()The oldest build in the building map, by the creation time of its first hop.(package private) PooledTunnelCreatorConfigBuildExecutor.removeFromBuilding(long id) This returns the PTCC up to a minute after it 'expired', thus allowing us to still use a tunnel if it was accepted, and to update peer stats.Methods in net.i2p.router.tunnel.pool that return types with arguments of type PooledTunnelCreatorConfigModifier and TypeMethodDescriptionTunnelPool.cancelExcessInProgress(int maxAllowed) Cancel excess in-progress tunnel builds to stay within budget.AliasedTunnelPool.listPending()TunnelPool.listPending()List of tunnelInfo instances of tunnels currently being built.Methods in net.i2p.router.tunnel.pool with parameters of type PooledTunnelCreatorConfigModifier and TypeMethodDescriptionprivate static voidTunnelPool.addStrandedTest(TunnelPool.TunnelStats stats, PooledTunnelCreatorConfig cfg) Collect a tunnel for the stranded re-offer, bounded byTestJob.MAX_STRANDED_OFFERS_PER_SWEEPper sweep.private booleanBuildExecutor.addToBuilding(PooledTunnelCreatorConfig cfg) Only do this for non-fallback tunnels.(package private) static StringTestJob.batchDenialReason(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool) Live gate evaluation for one buffered candidate: reads the in-flight gauges and configured budgets from the context's runtime state, then defers to the pure overload.(package private) voidAliasedTunnelPool.buildComplete(PooledTunnelCreatorConfig cfg, BuildExecutor.Result result) voidBuildExecutor.buildComplete(PooledTunnelCreatorConfig cfg, BuildExecutor.Result result) Handle a completed tunnel build.voidBuildExecutor.buildComplete(PooledTunnelCreatorConfig cfg, BuildExecutor.Result result, String detail) Handle a completed tunnel build with additional detail.(package private) voidTunnelPool.buildComplete(PooledTunnelCreatorConfig cfg, BuildExecutor.Result result) Remove from the _inprogress list and call addTunnel() if result is SUCCESS.(package private) voidTunnelPoolManager.buildComplete(PooledTunnelCreatorConfig cfg) Queue a recurring test job if appropriate.(package private) voidBuildExecutor.buildTunnel(PooledTunnelCreatorConfig cfg) Build a tunnel with the given configuration.private static voidBuildRequestor.buildZeroHop(RouterContext ctx, PooledTunnelCreatorConfig cfg, BuildExecutor exec) Sends the records for a zero hop tunnel.private longBuildExecutor.calculateAdaptiveTimeout(PooledTunnelCreatorConfig cfg) Calculate adaptive timeout based on tunnel characteristics and network conditions.private longBuildExecutor.calculateAdaptiveTimeout(PooledTunnelCreatorConfig cfg, int cpuLoad, long rttFloor) Cached-variant ofBuildExecutor.calculateAdaptiveTimeout(PooledTunnelCreatorConfig).(package private) static TestJob.InstanceClaimsTestJob.claimBatchSlot(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool) Reserve the instance slots a batched TestJob needs: the total counter (memory bound) and the per-pool claim.(package private) voidBuildExecutor.cooldownFailedPeers(PooledTunnelCreatorConfig cfg) Cool down the contacted hop of a failed build so the immediate retry selects a different peer.private voidBuildExecutor.countExpiryVeto(PooledTunnelCreatorConfig cfg) Record why an expiring build had previously been refused expiry.private static TunnelBuildMessageBuildRequestor.createTunnelBuildMessage(RouterContext ctx, TunnelPool pool, PooledTunnelCreatorConfig cfg, TunnelInfo pairedTunnel, BuildExecutor exec) Creates a tunnel build message using the most efficient format supported by all hops and the local router.private booleanTunnelPool.fastFailTbrTarget(TunnelPoolSettings settings, PooledTunnelCreatorConfig cfg) Fast-fail for outbound tunnels: skip this build cycle when the TBR target (cfg.getPeer(1)) is not connected and not connecting — the TBR is sent directly to this peer via transport.static HashBuildRequestor.getBuildRequestPeer(PooledTunnelCreatorConfig cfg) The peer that will receive the tunnel build request (TBM): the gateway (peer 0) for inbound tunnels, or the next hop (peer 1) for outbound tunnels.static LongExpireJob.getTunnelKey(PooledTunnelCreatorConfig cfg) Get the unique key for this tunnel config.private static LongTestJob.getTunnelKey(PooledTunnelCreatorConfig cfg) Generate a unique key for a tunnel to track running tests.private voidTunnelPool.handleBuildResult(PooledTunnelCreatorConfig cfg, BuildExecutor.Result result) Handle the build result: update the consecutive timeout counter and the paired tunnel profile per outcome.private static booleanBuildRequestor.handleInboundBuild(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelInfo pairedTunnel, I2NPMessage msgIn, BuildExecutor exec, Log log) Dispatch an inbound build request through the paired tunnel, garlic-wrapping the ShortTBM when the IBGW differs from the paired tunnel's endpoint so the IBGW identity stays hidden.private static voidBuildRequestor.handleOutboundBuild(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelInfo pairedTunnel, I2NPMessage msg, BuildExecutor exec, Log log, long firstHopTimeout) Builds and sends the records for one outbound tunnel.private voidBuildHandler.handleReply(TunnelBuildReplyMessage msg, PooledTunnelCreatorConfig cfg, long delay) Blocking call to handle a single inbound reply.private booleanBuildExecutor.hasBuildInFlightToFirstHop(PooledTunnelCreatorConfig cfg) Whether another build request is already in flight whose first hop (the peer the request is dispatched to) matches this config's.(package private) static booleanTestJob.hasValidTunnelIds(PooledTunnelCreatorConfig cfg) Whether the tunnel config has non-zero tunnel IDs at hop 0, i.e.private static intBuildExecutor.indexOfPeer(PooledTunnelCreatorConfig cfg, Hash peer) Zero-based position ofpeerin the build path, or -1 when absent.(package private) static booleanTestJob.isEarlyExpiry(PooledTunnelCreatorConfig cfg, long now) Whether the tunnel expires so soon it is not worth testing — it has already been pruned for early expiry.(package private) static booleanTestJob.isPingTunnel(PooledTunnelCreatorConfig cfg) Whether the tunnel belongs to a ping pool, which is short-lived and does not need testing.(package private) static booleanTestJob.isPoolMember(TunnelPool pool, PooledTunnelCreatorConfig cfg) Whether a pool still owns a tunnel config, i.e.private voidTunnelPool.logConfigDebug(PooledTunnelCreatorConfig cfg, List<Hash> peers) Logs a new tunnel's config and peers at debug level.(package private) static booleanTestJob.offerFirstTest(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool) Offer a tunnel's first test to the batched dispatch buffer instead of creating a queue entry per tunnel.(package private) voidBuildExecutor.penalizeTimeout(PooledTunnelCreatorConfig cfg) Penalize the peers of an expired build.(package private) static booleanBuildRequestor.preConnectFallback(RouterContext ctx, Hash peer, PooledTunnelCreatorConfig cfg, BuildExecutor exec) Approach 2: Fire-and-forget fallback — attempt to establish the transport session and retry the build once.private static voidBuildRequestor.prepare(RouterContext ctx, PooledTunnelCreatorConfig cfg) Assigns tunnel IDs to each hop in the configuration.private voidBuildExecutor.recordBuildDirection(PooledTunnelCreatorConfig cfg, BuildExecutor.Result result) Record one build outcome against the direction being built.private voidTunnelPool.recordPeerCooldownOnReject(PooledTunnelCreatorConfig cfg, BuildExecutor.Result result) Record peer cooldown on build failure so bad OBEPs/IBGWs aren't retried.static voidExpireJob.removeFromExpiration(PooledTunnelCreatorConfig cfg) Remove a tunnel from the expiration queue.(package private) voidTunnelPoolManager.removeFromExpiration(PooledTunnelCreatorConfig cfg) Remove a tunnel from the expiration queue to prevent memory leak.(package private) voidTunnelPool.removeInProgress(PooledTunnelCreatorConfig cfg) Remove a config that was never actually sent to the network (e.g.static booleanBuildRequestor.request(RouterContext ctx, PooledTunnelCreatorConfig cfg, BuildExecutor exec, long firstHopTimeout) Initiates a tunnel build request.private voidTunnelPool.scheduleEarlyExpiry(PooledTunnelCreatorConfig cfg, long now, long staggerMs, boolean overBudget) Schedule an early expiry for a config; the caller records it in its removal list.static voidExpireJob.scheduleExpiration(RouterContext ctx, PooledTunnelCreatorConfig cfg) Schedule a tunnel for batched expiration.private voidTunnelPool.seedPairedTunnelIfUntested(PooledTunnelCreatorConfig cfg, PooledTunnelCreatorConfig paired) Seed an UNTESTED paired tunnel as GOOD on build success so the pool has at least one usable tunnel.private static TunnelInfoBuildRequestor.selectPairedTunnel(RouterContext ctx, TunnelPool pool, PooledTunnelCreatorConfig cfg, BuildExecutor exec, Log log) Selects an appropriate tunnel for sending the build reply.(package private) booleanBuildExecutor.shouldChargeGhostMark(PooledTunnelCreatorConfig cfg, Hash contacted) Whether an expired build's contacted hop should be charged a ghost mark.(package private) static booleanTestJob.shouldDropPending(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool) Whether a buffered candidate should be discarded instead of tested: its pool died, it was never fully built, it is a ping tunnel or was pruned for early expiry, its test already started (registered while buffered), or it is no longer UNTESTED (a prior dispatch tested or traffic-proven it while it waited).(package private) static booleanTestJob.shouldRejectAtOffer(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool) Whether an offer must be refused outright: no pool owns the tunnel, it was never fully built, it is a ping tunnel, it is already expired (only the drain-time early-expiry window is left toTestJob.shouldDropPending(RouterContext, PooledTunnelCreatorConfig, TunnelPool), since last-chance offers arrive inside it on purpose), its test already started, or it is no longer UNTESTED.static booleanTestJob.shouldSchedule(RouterContext ctx, PooledTunnelCreatorConfig cfg) Static method to check if a TestJob should be created and scheduled.private voidTunnelPool.updatePairedProfile(PooledTunnelCreatorConfig cfg, boolean success) Update the paired tunnel profiles by treating the build as a tunnel test.Constructors in net.i2p.router.tunnel.pool with parameters of type PooledTunnelCreatorConfigModifierConstructorDescriptionThe tunnel config, message, and receive time of a build end reply.(package private)PendingTest(PooledTunnelCreatorConfig cfg, TunnelPool pool) Capture the config's key and pool identity now, so the buffer can be de-duplicated and re-verified at drain time even if the config changes.TestJob(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool) TestJob.(package private)TestJob(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool, TestJob.InstanceClaims claims) TestJob for a caller that already holds the instance slots, such as the batch pump, which must claim before it constructs so a refused candidate can go back to the buffer instead of being dropped.(package private)Records a failed first hop reply.(package private)TunnelExpiration(PooledTunnelCreatorConfig cfg, Long key, long expire, long drop, long created) Tracks one tunnel for expiration.