public abstract class AbstractPendingSetSubtask<HS extends AbstractSubtaskStats,M extends AbstractPendingSetMasterTask<? extends AbstractPendingSetMasterStats<L,HS>,E,? extends AbstractPendingSetSubtask,L>,E,L> extends AbstractSubtask<HS,M,E,L>
IAsynchronousClientTask
, to track the set of outstanding
asynchronous operations for a specific client task (the "pending set"), and
to close the client task when the sink not assign any more work to that
client.Modifier and Type | Field and Description |
---|---|
protected IAsynchronousClientTask<?,E> |
clientTask |
buffer, lastChunkAvailableNanos, lastChunkNanos, locator, log, master, src, stats
Constructor and Description |
---|
AbstractPendingSetSubtask(M master,
L locator,
IAsynchronousClientTask<?,E> clientTask,
BlockingBuffer<E[]> buffer) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addPending(E e) |
protected void |
awaitPending()
Wait until any asynchronous processing for the subtask is done.
|
protected void |
cancelRemoteTask(boolean mayInterruptIfRunning)
Cancel the remote task.
|
protected abstract Set<E> |
getPendingSet()
Return the pending set.
|
int |
getPendingSetSize() |
protected boolean |
handleChunk(E[] chunk)
Submits the chunk of resources for processing by the remote client task.
|
protected void |
notifyClientOfRedirect(L locator,
Throwable cause)
Notify the client that the locator is stale.
|
protected boolean |
removePending(E e) |
call, handleRedirect, toString
protected final IAsynchronousClientTask<?,E> clientTask
public AbstractPendingSetSubtask(M master, L locator, IAsynchronousClientTask<?,E> clientTask, BlockingBuffer<E[]> buffer)
clientTask
- The proxy for the remote client task.public int getPendingSetSize()
protected final void cancelRemoteTask(boolean mayInterruptIfRunning) throws InterruptedException
AbstractSubtask
cancelRemoteTask
in class AbstractSubtask<HS extends AbstractSubtaskStats,M extends AbstractPendingSetMasterTask<? extends AbstractPendingSetMasterStats<L,HS>,E,? extends AbstractPendingSetSubtask,L>,E,L>
InterruptedException
protected final void awaitPending() throws InterruptedException
AbstractSubtask
awaitPending
in class AbstractSubtask<HS extends AbstractSubtaskStats,M extends AbstractPendingSetMasterTask<? extends AbstractPendingSetMasterStats<L,HS>,E,? extends AbstractPendingSetSubtask,L>,E,L>
InterruptedException
protected final boolean addPending(E e)
protected final boolean removePending(E e)
protected boolean handleChunk(E[] chunk) throws ExecutionException, InterruptedException, IOException
handleChunk
in class AbstractSubtask<HS extends AbstractSubtaskStats,M extends AbstractPendingSetMasterTask<? extends AbstractPendingSetMasterStats<L,HS>,E,? extends AbstractPendingSetSubtask,L>,E,L>
chunk
- A chunk of resources to be processed.true
iff the client will not accept additional
chunks.IOException
- RMI error.ExecutionException
InterruptedException
protected void notifyClientOfRedirect(L locator, Throwable cause)
AbstractSubtask
notifyClientOfRedirect
in class AbstractSubtask<HS extends AbstractSubtaskStats,M extends AbstractPendingSetMasterTask<? extends AbstractPendingSetMasterStats<L,HS>,E,? extends AbstractPendingSetSubtask,L>,E,L>
locator
- The locator.cause
- The cause.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.