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, unregister
getParentGrabArray, getSchedulerGroup, hashCode, knowsParentGrabArray, objectToString, persistent, realTimeFlag, setParentGrabArray
public SplitFileFetcherGet(SplitFileFetcher fetcher, SplitFileFetcherStorage storage)
public ClientKey getKey(SendableRequestItem token)
SendableGet
getKey
in class SendableGet
public Key[] listKeys()
SendableGet
listKeys
in class SendableGet
public FetchContext getContext()
SendableGet
getContext
in class SendableGet
public void onFailure(LowLevelGetException e, SendableRequestItem token, ClientContext context)
SendableGet
onFailure
in class SendableGet
public long getWakeupTime(ClientContext context, long now)
RequestSelectionTreeNode
getWakeupTime
in interface RequestSelectionTreeNode
getWakeupTime
in interface RandomGrabArrayItem
public long getCooldownWakeup(SendableRequestItem token, ClientContext context)
SendableGet
getCooldownWakeup
in class SendableGet
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 short getPriorityClass()
SendableRequest
getPriorityClass
in class SendableRequest
public SendableRequestItem chooseKey(KeysFetchingLocally keys, ClientContext context)
SendableRequest
chooseKey
in class SendableRequest
public long countAllKeys(ClientContext context)
SendableRequest
countAllKeys
in class SendableRequest
public long countSendableKeys(ClientContext context)
SendableRequest
countSendableKeys
in class SendableRequest
public boolean isCancelled()
SendableRequest
isCancelled
in interface HasKeyListener
isCancelled
in class SendableRequest
public RequestClient getClient()
SendableRequest
getClient
in class SendableRequest
public ClientRequester getClientRequest()
SendableRequest
getClientRequest
in class SendableRequest
public boolean isSSK()
SendableRequest
isSSK
in class SendableRequest
public 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)
HasKeyListener
makeKeyListener
in interface HasKeyListener
public void cancel(ClientContext context)
public boolean hasQueued()
protected ClientGetState getClientGetState()
getClientGetState
in class SendableGet