public class Job<T extends Keyed> extends Keyed
Jobs are Keyed, because they need to Key to control e.g. atomic updates.
Jobs produce a Keyed result, such as a Frame (from Parsing), or a Model.
NOTE: the Job class is parametrized on the type of its _dest field.
| Modifier and Type | Class and Description |
|---|---|
static class |
Job.JobCancelledException
Simple named exception class
|
static class |
Job.JobState
Possible job states.
|
static class |
Job.Progress
Helper class to store the job progress in the DKV
|
static class |
Job.ProgressUpdate
Helper class to atomically update the job progress in the DKV
|
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
_description
User description
|
Key<T> |
_dest
Jobs produce a single DKV result into Key _dest
|
long |
_end_time
Job end_time using Sys.CTM, or 0 if not ended
|
java.lang.String |
_exception
Any exception thrown by this Job, or null if none
|
protected Key |
_progressKey |
long |
_start_time
Job start_time using Sys.CTM
|
Job.JobState |
_state |
static Key<Job> |
LIST
A system key for global list of Job keys.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Job(Key<T> jobKey,
Key<T> dest,
java.lang.String desc) |
|
Job(Key<T> dest,
java.lang.String desc)
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.
|
protected long |
checksum_impl()
Default checksum; not really used by Jobs.
|
Key<T> |
dest()
Since _dest is public final, not sure why we have a getter but some
people like 'em.
|
void |
done()
Marks job as finished and records job end time.
|
void |
failed(java.lang.Throwable ex)
Signal exceptional cancellation of this job.
|
T |
get()
Blocks and get result of this job.
|
boolean |
isCancelledOrCrashed()
Returns true if the job was cancelled by the user or crashed.
|
boolean |
isDone()
Returns true if this job is done
|
boolean |
isRunning()
Returns true if this job is running
|
static boolean |
isRunning(Key<Job> job_key)
Check if given job is running.
|
boolean |
isStopped()
Returns true if this job was started and is now stopped
|
static Job[] |
jobs()
The list of all Jobs, past and present.
|
long |
msec()
Current runtime; zero if not started
|
protected void |
onCancelled()
Callback which is called after job cancellation (by user, by exception).
|
java.lang.String |
progress_msg()
Returns last progress message.
|
float |
progress()
Returns a float from 0 to 1 representing progress.
|
protected Futures |
remove_impl(Futures fs)
Override to remove subparts, but not self, of composite Keyed objects.
|
Job<T> |
start(H2O.H2OCountedCompleter fjtask,
long work)
Start this task based on given top-level fork-join task representing job computation.
|
void |
update(long newworked)
Report new work done for this job
|
static void |
update(long newworked,
Key<Job> jobkey) |
void |
update(long newworked,
java.lang.String msg) |
static void |
update(long newworked,
java.lang.String msg,
Key<Job> jobkey) |
clone, frozenType, read_impl, read, readExternal, readJSON_impl, readJSON, toJsonString, write_impl, write, writeExternal, writeHTML_impl, writeHTML, writeJSON_impl, writeJSONpublic java.lang.String _description
public long _start_time
public long _end_time
public java.lang.String _exception
public Job.JobState _state
protected Key _progressKey
public static Job[] jobs()
public final Key<T> dest()
public boolean isCancelledOrCrashed()
Job.JobState.CANCELLED or Job.JobState.FAILEDpublic boolean isRunning()
public boolean isDone()
Job.JobState.DONEpublic boolean isStopped()
public static boolean isRunning(Key<Job> job_key)
job_key - job keypublic final long msec()
public Job<T> start(H2O.H2OCountedCompleter fjtask, long work)
fjtask - top-level job computation task.work - Units of work to be completedJob.JobState.RUNNING stateJob.JobState,
H2O.H2OCountedCompleterpublic T get()
This call blocks on working task which was passed via start(water.H2O.H2OCountedCompleter, long)
method and returns the result which is fetched from DKV based on job
destination key.
start(water.H2O.H2OCountedCompleter, long),
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 failed(java.lang.Throwable ex)
ex - exception causing the termination of job.public void cancel(java.lang.String msg)
msg - cancellation message explaining reason for cancellationprotected void onCancelled()
public float progress()
public java.lang.String progress_msg()
public final void update(long newworked)
public final void update(long newworked,
java.lang.String msg)
protected Futures remove_impl(Futures fs)
KeyedVec (removing associated Chunk keys)
and Frame (removing associated Vec keys.)remove_impl in class Keyedprotected long checksum_impl()
checksum_impl in class Keyed