water.api
Class FrameSplit.FrameSplitter

java.lang.Object
  extended by jsr166y.ForkJoinTask<java.lang.Void>
      extended by jsr166y.CountedCompleter
          extended by water.H2O.H2OCountedCompleter
              extended by water.DTask
                  extended by water.MRTask2<FrameSplit.FrameSplitter>
                      extended by water.api.FrameSplit.FrameSplitter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.concurrent.Future<java.lang.Void>, Freezable
Enclosing class:
FrameSplit

public static class FrameSplit.FrameSplitter
extends MRTask2<FrameSplit.FrameSplitter>

split a frame into multiple frames, with the data split as desired
NB: this allocates fvecs; caller is responsible for remove-ing them

TODO: pregenerate random numbers and make deterministic
TODO: allow perfect splitting instead of at-random, particularly for unit tests

See Also:
Serialized Form

Field Summary
 
Fields inherited from class water.MRTask2
_fr, _fs, _hi, _left, _lo, _nleft, _nodes, _nrite, _outputFrame, _rite, _topLocal
 
Fields inherited from class water.DTask
_cls, _eFromNode, _exception, _fname, _lineNum, _msg, _mth
 
Constructor Summary
FrameSplit.FrameSplitter()
           
 
Method Summary
 Frame[] finishHead()
          return the new frames; call on headnode after doAll
 Frame initHead(Frame frame, double[] splits)
          must be called on headnode before doAll to perform setup
 void map(Chunk[] cs)
          Override with your map implementation.
 
Methods inherited from class water.MRTask2
clone, closeLocal, compute2, dfork, dfork, dfork, dfork, dinvoke, doAll, doAll, doAll, doAll, getResult, map, map, map, map, map, map, map, map, map, map, map, onCompletion, onExceptionalCompletion, postGlobal, profString, reduce, reduce4, setupLocal, vecs
 
Methods inherited from class water.DTask
copyOver, frozenType, getDException, hasException, logVerbose, newInstance, onAck, onAckAck, read, setException, toDocField, write, writeJSONFields
 
Methods inherited from class water.H2O.H2OCountedCompleter
compute, priority
 
Methods inherited from class jsr166y.CountedCompleter
addToPendingCount, compareAndSetPendingCount, complete, exec, getCompleter, getPendingCount, getRawResult, setCompleter, setPendingCount, setRawResult, tryComplete
 
Methods inherited from class jsr166y.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameSplit.FrameSplitter

public FrameSplit.FrameSplitter()
Method Detail

initHead

public Frame initHead(Frame frame,
                      double[] splits)
must be called on headnode before doAll to perform setup


finishHead

public Frame[] finishHead()
return the new frames; call on headnode after doAll


map

public void map(Chunk[] cs)
Description copied from class: MRTask2
Override with your map implementation. This overload is given an array of local input Chunks, for Frames with arbitrary column numbers. All map variants are called, but only one is expected to be overridden.

Overrides:
map in class MRTask2<FrameSplit.FrameSplitter>