Search in sources :

Example 11 with KeyV3

use of water.api.schemas3.KeyV3 in project h2o-3 by h2oai.

the class JobV3 method fillFromImpl.

// Version&Schema-specific filling from the impl
@Override
public JobV3 fillFromImpl(Job job) {
    if (job == null)
        return this;
    // Handle fields in subclasses:
    PojoUtils.copyProperties(this, job, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES);
    // TODO: make consistent and remove
    PojoUtils.copyProperties(this, job, PojoUtils.FieldNaming.CONSISTENT);
    key = new JobKeyV3(job._key);
    description = job._description;
    warnings = job.warns();
    progress = job.progress();
    progress_msg = job.progress_msg();
    // Notice new state "CANCEL_PENDING".
    if (job.isRunning())
        if (job.stop_requested())
            status = "CANCEL_PENDING";
        else
            status = "RUNNING";
    else if (job.stop_requested())
        status = "CANCELLED";
    else
        status = "DONE";
    Throwable ex = job.ex();
    if (ex != null)
        status = "FAILED";
    exception = ex == null ? null : ex.toString();
    if (ex != null) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        ex.printStackTrace(pw);
        stacktrace = sw.toString();
    }
    msec = job.msec();
    ready_for_view = job.readyForView();
    Keyed dest_type = (Keyed) TypeMap.theFreezable(job._typeid);
    dest = job._result == null ? null : KeyV3.make(dest_type.makeSchema(), job._result);
    return this;
}
Also used : StringWriter(java.io.StringWriter) JobKeyV3(water.api.schemas3.KeyV3.JobKeyV3) PrintWriter(java.io.PrintWriter)

Aggregations

KeyV3 (water.api.schemas3.KeyV3)10 H2OIllegalArgumentException (water.exceptions.H2OIllegalArgumentException)4 FrameV3 (water.api.schemas3.FrameV3)3 Frame (water.fvec.Frame)3 Field (java.lang.reflect.Field)2 Map (java.util.Map)2 JobV3 (water.api.schemas3.JobV3)2 ValFrame (water.rapids.vals.ValFrame)2 CreateFrame (hex.CreateFrame)1 DataInfo (hex.DataInfo)1 SplitFrame (hex.SplitFrame)1 Gram (hex.gram.Gram)1 Grid (hex.grid.Grid)1 Word2VecModel (hex.word2vec.Word2VecModel)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Properties (java.util.Properties)1