public class RequestTracker
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RequestTracker.CountedRequests |
class |
RequestTracker.WaitingForSlots |
Modifier and Type | Method and Description |
---|---|
void |
addRunningUIDs(java.util.List<java.lang.Long> list) |
void |
addTransferringSender(NodeCHK key,
RequestSender sender)
Add a transferring RequestSender to our HashMap.
|
void |
countAllRequestsByIncomingPeer(boolean requestsToNode,
boolean local,
boolean ssk,
boolean insert,
boolean offer,
boolean realTimeFlag,
int transfersPerInsert,
boolean ignoreLocalVsRemote,
java.util.Map<PeerNode,RequestTracker.CountedRequests> counterMap)
Count all requests, by the peer which originated the request.
|
void |
countRequests(boolean local,
boolean ssk,
boolean insert,
boolean offer,
boolean realTimeFlag,
int transfersPerInsert,
boolean ignoreLocalVsRemote,
RequestTracker.CountedRequests counter,
RequestTracker.CountedRequests counterSourceRestarted)
Count all requests running globally which match particular parameters.
|
void |
countRequests(PeerNode source,
boolean requestsToNode,
boolean local,
boolean ssk,
boolean insert,
boolean offer,
boolean realTimeFlag,
int transfersPerInsert,
boolean ignoreLocalVsRemote,
RequestTracker.CountedRequests counter,
RequestTracker.CountedRequests counterSR)
Count requests routed to a peer, or accepted from a peer, that match the specified criteria.
|
RequestTracker.WaitingForSlots |
countRequestsWaitingForSlots() |
int |
getNumCHKInserts() |
int |
getNumCHKOfferReplies() |
int |
getNumCHKOfferReplies(boolean realTimeFlag) |
int |
getNumCHKRequests() |
int |
getNumLocalCHKInserts() |
int |
getNumLocalCHKRequests() |
int |
getNumLocalSSKInserts() |
int |
getNumLocalSSKRequests() |
int |
getNumRemoteCHKInserts() |
int |
getNumRemoteCHKRequests() |
int |
getNumRemoteSSKInserts() |
int |
getNumRemoteSSKRequests() |
int |
getNumSSKInserts() |
int |
getNumSSKOfferReplies() |
int |
getNumSSKOfferReplies(boolean realTimeFlag) |
int |
getNumSSKRequests() |
int |
getNumTransferringRequestHandlers() |
int |
getNumTransferringRequestSenders() |
int |
getTotalRunningUIDsAlt() |
RequestSender |
getTransferringRequestSenderByKey(NodeCHK key,
boolean realTimeFlag) |
boolean |
lockUID(long uid,
boolean ssk,
boolean insert,
boolean offerReply,
boolean local,
boolean realTimeFlag,
UIDTag tag) |
boolean |
lockUID(UIDTag tag) |
void |
onRestartOrDisconnect(PeerNode pn) |
void |
removeTransferringSender(NodeCHK key,
RequestSender sender)
Remove a sender from the set of currently transferring senders.
|
protected void |
unlockUID(long uid,
boolean ssk,
boolean insert,
boolean canFail,
boolean offerReply,
boolean local,
boolean realTimeFlag,
UIDTag tag,
boolean noRecord) |
public boolean lockUID(UIDTag tag)
public boolean lockUID(long uid, boolean ssk, boolean insert, boolean offerReply, boolean local, boolean realTimeFlag, UIDTag tag)
protected void unlockUID(long uid, boolean ssk, boolean insert, boolean canFail, boolean offerReply, boolean local, boolean realTimeFlag, UIDTag tag, boolean noRecord)
public void countRequests(boolean local, boolean ssk, boolean insert, boolean offer, boolean realTimeFlag, int transfersPerInsert, boolean ignoreLocalVsRemote, RequestTracker.CountedRequests counter, RequestTracker.CountedRequests counterSourceRestarted)
local
- If true, only include requests which originated locally.ssk
- If true, count SSK requests, if false, count CHK requests.insert
- If true, count inserts, otherwise count requests.offer
- If true, count offer replies (takes precedence over insert).realTimeFlag
- If true, count real-time requests, if false, count bulk requests.transfersPerInsert
- Assume that any insert will cause this many outgoing transfers.
This is not predictable, so we use an average.ignoreLocalVsRemote
- If true, pretend that the request is remote even if it's local
(that is, count imaginary onward transfers etc depending on the request type).counter
- Transfer counts for all requests will be added to this counter object.counterSourceRestarted
- Transfer counts for requests whose source restarted (and so
are counted as local) will be added to this counter object.public void countRequests(PeerNode source, boolean requestsToNode, boolean local, boolean ssk, boolean insert, boolean offer, boolean realTimeFlag, int transfersPerInsert, boolean ignoreLocalVsRemote, RequestTracker.CountedRequests counter, RequestTracker.CountedRequests counterSR)
source
- The peer the requests were accepted from or routed to.requestsToNode
- If true, count requests sent to the node and currently
running. If false, count requests originated by the node.local
- If true, only include requests which originated locally.ssk
- If true, count SSK requests, if false, count CHK requests.insert
- If true, count inserts, otherwise count requests.offer
- If true, count offer replies (takes precedence over insert).realTimeFlag
- If true, count real-time requests, if false, count bulk requests.transfersPerInsert
- Assume that any insert will cause this many outgoing transfers.
This is not predictable, so we use an average.ignoreLocalVsRemote
- If true, pretend that the request is remote even if it's local
(that is, count imaginary onward transfers etc depending on the request type).counter
- Transfer counts for all requests will be added to this counter object.counterSR
- Transfer counts for requests whose source restarted (and so
are counted as local) will be added to this counter object.public void countAllRequestsByIncomingPeer(boolean requestsToNode, boolean local, boolean ssk, boolean insert, boolean offer, boolean realTimeFlag, int transfersPerInsert, boolean ignoreLocalVsRemote, java.util.Map<PeerNode,RequestTracker.CountedRequests> counterMap)
source
- The peer the requests were accepted from or routed to.local
- If true, only include requests which originated locally.ssk
- If true, count SSK requests, if false, count CHK requests.insert
- If true, count inserts, otherwise count requests.offer
- If true, count offer replies (takes precedence over insert).realTimeFlag
- If true, count real-time requests, if false, count bulk requests.transfersPerInsert
- Assume that any insert will cause this many outgoing transfers.
This is not predictable, so we use an average.ignoreLocalVsRemote
- If true, pretend that the request is remote even if it's local
(that is, count imaginary onward transfers etc depending on the request type).counterMap
- Map from PeerNode to CountedRequests counters. We will use "null" for
various cases: local requests, requested that have been adopted because their originator
restarted, requests where the originator PeerNode has been removed from the routing table
etc.public RequestTracker.WaitingForSlots countRequestsWaitingForSlots()
public void onRestartOrDisconnect(PeerNode pn)
public int getNumSSKRequests()
public int getNumCHKRequests()
public int getNumSSKInserts()
public int getNumCHKInserts()
public int getNumLocalSSKRequests()
public int getNumLocalCHKRequests()
public int getNumRemoteCHKRequests()
public int getNumRemoteSSKRequests()
public int getNumLocalCHKInserts()
public int getNumLocalSSKInserts()
public int getNumRemoteCHKInserts()
public int getNumRemoteSSKInserts()
public int getNumSSKOfferReplies()
public int getNumCHKOfferReplies()
public int getNumSSKOfferReplies(boolean realTimeFlag)
public int getNumCHKOfferReplies(boolean realTimeFlag)
public void addRunningUIDs(java.util.List<java.lang.Long> list)
public int getTotalRunningUIDsAlt()
public RequestSender getTransferringRequestSenderByKey(NodeCHK key, boolean realTimeFlag)
public void addTransferringSender(NodeCHK key, RequestSender sender)
public void removeTransferringSender(NodeCHK key, RequestSender sender)
public int getNumTransferringRequestSenders()
public int getNumTransferringRequestHandlers()