|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.message.OutboundCache
public class OutboundCache
Helper for OCMOSJ This is the place where we make I2P go fast. We have five static caches. - The LeaseSet cache is used to decide whether to bundle our own leaseset, which minimizes overhead. - The Lease cache is used to persistently send to the same lease for the destination, which keeps the streaming lib happy by minimizing out-of-order delivery. - The Tunnel and BackloggedTunnel caches are used to persistently use the same outbound tunnel for the same destination, which keeps the streaming lib happy by minimizing out-of-order delivery. - The last reply requested cache ensures that a reply is requested every so often, so that failed tunnels are recognized.
Nested Class Summary | |
---|---|
(package private) static class |
OutboundCache.HashPair
Key used to cache things with based on source + dest |
Field Summary | |
---|---|
(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,Lease> |
leaseCache
Use the same inbound tunnel (i.e. |
(package private) Map<OutboundCache.HashPair,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 Summary | |
---|---|
OutboundCache(RouterContext ctx)
|
Method Summary | |
---|---|
void |
clearAllCaches()
|
(package private) void |
clearCaches(OutboundCache.HashPair hashPair,
Lease lease,
TunnelInfo inTunnel,
TunnelInfo outTunnel)
Called on failure to give us a better chance of success next time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final Map<OutboundCache.HashPair,TunnelInfo> tunnelCache
final Map<OutboundCache.HashPair,TunnelInfo> backloggedTunnelCache
final Map<OutboundCache.HashPair,LeaseSet> leaseSetCache
final ConcurrentHashMap<OutboundCache.HashPair,Lease> leaseCache
final Map<OutboundCache.HashPair,Long> lastReplyRequestCache
Constructor Detail |
---|
public OutboundCache(RouterContext ctx)
Method Detail |
---|
void clearCaches(OutboundCache.HashPair hashPair, Lease lease, TunnelInfo inTunnel, TunnelInfo outTunnel)
lease
- may be nullinTunnel
- may be nulloutTunnel
- may be nullpublic void clearAllCaches()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |