public class CreateFrameExecutor extends H2O.H2OCountedCompleter<CreateFrameExecutor>
This class carries out the frame creation job.
Frame creation is conceptually done in 3 stages: First, a build "recipe" is prepared. This recipe is the detailed specification of how the frame is to be constructed. Second, an MRTask is run that actually creates the frame, according to the specification in the recipe. In this step all "column makers" are executed in order they were added, for each chunk-row being created. Finally, a set of postprocessing steps are performed on the resulting frame.
Usage example:
Job<Frame> job = new Job<>(destination_key, Frame.class.getName(), "CreateFrame");
CreateFrameExecutor cfe = new CreateFrameExecutor(job);
cfe.setNumRows(10000);
cfe.setSeed(0xDECAFC0FEE);
cfe.addColumnMaker(new RealColumnCfcm("col0", -1, 1));
cfe.addColumnMaker(new IntegerColumnCfcm("col1", 0, 100));
cfe.addPostprocessStep(new MissingInserterCfps(0.05));
job.start(cfe, cfe.workAmount());
Constructor and Description |
---|
CreateFrameExecutor(Job<Frame> job)
Make a new CreateFrameExecutor.
|
Modifier and Type | Method and Description |
---|---|
void |
addColumnMaker(CreateFrameColumnMaker maker)
Add a "column maker" task, responsible for creation of a single (rarely
married or widowed) column.
|
void |
addPostprocessStep(CreateFramePostprocessStep step)
Add a step to be performed in the end after the frame has been created.
|
void |
compute2()
Override compute3() with actual work without having to worry about tryComplete()
|
long |
estimatedByteSize()
Estimated size of the frame (in bytes), to be used in determining the
optimal chunk size.
|
void |
setNumRows(int n)
Set number of rows to be created in the resulting frame.
|
void |
setSeed(long s)
Set the seed for the random number generator.
|
int |
workAmount()
Return total amount of work that will be performed by the executor.
|
asBytes, clone, compute, compute1, currThrPriority, frozenType, icer, priority, read, readJSON, reloadFromBytes, write, writeJSON
__tryComplete, addToPendingCount, compareAndSetPendingCount, complete, exec, getCompleter, getPendingCount, getRawResult, onCompletion, onExceptionalCompletion, setCompleter, setPendingCount, setRawResult, tryComplete
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
public void setNumRows(int n)
public void setSeed(long s)
public void addColumnMaker(CreateFrameColumnMaker maker)
public void addPostprocessStep(CreateFramePostprocessStep step)
public int workAmount()
public long estimatedByteSize()
public void compute2()
H2O.H2OCountedCompleter
compute2
in class H2O.H2OCountedCompleter<CreateFrameExecutor>