Examples of MRTask


Examples of water.MRTask

    // cross the wire during copy. B's data could potentially cross the wire.
    Frame frbind = H2OHelper.emptyFrame(fra.numRows() + frb.numRows(), fra.numCols(),
            -1, -1, fra.anyVec().group());
    Vec keys = null;

    MRTask task = new MRTask() {
        public void map(Chunk chks[], NewChunk nc) {
          Vec A_vecs[] = fra.vecs();
          Vec B_vecs[] = frb.vecs();
          long A_rows = fra.numRows();
          long B_rows = frb.numRows();
          long start = chks[0].start();
          int chunkSize = chks[0].len();
          ValueString vstr = new ValueString();

          for (int r = 0; r < chunkSize; r++) {
            for (int c = 0; c < chks.length; c++) {
              if (r + start < A_rows) {
                chks[c].set0(r, A_vecs[c].at(r + start));
                if (keysa != null) {
                  nc.addStr(keysa.atStr(vstr, r + start));
                }
              } else {
                chks[c].set0(r, B_vecs[c].at(r + start - A_rows));
                if (keysb != null) {
                  nc.addStr(keysb.atStr(vstr, r + start - A_rows));
                }
              }
            }
          }
        }
      };

    if (keysa == null) {
      keys = task.doAll(1, frbind).outputFrame(null, null).anyVec();
    } else {
      task.doAll(frbind);
    }

    return new H2ODrm(frbind, keys);
  }
View Full Code Here

Examples of water.MRTask

    Vec keys = drmA.keys;
    int AewScalar_cols = A.numCols();

    // AewScalar is written into ncs[] with an MRTask on A, and therefore will
    // be similarly partitioned as A.
    Frame AewScalar = new MRTask() {
        private double opfn(String op, double a, double b) {
          if (a == 0.0 && b == 0.0) {
            return 0.0;
          }
          if (op.equals("+")) {
View Full Code Here

Examples of water.MRTask

      bvecs[i] = fra.anyVec().makeZero();
    }

    // Next run an MRTask on the new vectors, and fill each cell (initially 0)
    // by pulling in appropriate values from B (frb)
    new MRTask() {
      public void map(Chunk chks[]) {
        int chunkSize = chks[0].len();
        long start = chks[0].start();
        Vec vecs[] = frb.vecs();
View Full Code Here

Examples of water.MRTask

      // The new String Vec will therefore be similarly partitioned as the
      // new Frame.
      //
      // vout is finally collected by calling anyVec() on outputFrame(),
      // as it is the only column in the output frame.
      vout = new MRTask() {
          public void map(Chunk chks[], NewChunk nc) {
            int chunkSize = chks[0].len();
            Vec vins[] = frin.vecs();
            long start = chks[0].start();
            ValueString vstr = new ValueString();

            for (int r = 0; r < chunkSize; r++) {
              for (int c = 0; c < chks.length; c++) {
                chks[c].set0(r, vins[c].at(start + r));
              }
              nc.addStr(vin.atStr(vstr, start + r));
            }
          }
        }.doAll(1, frout).outputFrame(null, null).anyVec();
    } else {
      // If not String keyed, then run and MRTask on the new frame, and
      // just pull in right elements from frin
      new MRTask() {
        public void map(Chunk chks[]) {
          int chunkSize = chks[0].len();
          Vec vins[] = frin.vecs();
          long start = chks[0].start();
View Full Code Here

Examples of water.MRTask

    // and A.numRows() columns.
    Frame At = H2OHelper.emptyFrame(A.numCols(), (int) A.numRows(), -1, -1);

    // Execute MRTask on the new frame, and fill each cell (initially 0) by
    // pulling in the appropriate value from A.
    new MRTask() {
      public void map(Chunk chks[]) {
        int chunkSize = chks[0].len();
        long start = chks[0].start();
        Vec A_vecs[] = A.vecs();
View Full Code Here

Examples of water.MRTask

    // ABt is written into ncs[] with an MRTask on A, and therefore will
    // be similarly partitioned as A.
    //
    // chks.length == A.numCols() (== B.numCols())
    // ncs.length == ABt_cols (B.numRows())
    Frame ABt = new MRTask() {
        public void map(Chunk chks[], NewChunk ncs[]) {
          int chunkSize = chks[0].len();
          Vec B_vecs[] = B.vecs();

          for (int c = 0; c < ncs.length; c++) {
View Full Code Here

Examples of water.MRTask

    // Execute MRTask on the new Frame, and fill each cell (initially 0) by
    // computing appropriate values from A and B.
    //
    // chks.length == B.numCols()
    new MRTask() {
      public void map(Chunk chks[]) {
        int chunkSize = chks[0].len();
        long start = chks[0].start();
        long A_rows = A.numRows();
        Vec A_vecs[] = A.vecs();
View Full Code Here

Examples of water.MRTask

    // Execute MRTask on the new Frame, and fill each cell (initially 0) by
    // computing appropriate values from A.
    //
    // chks.length == A.numCols()
    new MRTask() {
      public void map(Chunk chks[]) {
        int chunkSize = chks[0].len();
        long start = chks[0].start();
        Vec A_vecs[] = A.vecs();
        long A_rows = A.numRows();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.