public abstract class ADictionary extends Object
| Constructor and Description | 
|---|
| ADictionary() | 
| Modifier and Type | Method and Description | 
|---|---|
| abstract double | aggregate(double init,
         Builtin fn)Aggregate all the contained values, useful in value only computations where the operation is iterating through
 all values contained in the dictionary. | 
| void | aggregateCols(double[] c,
             Builtin fn,
             int[] colIndexes)Aggregates the columns into the target double array provided. | 
| abstract ADictionary | apply(ScalarOperator op)Applies the scalar operation on the dictionary. | 
| abstract ADictionary | applyScalarOp(ScalarOperator op,
             double newVal,
             int numCols)Applies the scalar operation on the dictionary. | 
| abstract ADictionary | clone()Returns a deep clone of the dictionary. | 
| abstract long | getExactSizeOnDisk()Calculate the space consumption if the dictionary is stored on disk. | 
| abstract long | getInMemorySize()Returns the memory usage of the dictionary. | 
| abstract int | getNumberOfValues(int ncol)Get the number of values given that the column group has n columns | 
| abstract double | getValue(int i)Get Specific value contained in the dictionary at index. | 
| abstract double[] | getValues()Get all the values contained in the dictionary as a linearized double array. | 
| abstract int | getValuesLength()returns the count of values contained in the dictionary. | 
| abstract int | hasZeroTuple(int ncol)Determines if the content has a zero tuple. | 
| static ADictionary | read(DataInput in,
    boolean lossy)The read function to instantiate the dictionary. | 
| abstract void | write(DataOutput out)Write the dictionary to a DataOutput. | 
public abstract double[] getValues()
public abstract double getValue(int i)
i - The index to extract the value frompublic abstract int hasZeroTuple(int ncol)
ncol - The number of columns in the dictionary.public abstract long getInMemorySize()
public abstract double aggregate(double init,
                                 Builtin fn)
init - The initial Value, in cases such as Max value, this could be -infinityfn - The Function to apply to valuespublic abstract int getValuesLength()
public abstract ADictionary apply(ScalarOperator op)
op - The operator to apply to the dictionary values.public abstract ADictionary applyScalarOp(ScalarOperator op, double newVal, int numCols)
op - The operator to apply to the dictionary values.newVal - The value to append to the dictionary.numCols - The number of columns stored in the dictionary.public abstract ADictionary clone()
public void aggregateCols(double[] c,
                          Builtin fn,
                          int[] colIndexes)
c - The target double array, this contains the full number of columns, therefore the colIndexes for
                   this specific dictionary is needed.fn - The function to apply to individual columnscolIndexes - The mapping to the target columns from the individual columnspublic static ADictionary read(DataInput in, boolean lossy) throws IOException
in - The data input source to read the stored dictionary fromlossy - Boolean specifying if the dictionary stored was lossy.IOException - if the reading source throws it.public abstract void write(DataOutput out) throws IOException
out - the output sink to write the dictionary to.IOException - if the sink fails.public abstract long getExactSizeOnDisk()
public abstract int getNumberOfValues(int ncol)
ncol - The number of Columns in the ColumnGroup.Copyright © 2020 The Apache Software Foundation. All rights reserved.