public class Job<T extends Keyed> extends Keyed
| Modifier and Type | Class and Description |
|---|---|
static class |
Job.JobState
Possible job states.
|
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
_description
Basic metadata about the Job
|
Key |
_dest
Jobs produce a single DKV result into Key _dest
|
long |
_end_time |
java.lang.String |
_exception |
long |
_start_time |
Job.JobState |
_state |
long |
_work
Returns a float from 0 to 1 representing progress.
|
static Key |
LIST
A system key for global list of Job keys.
|
| Constructor and Description |
|---|
Job(Key dest,
java.lang.String desc,
long work)
Create a Job
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Signal cancellation of this job.
|
void |
cancel(java.lang.String msg)
Signal exceptional cancellation of this job.
|
void |
cancel2(java.lang.Throwable ex)
Signal exceptional cancellation of this job.
|
Key |
dest() |
void |
done()
Marks job as finished and records job end time.
|
T |
get()
Blocks and get result of this job.
|
boolean |
isRunning()
Returns true if this job is running
|
static boolean |
isRunning(Key job_key)
Check if given job is running.
|
boolean |
isStopped()
Returns true if this job was started and is now stopped
|
static Job[] |
jobs() |
long |
msec()
Current runtime; zero if not started
|
protected void |
onCancelled()
Callback which is called after job cancellation (by user, by exception).
|
float |
progress() |
Job |
start(H2O.H2OCountedCompleter fjtask)
Start this task based on given top-level fork-join task representing job computation.
|
void |
update(long newworked) |
static void |
update(long newworked,
Key jobkey) |
clone, frozenType, read_impl, read, readJSON_impl, readJSON, write_impl, write, writeHTML_impl, writeHTML, writeJSON_impl, writeJSONpublic static final Key LIST
public final Key _dest
public final java.lang.String _description
public long _start_time
public long _end_time
public java.lang.String _exception
public Job.JobState _state
public final long _work
public Job(Key dest, java.lang.String desc, long work)
dest - Final result Key to be produced by this Jobdesc - String descriptionwork - Units of work to be completedpublic static Job[] jobs()
public final Key dest()
public boolean isRunning()
public boolean isStopped()
public static boolean isRunning(Key job_key)
job_key - job keypublic final long msec()
public Job start(H2O.H2OCountedCompleter fjtask)
fjtask - top-level job computation task.Job.JobState.RUNNING stateJob.JobState,
H2O.H2OCountedCompleterpublic T get()
The call blocks on working task which was passed via #start(H2OCountedCompleter) method
and returns the result which is fetched from UKV based on job destination key.
#start(H2OCountedCompleter),
DKVpublic void done()
public void cancel()
The job will be switched to state Job.JobState.CANCELLED which signals that
the job was cancelled by a user.
public void cancel2(java.lang.Throwable ex)
ex - exception causing the termination of job.public void cancel(java.lang.String msg)
msg - cancellation message explaining reason for cancelationprotected void onCancelled()
public final float progress()
public final void update(long newworked)
public static void update(long newworked,
Key jobkey)