public abstract class CreateFrameColumnMaker extends Iced<CreateFrameColumnMaker>
Modifier and Type | Field and Description |
---|---|
protected int |
index |
Constructor and Description |
---|
CreateFrameColumnMaker() |
Modifier and Type | Method and Description |
---|---|
float |
byteSizePerRow()
Estimated byte size of a single row created by this column maker.
|
java.lang.String[][] |
columnDomains()
Domains for categorical columns being created (if any).
|
abstract java.lang.String[] |
columnNames()
Names of the columns produces by this column maker.
|
abstract byte[] |
columnTypes()
Types of the columns produced by the column maker.
|
abstract void |
exec(int nrows,
NewChunk[] ncs,
java.util.Random rng)
Implement this method in a subclass to actually build the columns.
|
int |
numColumns()
Number of columns described by this column maker.
|
void |
setIndex(int i)
Index of the first column that this column maker will be creating.
|
int |
workAmount()
Relative amount of work this column maker performs to fill a chunk.
|
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonString, write, writeExternal, writeJSON
public abstract void exec(int nrows, NewChunk[] ncs, java.util.Random rng)
nrows
- Number of rows in the current chunk. If method is creating new columns,
then it is supposed to add this many rows.ncs
- The `NewChunk`s array passed down from the `map()` method in `MRTask`.
A subclass is expected to know which NewChunks it is allowed to touch,
usually with the help of the index
variable.rng
- Random number generator that the subclass may use to fill the columns
randomly. Do NOT use any other random generator as doing so will break
the reproducibility promise of the CreateFrame service.public int numColumns()
public abstract byte[] columnTypes()
numColumns()
.public abstract java.lang.String[] columnNames()
numColumns()
.public java.lang.String[][] columnDomains()
public void setIndex(int i)
index
variable it sets
can be used to determine which columns in the ncs
array to
fill during the exec(int, NewChunk[], Random)
step.public float byteSizePerRow()
public int workAmount()
Relative amount of work this column maker performs to fill a chunk. The base amount of 100 corresponds to a method that draws a single random number per row and then uses simple arithmetic before adding a value to the NewChunk.
The output will be used to inform te Job
about progress
being made. It needn't be very precise.