public final class CHKInsertSender extends BaseSender implements PrioRunnable, AnyInsertSender, ByteCounter
BaseSender.DOdontDecrementHTLThisTime, gotMessages, hasForwarded, htl, lastMessage, lastNode, nodesRoutedTo, origHTL, rejectOverloads, routeAttempts| Modifier and Type | Method and Description |
|---|---|
boolean |
anyTransfersFailed() |
boolean |
completed() |
protected Message |
createDataRequest() |
boolean |
failedReceive() |
boolean |
failIfReceiveFailed(InsertTag tag,
PeerNode next) |
protected void |
forwardRejectedOverload()
Forward RejectedOverload to the request originator.
|
protected long |
getAcceptedTimeout() |
byte[] |
getHeaders() |
short |
getHTL() |
int |
getPriority() |
byte[] |
getPubkeyHash() |
PeerNode[] |
getRoutedTo() |
int |
getStatus() |
java.lang.String |
getStatusString() |
int |
getTotalReceivedBytes() |
int |
getTotalSentBytes() |
long |
getUID() |
protected void |
handleAcceptedRejectedTimeout(PeerNode next,
UIDTag tag) |
protected long |
ignoreLowBackoff() |
protected boolean |
isInsert() |
protected MessageFilter |
makeAcceptedRejectedFilter(PeerNode next,
long acceptedTimeout,
UIDTag tag)
Construct a filter to wait the specified time for accepted or rejected.
|
protected void |
onAccepted(PeerNode next) |
void |
onReceiveFailed()
Called by CHKInsertHandler to notify that the receive has
failed.
|
void |
receivedBytes(int x) |
protected void |
routeRequests()
The main route requests loop.
|
void |
run() |
void |
sentBytes(int x)
Sent some bytes.
|
void |
sentPayload(int x)
Sent payload - only include the number of bytes of actual payload i.e.
|
boolean |
sentRequest() |
protected PeerNode |
sourceForRouting() |
boolean |
startedSendingData() |
protected void |
timedOutWhileWaiting(double load)
We timed out while waiting for a slot from any node.
|
java.lang.String |
toString() |
void |
waitForStatus()
Block until status has been set to something other than NOT_FINISHED
|
calculateTimeout, calculateTimeout, getLongSlotWaiterTimeout, getShortSlotWaiterTimeout, hopsForFatalTimeoutWaitingForPeer, innerRouteRequests, innerRouteRequestsNew, innerRouteRequestsOld, isAccepted, routedLast, timeSinceSentpublic java.lang.String toString()
toString in class java.lang.Objectpublic void run()
run in interface java.lang.Runnableprotected void routeRequests()
BaseSenderrouteRequests in class BaseSenderprotected MessageFilter makeAcceptedRejectedFilter(PeerNode next, long acceptedTimeout, UIDTag tag)
BaseSendermakeAcceptedRejectedFilter in class BaseSendernext - 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 void handleAcceptedRejectedTimeout(PeerNode next, UIDTag tag)
handleAcceptedRejectedTimeout in class BaseSenderprotected void forwardRejectedOverload()
forwardRejectedOverload in class BaseSenderpublic int getStatus()
getStatus in interface AnyInsertSenderpublic short getHTL()
getHTL in interface AnyInsertSenderpublic void onReceiveFailed()
public java.lang.String getStatusString()
getStatusString in interface AnyInsertSenderpublic boolean sentRequest()
sentRequest in interface AnyInsertSenderpublic boolean completed()
public void waitForStatus()
public boolean anyTransfersFailed()
public byte[] getPubkeyHash()
public byte[] getHeaders()
public long getUID()
getUID in interface AnyInsertSenderpublic void sentBytes(int x)
ByteCountersentBytes in interface ByteCounterpublic int getTotalSentBytes()
public void receivedBytes(int x)
receivedBytes in interface ByteCounterpublic int getTotalReceivedBytes()
public void sentPayload(int x)
ByteCountersentPayload in interface ByteCounterx - Number of bytes sentpublic boolean failedReceive()
public boolean startedSendingData()
public int getPriority()
getPriority in interface PrioRunnablepublic PeerNode[] getRoutedTo()
protected Message createDataRequest()
createDataRequest in class BaseSenderprotected long getAcceptedTimeout()
getAcceptedTimeout in class BaseSenderprotected void timedOutWhileWaiting(double load)
BaseSendertimedOutWhileWaiting in class BaseSenderload - 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 void onAccepted(PeerNode next)
onAccepted in class BaseSenderprotected boolean isInsert()
isInsert in class BaseSenderprotected PeerNode sourceForRouting()
sourceForRouting in class BaseSenderprotected long ignoreLowBackoff()
ignoreLowBackoff in class BaseSender