public final class Job<T extends Keyed> extends Keyed<Job>
Jobs are Keyed
, because they need to Key to control e.g. atomic updates.
Jobs are generic on Keyed, because their primary result is a Keyed result - which is Not a Job. Obvious examples are Frames (from running Parse or CreateFrame jobs), or Models (from running ModelBuilder jobs).
Long running tasks will has-a Job, not is-a Job.
Modifier and Type | Class and Description |
---|---|
static class |
Job.JobCancelledException |
Modifier and Type | Field and Description |
---|---|
java.lang.String |
_description
User description
|
long |
_max_runtime_msecs |
Key<T> |
_result
Result Key
|
int |
_typeid |
long |
_work
Total expected work.
|
static Key<Job> |
LIST
A system key for global list of Job keys.
|
Constructor and Description |
---|
Job(Key<T> key,
java.lang.String clz_of_T,
java.lang.String desc)
Create a Job
|
Modifier and Type | Method and Description |
---|---|
long |
end_time() |
java.lang.Throwable |
ex() |
T |
get()
Blocks until the Job completes
|
static boolean |
isCancelledException(java.lang.Throwable ex) |
boolean |
isCrashed() |
boolean |
isCrashing() |
boolean |
isDone() |
boolean |
isRunning() |
boolean |
isStopped() |
boolean |
isStopping() |
static Job[] |
jobs()
The list of all Jobs, past and present.
|
java.lang.Class<KeyV3.JobKeyV3> |
makeSchema() |
long |
msec()
Current runtime; zero if not started.
|
java.lang.String |
progress_msg()
Returns last progress message.
|
float |
progress()
Returns a float from 0 to 1 representing progress.
|
boolean |
readyForView() |
void |
setReadyForView(boolean ready) |
void |
setWarnings(java.lang.String[] warns) |
long |
start_time() |
Job<T> |
start(H2O.H2OCountedCompleter fjtask,
long work)
Start this task based on given top-level fork-join task representing job computation.
|
Job<T> |
start(H2O.H2OCountedCompleter fjtask,
long work,
double max_runtime_secs) |
boolean |
stop_requested() |
void |
stop() |
void |
update(long newworked) |
static void |
update(long newworked,
Key<Job> jobkey) |
void |
update(long newworked,
java.lang.String msg)
Report new work done for this job
|
static void |
update(long newworked,
java.lang.String msg,
Key<Job> jobkey) |
void |
warn(java.lang.String warn) |
java.lang.String[] |
warns() |
checksum_impl, checksum, readAll_impl, readAll, remove_impl, remove, remove, remove, remove, writeAll_impl, writeAll
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonString, write, writeExternal, writeJSON
public final int _typeid
public final java.lang.String _description
public long _work
public long _max_runtime_msecs
public void warn(java.lang.String warn)
public void setWarnings(java.lang.String[] warns)
public long start_time()
public long end_time()
public boolean isRunning()
public boolean isStopped()
public boolean isStopping()
public boolean isDone()
public boolean isCrashing()
public boolean isCrashed()
public long msec()
public boolean readyForView()
public void setReadyForView(boolean ready)
public boolean stop_requested()
public void stop()
public java.lang.Throwable ex()
public float progress()
public java.lang.String progress_msg()
public final void update(long newworked, java.lang.String msg)
public final void update(long newworked)
public java.lang.String[] warns()
public static Job[] jobs()
public Job<T> start(H2O.H2OCountedCompleter fjtask, long work, double max_runtime_secs)
public Job<T> start(H2O.H2OCountedCompleter fjtask, long work)
fjtask
- top-level job computation task.work
- Amount of work to-do, for updating progress barisRunning()
stateH2O.H2OCountedCompleter
public static boolean isCancelledException(java.lang.Throwable ex)
public T get()
public java.lang.Class<KeyV3.JobKeyV3> makeSchema()
makeSchema
in class Keyed<Job>