I
- type of input values consumed by the workerO
- type of output values produced by the workerC
- type of context required by the workerpublic abstract class WorkerShardTask<I,O,C extends WorkerContext<O>> extends Object implements IncrementalTaskWithContext
Modifier and Type | Field and Description |
---|---|
protected Long |
claimedMemory |
protected static MemoryLimiter |
LIMITER |
Modifier | Constructor and Description |
---|---|
protected |
WorkerShardTask(IncrementalTaskContext context) |
Modifier and Type | Method and Description |
---|---|
protected static String |
abbrev(Object x) |
protected abstract void |
callWorker(I input) |
void |
cleanup()
Clean up and release any resources claimed in prepare.
|
protected abstract long |
estimateMemoryRequirement() |
protected abstract String |
formatLastWorkItem(I item) |
IncrementalTaskContext |
getContext() |
protected abstract InputReader<I> |
getInputReader() |
abstract OutputWriter<O> |
getOutputWriter() |
protected abstract Worker<C> |
getWorker() |
boolean |
isDone() |
void |
prepare()
Called immediately before run.
|
void |
run()
Runs this task.
|
protected void |
setFinalized() |
protected abstract boolean |
shouldCheckpoint(long timeElapsed) |
String |
toString() |
protected boolean |
wasFinalized() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
allowSliceRetry, jobCompleted
protected static final MemoryLimiter LIMITER
protected transient Long claimedMemory
protected WorkerShardTask(IncrementalTaskContext context)
public final IncrementalTaskContext getContext()
getContext
in interface IncrementalTaskWithContext
public void cleanup()
IncrementalTask
cleanup
in interface IncrementalTask
public void prepare()
IncrementalTask
prepare
in interface IncrementalTask
public void run()
IncrementalTask
run
in interface IncrementalTask
public boolean isDone()
isDone
in interface IncrementalTask
protected final void setFinalized()
protected final boolean wasFinalized()
protected abstract boolean shouldCheckpoint(long timeElapsed)
protected abstract long estimateMemoryRequirement()
protected abstract InputReader<I> getInputReader()
protected abstract void callWorker(I input)
public abstract OutputWriter<O> getOutputWriter()
Copyright © 2015 Google. All rights reserved.