public class ClientRequestSelector extends java.lang.Object implements KeysFetchingLocally
Modifier and Type | Class and Description |
---|---|
class |
ClientRequestSelector.SelectorReturn |
Modifier and Type | Field and Description |
---|---|
protected freenet.client.async.ClientRequestSelector.RequestClientRGANode[] |
priorities
The base of the tree.
|
protected java.util.Deque<BaseSendableGet> |
recentSuccesses |
Modifier and Type | Method and Description |
---|---|
boolean |
addRunningInsert(SendableRequestItemKey token) |
boolean |
addToFetching(Key key) |
long |
checkRecentlyFailed(Key key,
boolean realTime)
If we are fairly sure we'd like to send this request, we need to route it
and determine whether it would be rejected with RecentlyFailed.
|
long |
countQueuedRequests(ClientContext context) |
boolean |
hasInsert(SendableRequestItemKey token)
Is this request:token pair being executed? FIXME this should be tracked by the inserter
itself.
|
boolean |
hasKey(Key key,
BaseSendableGet getterWaiting)
Is this key currently being fetched locally?
LOCKING: This should be safe just about anywhere, the lock protecting it is always taken last.
|
ChosenBlock |
maybeMakeChosenRequest(SendableRequest req,
ClientContext context,
long now) |
void |
removeFetchingKey(Key key)
LOCKING: Caller should hold as few locks as possible
|
void |
removeRunningInsert(SendableRequestItemKey token) |
void |
reregisterAll(ClientRequester request,
RequestScheduler lock,
ClientContext context,
short oldPrio) |
void |
succeeded(BaseSendableGet succeeded) |
void |
wakeUp(ClientContext context) |
protected freenet.client.async.ClientRequestSelector.RequestClientRGANode[] priorities
protected final java.util.Deque<BaseSendableGet> recentSuccesses
public ChosenBlock maybeMakeChosenRequest(SendableRequest req, ClientContext context, long now)
public boolean addToFetching(Key key)
public boolean hasKey(Key key, BaseSendableGet getterWaiting)
KeysFetchingLocally
hasKey
in interface KeysFetchingLocally
public void removeFetchingKey(Key key)
public boolean hasInsert(SendableRequestItemKey token)
KeysFetchingLocally
hasInsert
in interface KeysFetchingLocally
public boolean addRunningInsert(SendableRequestItemKey token)
public void removeRunningInsert(SendableRequestItemKey token)
public long checkRecentlyFailed(Key key, boolean realTime)
KeysFetchingLocally
checkRecentlyFailed
in interface KeysFetchingLocally
key
- The key to check.public void reregisterAll(ClientRequester request, RequestScheduler lock, ClientContext context, short oldPrio)
public long countQueuedRequests(ClientContext context)
public void succeeded(BaseSendableGet succeeded)
public void wakeUp(ClientContext context)