public class OutboundCache extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
OutboundCache.HashPair
Key used to cache things with based on source + dest
|
| Modifier and Type | Field and Description |
|---|---|
(package private) Map<OutboundCache.HashPair,TunnelInfo> |
backloggedTunnelCache |
(package private) Map<OutboundCache.HashPair,Long> |
lastReplyRequestCache
This cache is used to ensure that we request a reply every so often.
|
(package private) ConcurrentHashMap<OutboundCache.HashPair,net.i2p.data.Lease> |
leaseCache
Use the same inbound tunnel (i.e.
|
(package private) ConcurrentHashMap<OutboundCache.HashPair,net.i2p.data.LeaseSet> |
leaseSetCache
Returns the reply lease set if forced to do so,
or if configured to do so,
or if a certain percentage of the time if configured to do so,
or if our lease set has changed since we last talked to them,
or 10% of the time anyway so they don't forget us (disabled for now),
or null otherwise.
|
(package private) Map<OutboundCache.HashPair,TunnelInfo> |
tunnelCache
Use the same outbound tunnel as we did for the same destination previously,
if possible, to keep the streaming lib happy
Use two caches - although a cache of a list of tunnels per dest might be
more elegant.
|
| Constructor and Description |
|---|
OutboundCache(RouterContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAllCaches() |
(package private) void |
clearCaches(OutboundCache.HashPair hashPair,
net.i2p.data.Lease lease,
TunnelInfo inTunnel,
TunnelInfo outTunnel)
Called on failure to give us a better chance of success next time.
|
final Map<OutboundCache.HashPair,TunnelInfo> tunnelCache
final Map<OutboundCache.HashPair,TunnelInfo> backloggedTunnelCache
final ConcurrentHashMap<OutboundCache.HashPair,net.i2p.data.LeaseSet> leaseSetCache
final ConcurrentHashMap<OutboundCache.HashPair,net.i2p.data.Lease> leaseCache
final Map<OutboundCache.HashPair,Long> lastReplyRequestCache
public OutboundCache(RouterContext ctx)
void clearCaches(OutboundCache.HashPair hashPair, net.i2p.data.Lease lease, TunnelInfo inTunnel, TunnelInfo outTunnel)
lease - may be nullinTunnel - may be nulloutTunnel - may be nullpublic void clearAllCaches()