Search in sources :

Example 6 with FrameKeyV3

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

the class CreateFrameHandler method run.

public JobV3 run(int version, CreateFrameV3 cf) {
    if (cf.dest == null) {
        cf.dest = new KeyV3.FrameKeyV3();
        cf.dest.name = Key.rand();
    }
    CreateFrame cfr = new CreateFrame(cf.dest.key());
    cf.fillImpl(cfr);
    return new JobV3(cfr.execImpl());
}
Also used : KeyV3(water.api.schemas3.KeyV3) JobV3(water.api.schemas3.JobV3) CreateFrame(hex.CreateFrame)

Example 7 with FrameKeyV3

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

the class FrameV3 method fillFromImpl.

public FrameV3 fillFromImpl(Frame f, long row_offset, int row_count, int column_offset, int column_count) {
    // 100 rows by default
    if (row_count == 0)
        row_count = 100;
    // full width by default
    if (column_count == 0)
        column_count = f.numCols() - column_offset;
    row_count = (int) Math.min(row_count, row_offset + f.numRows());
    column_count = Math.min(column_count, column_offset + f.numCols());
    this.frame_id = new FrameKeyV3(f._key);
    this.checksum = f.checksum();
    this.byte_size = f.byteSize();
    this.row_offset = row_offset;
    this.rows = f.numRows();
    this.num_columns = f.numCols();
    this.row_count = row_count;
    this.total_column_count = f.numCols();
    this.column_offset = column_offset;
    this.column_count = column_count;
    this.columns = new ColV3[column_count];
    Vec[] vecs = f.vecs();
    Futures fs = new Futures();
    // NOTE: SKIP deleted Vecs!  The columns entry will be null for deleted Vecs.
    for (int i = 0; i < column_count; i++) if (null == DKV.get(vecs[column_offset + i]._key))
        Log.warn("For Frame: " + f._key + ", Vec number: " + (column_offset + i) + " (" + f.name((column_offset + i)) + ") is missing; not returning it.");
    else
        vecs[column_offset + i].startRollupStats(fs);
    for (int i = 0; i < column_count; i++) if (null == DKV.get(vecs[column_offset + i]._key))
        Log.warn("For Frame: " + f._key + ", Vec number: " + (column_offset + i) + " (" + f.name((column_offset + i)) + ") is missing; not returning it.");
    else
        columns[i] = new ColV3(f._names[column_offset + i], vecs[column_offset + i], this.row_offset, this.row_count);
    fs.blockForPending();
    this.is_text = f.numCols() == 1 && vecs[0] instanceof ByteVec;
    this.default_percentiles = Vec.PERCENTILES;
    ChunkSummary cs = FrameUtils.chunkSummary(f);
    this.chunk_summary = new TwoDimTableV3(cs.toTwoDimTableChunkTypes());
    this.distribution_summary = new TwoDimTableV3(cs.toTwoDimTableDistribution());
    this._fr = f;
    return this;
}
Also used : Futures(water.Futures) ByteVec(water.fvec.ByteVec) Vec(water.fvec.Vec) ChunkSummary(water.util.ChunkSummary) ByteVec(water.fvec.ByteVec) FrameKeyV3(water.api.schemas3.KeyV3.FrameKeyV3) PrettyPrint(water.util.PrettyPrint)

Aggregations

KeyV3 (water.api.schemas3.KeyV3)5 Frame (water.fvec.Frame)3 FrameKeyV3 (water.api.schemas3.KeyV3.FrameKeyV3)2 ValFrame (water.rapids.vals.ValFrame)2 CreateFrame (hex.CreateFrame)1 DataInfo (hex.DataInfo)1 Model (hex.Model)1 Gram (hex.gram.Gram)1 Word2VecModel (hex.word2vec.Word2VecModel)1 ArrayList (java.util.ArrayList)1 Futures (water.Futures)1 Key (water.Key)1 JobV3 (water.api.schemas3.JobV3)1 ModelKeyV3 (water.api.schemas3.KeyV3.ModelKeyV3)1 ByteVec (water.fvec.ByteVec)1 Vec (water.fvec.Vec)1 VectorGroup (water.fvec.Vec.VectorGroup)1 Assembly (water.rapids.Assembly)1 Transform (water.rapids.transforms.Transform)1 ChunkSummary (water.util.ChunkSummary)1