public abstract class SendableGet extends BaseSendableGet
Modifier and Type | Field and Description |
---|---|
ClientRequester |
parent
Parent BaseClientGetter.
|
parentGrabArray, persistent, realTimeFlag
Constructor and Description |
---|
SendableGet(ClientRequester parent,
boolean realTimeFlag) |
Modifier and Type | Method and Description |
---|---|
void |
clearWakeupTime(ClientContext context)
When a request becomes fetchable, set all the wakeup times above it to 0.
|
protected abstract ClientGetState |
getClientGetState() |
abstract FetchContext |
getContext()
Get the fetch context (settings) object.
|
abstract long |
getCooldownWakeup(SendableRequestItem token,
ClientContext context)
Get the time at which the key specified by the given token will wake up from the
cooldown queue.
|
abstract ClientKey |
getKey(SendableRequestItem token)
Get a numbered key to fetch.
|
Key |
getNodeKey(SendableRequestItem token)
Get a numbered key to fetch.
|
ClientRequestScheduler |
getScheduler(ClientContext context) |
SendableRequestSender |
getSender(ClientContext context)
Get or create a SendableRequestSender for this object.
|
void |
internalError(java.lang.Throwable t,
RequestScheduler sched,
ClientContext context,
boolean persistent)
An internal error occurred, effecting this SendableGet, independantly of any ChosenBlock's.
|
boolean |
isInsert()
Is this an insert? For purposes of determining which scheduler to use.
|
abstract Key[] |
listKeys()
What keys are we interested in? For purposes of checking the datastore.
|
abstract void |
onFailure(LowLevelGetException e,
SendableRequestItem token,
ClientContext context)
Called when/if the low-level request fails.
|
boolean |
reduceWakeupTime(long wakeupTime,
ClientContext context)
If the current cooldown time is larger than the parameter, reduce it and recurse up the
tree.
|
static FetchException |
translateException(LowLevelGetException e) |
void |
unregister(ClientContext context,
short oldPrio)
Unregister the request.
|
preRegister
chooseKey, countAllKeys, countSendableKeys, getClient, getClientRequest, getParentGrabArray, getPriorityClass, getSchedulerGroup, hashCode, isCancelled, isSSK, knowsParentGrabArray, objectToString, persistent, realTimeFlag, setParentGrabArray
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getWakeupTime
public final ClientRequester parent
public SendableGet(ClientRequester parent, boolean realTimeFlag)
public abstract ClientKey getKey(SendableRequestItem token)
public Key getNodeKey(SendableRequestItem token)
BaseSendableGet
getNodeKey
in class BaseSendableGet
public abstract Key[] listKeys()
public abstract FetchContext getContext()
public abstract void onFailure(LowLevelGetException e, SendableRequestItem token, ClientContext context)
public SendableRequestSender getSender(ClientContext context)
SendableRequest
getSender
in class SendableRequest
context
- A client context may also be necessary.public ClientRequestScheduler getScheduler(ClientContext context)
getScheduler
in class SendableRequest
public abstract long getCooldownWakeup(SendableRequestItem token, ClientContext context)
token
- public void internalError(java.lang.Throwable t, RequestScheduler sched, ClientContext context, boolean persistent)
internalError
in class SendableRequest
public final boolean isInsert()
SendableRequest
isInsert
in class SendableRequest
public void unregister(ClientContext context, short oldPrio)
SendableRequest
unregister
in class SendableRequest
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 static FetchException translateException(LowLevelGetException e)
public boolean reduceWakeupTime(long wakeupTime, ClientContext context)
RequestSelectionTreeNode
reduceWakeupTime
in interface RequestSelectionTreeNode
reduceWakeupTime
in class SendableRequest
public void clearWakeupTime(ClientContext context)
RequestSelectionTreeNode
clearWakeupTime
in interface RequestSelectionTreeNode
clearWakeupTime
in class SendableRequest
protected abstract ClientGetState getClientGetState()