public abstract class SendableRequest extends java.lang.Object implements RandomGrabArrayItem, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected RandomGrabArray |
parentGrabArray |
protected boolean |
persistent
Member because must be accessible when only marginally activated
|
protected boolean |
realTimeFlag |
Modifier and Type | Method and Description |
---|---|
abstract SendableRequestItem |
chooseKey(KeysFetchingLocally keys,
ClientContext context)
Choose a key to fetch.
|
void |
clearWakeupTime(ClientContext context)
When a request becomes fetchable, set all the wakeup times above it to 0.
|
abstract long |
countAllKeys(ClientContext context)
All key identifiers.
|
abstract long |
countSendableKeys(ClientContext context)
All key identifiers currently eligible to be sent.
|
abstract RequestClient |
getClient()
Get client context object.
|
abstract ClientRequester |
getClientRequest()
Get the ClientRequest.
|
RandomGrabArray |
getParentGrabArray()
Return the parent RequestSelectionTreeNode or null if it's not in the tree or is the root (e.g.
|
abstract short |
getPriorityClass()
Get the priority class of the request.
|
abstract ClientRequestScheduler |
getScheduler(ClientContext context) |
ClientRequestSchedulerGroup |
getSchedulerGroup() |
abstract SendableRequestSender |
getSender(ClientContext context)
Get or create a SendableRequestSender for this object.
|
int |
hashCode() |
abstract void |
internalError(java.lang.Throwable t,
RequestScheduler sched,
ClientContext context,
boolean persistent)
Requeue after an internal error
|
abstract boolean |
isCancelled()
If true, the request has been cancelled, or has completed, either way it need not
be registered any more.
|
abstract boolean |
isInsert()
Is this an insert? For purposes of determining which scheduler to use.
|
abstract boolean |
isSSK()
Is this an SSK? For purposes of determining which scheduler to use.
|
boolean |
knowsParentGrabArray()
Does this RandomGrabArrayItem support remembering where it is registered?
|
protected java.lang.String |
objectToString() |
boolean |
persistent()
Is this request persistent? MUST NOT CHANGE.
|
boolean |
realTimeFlag() |
boolean |
reduceWakeupTime(long wakeupTime,
ClientContext context)
If the current cooldown time is larger than the parameter, reduce it and recurse up the
tree.
|
void |
setParentGrabArray(RandomGrabArray parent)
Notify the item that it has been registered on a specific RandomGrabArray
|
void |
unregister(ClientContext context,
short oldPrio)
Unregister the request.
|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getWakeupTime
protected final boolean realTimeFlag
protected transient RandomGrabArray parentGrabArray
protected final boolean persistent
public final int hashCode()
hashCode
in class java.lang.Object
public abstract short getPriorityClass()
public abstract SendableRequestItem chooseKey(KeysFetchingLocally keys, ClientContext context)
public abstract long countAllKeys(ClientContext context)
public abstract long countSendableKeys(ClientContext context)
public abstract SendableRequestSender getSender(ClientContext context)
context
- A client context may also be necessary.public abstract boolean isCancelled()
public abstract RequestClient getClient()
public final boolean persistent()
public abstract ClientRequester getClientRequest()
public RandomGrabArray getParentGrabArray()
RequestSelectionTreeNode
getParentGrabArray
in interface RequestSelectionTreeNode
getParentGrabArray
in interface RandomGrabArrayItem
public boolean knowsParentGrabArray()
RandomGrabArrayItem
knowsParentGrabArray
in interface RandomGrabArrayItem
public void setParentGrabArray(RandomGrabArray parent)
RandomGrabArrayItem
setParentGrabArray
in interface RandomGrabArrayItem
public void unregister(ClientContext context, short oldPrio)
context
- oldPrio
- If we are changing priorities it can matter what the old priority is.
However the parent method, SendableRequest, ignores this. In any case,
(short)-1 means not specified (look it up).public abstract ClientRequestScheduler getScheduler(ClientContext context)
public abstract boolean isSSK()
public abstract boolean isInsert()
public abstract void internalError(java.lang.Throwable t, RequestScheduler sched, ClientContext context, boolean persistent)
public boolean realTimeFlag()
protected final java.lang.String objectToString()
public boolean reduceWakeupTime(long wakeupTime, ClientContext context)
RequestSelectionTreeNode
reduceWakeupTime
in interface RequestSelectionTreeNode
public void clearWakeupTime(ClientContext context)
RequestSelectionTreeNode
clearWakeupTime
in interface RequestSelectionTreeNode
public ClientRequestSchedulerGroup getSchedulerGroup()