public class SplitFileFetcherGet extends SendableGet implements HasKeyListener
parentGrabArray, persistent, realTimeFlag| Constructor and Description |
|---|
SplitFileFetcherGet(SplitFileFetcher fetcher,
SplitFileFetcherStorage storage) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(ClientContext context) |
SendableRequestItem |
chooseKey(KeysFetchingLocally keys,
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.
|
protected ClientGetState |
getClientGetState() |
ClientRequester |
getClientRequest()
Get the ClientRequest.
|
FetchContext |
getContext()
Get the fetch context (settings) object.
|
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.
|
ClientKey |
getKey(SendableRequestItem token)
Get a numbered key to fetch.
|
short |
getPriorityClass()
Get the priority class of the request.
|
long |
getWakeupTime(ClientContext context,
long now)
Unless this is a RandomGrabArrayItem, this will return the wakeup time for the subtree
rooted at this node.
|
boolean |
hasQueued()
Has preRegister() been called?
|
boolean |
isCancelled()
If true, the request has been cancelled, or has completed, either way it need not
be registered any more.
|
boolean |
isSSK()
Is this an SSK? For purposes of determining which scheduler to use.
|
Key[] |
listKeys()
What keys are we interested in? For purposes of checking the datastore.
|
KeyListener |
makeKeyListener(ClientContext context,
boolean onStartup)
Create a KeyListener, a transient object used to determine which keys we
want, and to handle any blocks found.
|
void |
onFailure(LowLevelGetException e,
SendableRequestItem token,
ClientContext context)
Called when/if the low-level request fails.
|
boolean |
preRegister(ClientContext context,
boolean toNetwork)
Called after checking the datastore and before registering the request to be
sent.
|
void |
schedule(ClientContext context,
boolean ignoreStore)
Schedule the fetch.
|
clearWakeupTime, getNodeKey, getScheduler, getSender, internalError, isInsert, reduceWakeupTime, translateException, unregistergetParentGrabArray, getSchedulerGroup, hashCode, knowsParentGrabArray, objectToString, persistent, realTimeFlag, setParentGrabArraypublic SplitFileFetcherGet(SplitFileFetcher fetcher, SplitFileFetcherStorage storage)
public ClientKey getKey(SendableRequestItem token)
SendableGetgetKey in class SendableGetpublic Key[] listKeys()
SendableGetlistKeys in class SendableGetpublic FetchContext getContext()
SendableGetgetContext in class SendableGetpublic void onFailure(LowLevelGetException e, SendableRequestItem token, ClientContext context)
SendableGetonFailure in class SendableGetpublic long getWakeupTime(ClientContext context, long now)
RequestSelectionTreeNodegetWakeupTime in interface RequestSelectionTreeNodegetWakeupTime in interface RandomGrabArrayItempublic long getCooldownWakeup(SendableRequestItem token, ClientContext context)
SendableGetgetCooldownWakeup in class SendableGetpublic boolean preRegister(ClientContext context, boolean toNetwork)
BaseSendableGetpreRegister in class BaseSendableGettoNetwork - If true, we are actually going to send requests (unless we
cancel in this callback). If false, we completed all the work assigned.public short getPriorityClass()
SendableRequestgetPriorityClass in class SendableRequestpublic SendableRequestItem chooseKey(KeysFetchingLocally keys, ClientContext context)
SendableRequestchooseKey in class SendableRequestpublic long countAllKeys(ClientContext context)
SendableRequestcountAllKeys in class SendableRequestpublic long countSendableKeys(ClientContext context)
SendableRequestcountSendableKeys in class SendableRequestpublic boolean isCancelled()
SendableRequestisCancelled in interface HasKeyListenerisCancelled in class SendableRequestpublic RequestClient getClient()
SendableRequestgetClient in class SendableRequestpublic ClientRequester getClientRequest()
SendableRequestgetClientRequest in class SendableRequestpublic boolean isSSK()
SendableRequestisSSK in class SendableRequestpublic void schedule(ClientContext context, boolean ignoreStore)
context - ignoreStore - If true, don't check the datastore before re-registering the requests to
run. Should be true when rescheduling after a normal cooldown, false after recovering from
data corruption (the blocks may still be in the store), false otherwise.public KeyListener makeKeyListener(ClientContext context, boolean onStartup)
HasKeyListenermakeKeyListener in interface HasKeyListenerpublic void cancel(ClientContext context)
public boolean hasQueued()
protected ClientGetState getClientGetState()
getClientGetState in class SendableGet