Package net.i2p.router
Class RouterThrottleImpl
java.lang.Object
net.i2p.router.RouterThrottleImpl
- All Implemented Interfaces:
RouterThrottle
- Direct Known Subclasses:
RouterDoSThrottle
public class RouterThrottleImpl extends Object implements RouterThrottle
Simple throttle that basically stops accepting messages or nontrivial
requests if the jobQueue lag is too large.
-
Field Summary
Fields Modifier and Type Field Description protected RouterContext
_context
static int
DEFAULT_MAX_TUNNELS
static String
PROP_MAX_TUNNELS
static int
TUNNEL_ACCEPT
tunnel acceptance -
Constructor Summary
Constructors Constructor Description RouterThrottleImpl(RouterContext context)
-
Method Summary
Modifier and Type Method Description boolean
acceptNetDbLookupRequest(Hash key)
Deprecated.unused, function moved to netdbboolean
acceptNetworkMessage()
Should we accept any more data from the network for any sort of message, taking into account our current load, or should we simply slow down? FIXME only called by SSU Receiver, not NTCP! FIXME should put warning on the console FIXME or should we do this at all? We have Codel queues all over now...int
acceptTunnelRequest()
If we should send a reject, return a nonzero reject code.void
cancelShutdownStatus()
double
getInboundRateDelta()
How much faster (or if negative, slower) we are receiving data as opposed to our longer term averages?String
getLocalizedTunnelStatus()
getTunnelStatus(), translated if available.long
getMessageDelay()
How backed up we are at the moment processing messages (in milliseconds)long
getTunnelLag()
How backed up our tunnels are at the moment (in milliseconds)String
getTunnelStatus()
Message on the state of participating tunnel acceptancevoid
setShutdownStatus()
void
setTunnelStatus(String msg)
-
Field Details
-
_context
-
PROP_MAX_TUNNELS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_TUNNELS
public static final int DEFAULT_MAX_TUNNELS -
TUNNEL_ACCEPT
public static final int TUNNEL_ACCEPTtunnel acceptance- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
acceptNetworkMessage
public boolean acceptNetworkMessage()Should we accept any more data from the network for any sort of message, taking into account our current load, or should we simply slow down? FIXME only called by SSU Receiver, not NTCP! FIXME should put warning on the console FIXME or should we do this at all? We have Codel queues all over now...- Specified by:
acceptNetworkMessage
in interfaceRouterThrottle
-
acceptNetDbLookupRequest
Deprecated.unused, function moved to netdbDescription copied from interface:RouterThrottle
Should we accept the netDb lookup message, replying either with the value or some closer peers, or should we simply drop it due to overload?- Specified by:
acceptNetDbLookupRequest
in interfaceRouterThrottle
-
acceptTunnelRequest
public int acceptTunnelRequest()If we should send a reject, return a nonzero reject code. Anything that causes us to drop a request instead of rejecting it must go in BuildHandler.handleInboundRequest(), not here.- Specified by:
acceptTunnelRequest
in interfaceRouterThrottle
- Returns:
- 0 for accept or nonzero reject code
-
getMessageDelay
public long getMessageDelay()Description copied from interface:RouterThrottle
How backed up we are at the moment processing messages (in milliseconds)- Specified by:
getMessageDelay
in interfaceRouterThrottle
-
getTunnelLag
public long getTunnelLag()Description copied from interface:RouterThrottle
How backed up our tunnels are at the moment (in milliseconds)- Specified by:
getTunnelLag
in interfaceRouterThrottle
-
getInboundRateDelta
public double getInboundRateDelta()Description copied from interface:RouterThrottle
How much faster (or if negative, slower) we are receiving data as opposed to our longer term averages?- Specified by:
getInboundRateDelta
in interfaceRouterThrottle
-
getTunnelStatus
Description copied from interface:RouterThrottle
Message on the state of participating tunnel acceptance- Specified by:
getTunnelStatus
in interfaceRouterThrottle
-
getLocalizedTunnelStatus
getTunnelStatus(), translated if available.- Specified by:
getLocalizedTunnelStatus
in interfaceRouterThrottle
- Since:
- 0.9.45
-
setShutdownStatus
public void setShutdownStatus()- Specified by:
setShutdownStatus
in interfaceRouterThrottle
- Since:
- 0.8.12
-
cancelShutdownStatus
public void cancelShutdownStatus()- Specified by:
cancelShutdownStatus
in interfaceRouterThrottle
- Since:
- 0.8.12
-
setTunnelStatus
- Specified by:
setTunnelStatus
in interfaceRouterThrottle
-