public abstract class BaseSender extends java.lang.Object implements ByteCounter
Modifier and Type | Class and Description |
---|---|
protected static class |
BaseSender.DO |
Modifier and Type | Field and Description |
---|---|
protected boolean |
dontDecrementHTLThisTime
If this is set, don't decrement HTL, and then unset it.
|
protected int |
gotMessages |
protected boolean |
hasForwarded |
protected short |
htl |
protected java.lang.String |
lastMessage |
protected PeerNode |
lastNode |
protected java.util.HashSet<PeerNode> |
nodesRoutedTo |
protected short |
origHTL |
protected int |
rejectOverloads |
protected int |
routeAttempts |
protected long |
startTime |
Modifier and Type | Method and Description |
---|---|
static int |
calculateTimeout(boolean realTimeFlag,
short htl,
Node node) |
protected int |
calculateTimeout(short htl) |
protected abstract Message |
createDataRequest() |
protected abstract void |
forwardRejectedOverload() |
protected abstract long |
getAcceptedTimeout() |
protected long |
getLongSlotWaiterTimeout() |
protected long |
getShortSlotWaiterTimeout() |
protected abstract void |
handleAcceptedRejectedTimeout(PeerNode next,
UIDTag origTag) |
protected short |
hopsForFatalTimeoutWaitingForPeer() |
protected long |
ignoreLowBackoff() |
protected void |
innerRouteRequests(PeerNode next,
UIDTag origTag) |
protected void |
innerRouteRequestsNew(PeerNode next,
UIDTag origTag)
New load management.
|
protected void |
innerRouteRequestsOld(PeerNode next,
UIDTag origTag) |
protected boolean |
isAccepted(Message msg) |
protected abstract boolean |
isInsert() |
protected abstract MessageFilter |
makeAcceptedRejectedFilter(PeerNode next,
long acceptedTimeout,
UIDTag tag)
Construct a filter to wait the specified time for accepted or rejected.
|
protected abstract void |
onAccepted(PeerNode next) |
PeerNode |
routedLast() |
protected abstract void |
routeRequests()
The main route requests loop.
|
protected PeerNode |
sourceForRouting() |
protected abstract void |
timedOutWhileWaiting(double load)
We timed out while waiting for a slot from any node.
|
protected int |
timeSinceSent() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
receivedBytes, sentBytes, sentPayload
protected final short origHTL
protected final long startTime
protected PeerNode lastNode
protected java.util.HashSet<PeerNode> nodesRoutedTo
protected boolean hasForwarded
protected int gotMessages
protected java.lang.String lastMessage
protected short htl
protected int rejectOverloads
protected int routeAttempts
protected boolean dontDecrementHTLThisTime
public static int calculateTimeout(boolean realTimeFlag, short htl, Node node)
protected int calculateTimeout(short htl)
protected abstract Message createDataRequest()
public PeerNode routedLast()
protected int timeSinceSent()
protected abstract void routeRequests()
protected void innerRouteRequestsNew(PeerNode next, UIDTag origTag)
next
- The peer that we have routed to. We won't necessarily route
to this one in all cases.protected PeerNode sourceForRouting()
protected long getLongSlotWaiterTimeout()
protected long getShortSlotWaiterTimeout()
protected short hopsForFatalTimeoutWaitingForPeer()
protected abstract void handleAcceptedRejectedTimeout(PeerNode next, UIDTag origTag)
protected boolean isAccepted(Message msg)
protected abstract long getAcceptedTimeout()
protected abstract void timedOutWhileWaiting(double load)
load
- The proportion of requests getting timed out, on average,
across the nodes we are waiting for. This is used to decide how long the
RecentlyFailed should be for.protected abstract void onAccepted(PeerNode next)
protected abstract MessageFilter makeAcceptedRejectedFilter(PeerNode next, long acceptedTimeout, UIDTag tag)
next
- The peer we are waiting for a response from.acceptedTimeout
- The time to wait.tag
- Use the UID from this tag. Some requests may change the tag
after some hops, and if e.g. waiting for confirmation after a timeout,
we need to use the old tag.protected abstract void forwardRejectedOverload()
protected abstract boolean isInsert()
protected long ignoreLowBackoff()