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
|
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
|
boolean |
hasEx() |
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.
|
void |
setEx(java.lang.Throwable ex,
java.lang.Class thrower_clz)
Set an exception into this Job, marking it as failing and setting the
_stop_requested flag.
|
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.
|
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) |
checksum_impl, checksum, readAll_impl, readAll, remove_impl, remove, remove, remove, remove, writeAll_impl, writeAllclone, copyOver, frozenType, read_impl, read, readExternal, readJSON_impl, readJSON, toJsonString, write_impl, write, writeExternal, writeJSON_impl, writeJSONpublic final int _typeid
public final java.lang.String _description
public long _work
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 stop_requested()
public void stop()
public java.lang.Throwable ex()
public boolean hasEx()
public void setEx(java.lang.Throwable ex,
java.lang.Class thrower_clz)
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 static Job[] jobs()
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.H2OCountedCompleterpublic static boolean isCancelledException(java.lang.Throwable ex)
public T get()
public java.lang.Class<KeyV3.JobKeyV3> makeSchema()
makeSchema in class Keyed<Job>