public abstract static class H2O.H2OCountedCompleter<T extends H2O.H2OCountedCompleter> extends CountedCompleter implements java.lang.Cloneable, Freezable<T>
CountedCompleter
to support priority
queues. F/J queues are simple unordered (and extremely light weight)
queues. However, we frequently need priorities to avoid deadlock and to
promote efficient throughput (e.g. failure to respond quickly to TaskGetKey
can block an entire node for lack of some small piece of
data). So each attempt to do lower-priority F/J work starts with an
attempt to work and drain the higher-priority queues.Modifier | Constructor and Description |
---|---|
|
H2OCountedCompleter() |
protected |
H2OCountedCompleter(byte prior) |
protected |
H2OCountedCompleter(H2O.H2OCountedCompleter completer) |
protected |
H2OCountedCompleter(H2O.H2OCountedCompleter completer,
byte prior) |
Modifier and Type | Method and Description |
---|---|
byte[] |
asBytes()
Return serialized version of self as a byte array.
|
T |
clone()
Make clone public, but without the annoying exception.
|
void |
compute()
Used by the F/J framework internally to do work.
|
void |
compute1() |
void |
compute2()
Override compute3() with actual work without having to worry about tryComplete()
|
protected static byte |
currThrPriority()
If this is a F/J thread, return it's priority - used to lift the
priority of a blocking remote call, so the remote node runs it at a
higher priority - so we don't deadlock when we burn the local
thread.
|
int |
frozenType()
Returns a small dense integer, which is cluster-wide unique per-class.
|
protected Icer<T> |
icer()
Find the serialization delegate for a subclass of this class
|
protected byte |
priority() |
T |
read(AutoBuffer ab)
Standard "read thyself from the AutoBuffer" call, using the fast Iced protocol.
|
T |
readJSON(AutoBuffer ab)
Standard "read thyself from the AutoBuffer" call, using JSON.
|
T |
reloadFromBytes(byte[] ary)
Replace yourself with deserialized version from the given bytes.
|
AutoBuffer |
write(AutoBuffer ab)
Standard "write thyself into the AutoBuffer" call, using the fast Iced
protocol.
|
AutoBuffer |
writeJSON(AutoBuffer ab)
Standard "write thyself into the AutoBuffer" call, using JSON.
|
__tryComplete, addToPendingCount, compareAndSetPendingCount, complete, exec, getCompleter, getPendingCount, getRawResult, onCompletion, onExceptionalCompletion, setCompleter, setPendingCount, setRawResult, tryComplete
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, completeExceptionally, fork, get, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
public H2OCountedCompleter()
protected H2OCountedCompleter(H2O.H2OCountedCompleter completer)
protected H2OCountedCompleter(byte prior)
protected H2OCountedCompleter(H2O.H2OCountedCompleter completer, byte prior)
public byte[] asBytes()
Freezable
asBytes
in interface Freezable<T extends H2O.H2OCountedCompleter>
public T reloadFromBytes(byte[] ary)
Freezable
reloadFromBytes
in interface Freezable<T extends H2O.H2OCountedCompleter>
ary
- byte array containing exactly (i.e. nothing else) the serialized version of the Freezablepublic final void compute()
compute2()
which contains actual work.compute
in class CountedCompleter
public void compute1()
public void compute2()
protected final byte priority()
public final T clone()
Freezable
clone
in interface Freezable<T extends H2O.H2OCountedCompleter>
clone
in class java.lang.Object
protected static byte currThrPriority()
public final AutoBuffer write(AutoBuffer ab)
Freezable
Icer
classes.write
in interface Freezable<T extends H2O.H2OCountedCompleter>
ab
- AutoBuffer
to write this object to.AutoBuffer
for flow-coding.public final AutoBuffer writeJSON(AutoBuffer ab)
Freezable
Icer
classes.writeJSON
in interface Freezable<T extends H2O.H2OCountedCompleter>
ab
- AutoBuffer
to write this object to.AutoBuffer
for flow-coding.public final T read(AutoBuffer ab)
Freezable
Icer
classes.read
in interface Freezable<T extends H2O.H2OCountedCompleter>
ab
- AutoBuffer
to read this object from.public final T readJSON(AutoBuffer ab)
Freezable
Icer
classes.readJSON
in interface Freezable<T extends H2O.H2OCountedCompleter>
ab
- AutoBuffer
to read this object from.public final int frozenType()
Freezable
frozenType
in interface Freezable<T extends H2O.H2OCountedCompleter>