public class OfferedKeysList extends BaseSendableGet implements RequestClient
parentGrabArray, persistent, realTimeFlag
Modifier and Type | Method and Description |
---|---|
SendableRequestItem |
chooseKey(KeysFetchingLocally fetching,
ClientContext context)
Choose a key to fetch.
|
long |
countAllKeys(ClientContext context)
All key identifiers.
|
long |
countSendableKeys(ClientContext context)
All key identifiers currently eligible to be sent.
|
RequestClient |
getClient()
Get client context object.
|
ClientRequester |
getClientRequest()
Get the ClientRequest.
|
Key |
getNodeKey(SendableRequestItem token)
Get a numbered key to fetch.
|
short |
getPriorityClass()
Get the priority class of the request.
|
ClientRequestScheduler |
getScheduler(ClientContext context) |
SendableRequestSender |
getSender(ClientContext context)
Get or create a SendableRequestSender for this object.
|
long |
getWakeupTime(ClientContext context,
long now)
Unless this is a RandomGrabArrayItem, this will return the wakeup time for the subtree
rooted at this node.
|
void |
internalError(java.lang.Throwable t,
RequestScheduler sched,
ClientContext context,
boolean persistent)
Requeue after an internal error
|
boolean |
isCancelled()
If true, the request has been cancelled, or has completed, either way it need not
be registered any more.
|
boolean |
isEmpty() |
boolean |
isInsert()
Is this an insert? For purposes of determining which scheduler to use.
|
boolean |
isSSK()
Is this an SSK? For purposes of determining which scheduler to use.
|
boolean |
preRegister(ClientContext context,
boolean toNetwork)
Called after checking the datastore and before registering the request to be
sent.
|
void |
queueKey(Key key) |
void |
remove(Key key)
Called when a key is found, when it no longer belongs to this list etc.
|
clearWakeupTime, getParentGrabArray, getSchedulerGroup, hashCode, knowsParentGrabArray, objectToString, persistent, realTimeFlag, reduceWakeupTime, setParentGrabArray, unregister
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
persistent, realTimeFlag
public void remove(Key key)
public boolean isEmpty()
public long countAllKeys(ClientContext context)
SendableRequest
countAllKeys
in class SendableRequest
public long countSendableKeys(ClientContext context)
SendableRequest
countSendableKeys
in class SendableRequest
public SendableRequestItem chooseKey(KeysFetchingLocally fetching, ClientContext context)
SendableRequest
chooseKey
in class SendableRequest
public RequestClient getClient()
SendableRequest
getClient
in class SendableRequest
public ClientRequester getClientRequest()
SendableRequest
getClientRequest
in class SendableRequest
public short getPriorityClass()
SendableRequest
getPriorityClass
in class SendableRequest
public void internalError(java.lang.Throwable t, RequestScheduler sched, ClientContext context, boolean persistent)
SendableRequest
internalError
in class SendableRequest
public SendableRequestSender getSender(ClientContext context)
SendableRequest
getSender
in class SendableRequest
context
- A client context may also be necessary.public boolean isCancelled()
SendableRequest
isCancelled
in class SendableRequest
public void queueKey(Key key)
public Key getNodeKey(SendableRequestItem token)
BaseSendableGet
getNodeKey
in class BaseSendableGet
public boolean isSSK()
SendableRequest
isSSK
in class SendableRequest
public boolean isInsert()
SendableRequest
isInsert
in class SendableRequest
public ClientRequestScheduler getScheduler(ClientContext context)
getScheduler
in class SendableRequest
public boolean preRegister(ClientContext context, boolean toNetwork)
BaseSendableGet
preRegister
in class BaseSendableGet
toNetwork
- If true, we are actually going to send requests (unless we
cancel in this callback). If false, we completed all the work assigned.public long getWakeupTime(ClientContext context, long now)
RequestSelectionTreeNode
getWakeupTime
in interface RequestSelectionTreeNode
getWakeupTime
in interface RandomGrabArrayItem