Search in sources :

Example 1 with JobKeyV3

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

the class SplitFrameHandler method run.

public SplitFrameV3 run(int version, SplitFrameV3 sf) {
    SplitFrame splitFrame = sf.createAndFillImpl();
    Job job = splitFrame.exec();
    SplitFrameV3 spv3 = new SplitFrameV3(splitFrame);
    spv3.key = new KeyV3.JobKeyV3(job._key);
    return spv3;
}
Also used : SplitFrameV3(water.api.schemas3.SplitFrameV3) SplitFrame(hex.SplitFrame) Job(water.Job) KeyV3(water.api.schemas3.KeyV3)

Example 2 with JobKeyV3

use of water.api.schemas3.KeyV3.JobKeyV3 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

SplitFrame (hex.SplitFrame)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 Job (water.Job)1 KeyV3 (water.api.schemas3.KeyV3)1 JobKeyV3 (water.api.schemas3.KeyV3.JobKeyV3)1 SplitFrameV3 (water.api.schemas3.SplitFrameV3)1