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.
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
|
protected 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 |
Modifier | Constructor and Description |
---|---|
protected |
Job(Key<Job> 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.
|
void |
cancel2(java.lang.Throwable ex)
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.
|
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).
|
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 |
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)
Report new work done for a given job key
|
clone, frozenType, read_impl, read, readExternal, readJSON_impl, readJSON, toJsonString, write_impl, write, writeExternal, writeHTML_impl, writeHTML, writeJSON_impl, writeJSON
public final 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.FAILED
public boolean isRunning()
public boolean isDone()
Job.JobState.DONE
public boolean isStopped()
public static boolean isRunning(Key<Job> job_key)
job_key
- job keypublic final long msec()
public Job start(H2O.H2OCountedCompleter fjtask, long work)
fjtask
- top-level job computation task.work
- Units of work to be completedJob.JobState.RUNNING
stateJob.JobState
,
H2O.H2OCountedCompleter
public 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 UKV based on job
destination key.
start(water.H2O.H2OCountedCompleter, long)
,
DKV
public 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 float progress()
public final void update(long newworked)
public static void update(long newworked, Key<Job> jobkey)
protected Futures remove_impl(Futures fs)
Keyed
Vec
(removing associated Chunk
keys)
and Frame
(removing associated Vec
keys.)remove_impl
in class Keyed
protected long checksum_impl()
checksum_impl
in class Keyed