Class MultiColumnEncoder
- java.lang.Object
- 
- org.apache.sysds.runtime.transform.encode.MultiColumnEncoder
 
- 
- All Implemented Interfaces:
- Externalizable,- Serializable,- Encoder
 
 public class MultiColumnEncoder extends Object implements Encoder - See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static booleanAPPLY_ENCODER_SEPARATE_STAGESstatic booleanMULTI_THREADED_STAGES
 - 
Constructor SummaryConstructors Constructor Description MultiColumnEncoder()MultiColumnEncoder(List<ColumnEncoderComposite> columnEncoders)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends LegacyEncoder>
 voidaddReplaceLegacyEncoder(T encoder)voidallocateMetaData(FrameBlock meta)Pre-allocate a FrameBlock for metadata collection.MatrixBlockapply(CacheBlock in)MatrixBlockapply(CacheBlock in, int k)MatrixBlockapply(CacheBlock in, MatrixBlock out, int outputCol)Apply the generated metadata to the FrameBlock and saved the result in out.MatrixBlockapply(CacheBlock in, MatrixBlock out, int outputCol, int k)voidapplyColumnOffset()<T extends ColumnEncoder,E>
 voidapplyToAll(Class<T> type, Consumer<? super T> function)<T extends ColumnEncoder,E>
 voidapplyToAll(Consumer<? super ColumnEncoderComposite> function)voidbuild(CacheBlock in)Build the transform meta data for the given block input.voidbuild(CacheBlock in, int k)voidbuild(CacheBlock in, int k, Map<Integer,double[]> equiHeightBinMaxs)voidbuildPartial(FrameBlock in)Partial build of internal data structures (e.g., in distributed spark operations).<T extends ColumnEncoder>
 booleancontainsEncoderForID(int colID, Class<T> type)MatrixBlockencode(CacheBlock in)MatrixBlockencode(CacheBlock in, int k)MatrixBlockgetColMapping(FrameBlock meta)Obtain the column mapping of encoded frames based on the passed meta data frame.<T extends ColumnEncoder>
 TgetColumnEncoder(int colID, Class<T> type)List<ColumnEncoderComposite>getColumnEncoders()<T extends ColumnEncoder>
 List<T>getColumnEncoders(Class<T> type)List<ColumnEncoderComposite>getCompositeEncodersForID(int colID)List<Class<? extends ColumnEncoder>>getEncoderTypes()List<Class<? extends ColumnEncoder>>getEncoderTypes(int colID)<T extends ColumnEncoder,E>
 List<E>getFromAll(Class<T> type, Function<? super T,? extends E> mapper)<T extends ColumnEncoder>
 double[]getFromAllDoubleArray(Class<T> type, Function<? super T,? extends Double> mapper)<T extends ColumnEncoder>
 int[]getFromAllIntArray(Class<T> type, Function<? super T,? extends Integer> mapper)<T extends LegacyEncoder>
 TgetLegacyEncoder(Class<T> type)FrameBlockgetMetaData(FrameBlock meta)Construct a frame block out of the transform meta data.FrameBlockgetMetaData(FrameBlock meta, int k)intgetNumExtraCols()intgetNumExtraCols(IndexRange ixRange)<T extends LegacyEncoder>
 booleanhasLegacyEncoder()<T extends LegacyEncoder>
 booleanhasLegacyEncoder(Class<T> type)voidinitMetaData(FrameBlock meta)Sets up the required meta data for a subsequent call to apply.voidlegacyBuild(FrameBlock in)voidmergeAt(Encoder other, int columnOffset, int row)voidmergeReplace(MultiColumnEncoder multiEncoder)voidprepareBuildPartial()Allocates internal data structures for partial build.voidreadExternal(ObjectInput in)MultiColumnEncodersubRangeEncoder(IndexRange ixRange)<T extends ColumnEncoder>
 MultiColumnEncodersubRangeEncoder(IndexRange ixRange, Class<T> type)voidupdateIndexRanges(long[] beginDims, long[] endDims, int offset)Update index-ranges to after encoding.voidwriteExternal(ObjectOutput out)
 
- 
- 
- 
Constructor Detail- 
MultiColumnEncoderpublic MultiColumnEncoder(List<ColumnEncoderComposite> columnEncoders) 
 - 
MultiColumnEncoderpublic MultiColumnEncoder() 
 
- 
 - 
Method Detail- 
encodepublic MatrixBlock encode(CacheBlock in) 
 - 
encodepublic MatrixBlock encode(CacheBlock in, int k) 
 - 
buildpublic void build(CacheBlock in) Description copied from interface:EncoderBuild the transform meta data for the given block input. This call modifies and keeps meta data as encoder state.
 - 
buildpublic void build(CacheBlock in, int k) 
 - 
buildpublic void build(CacheBlock in, int k, Map<Integer,double[]> equiHeightBinMaxs) 
 - 
legacyBuildpublic void legacyBuild(FrameBlock in) 
 - 
applypublic MatrixBlock apply(CacheBlock in) 
 - 
applypublic MatrixBlock apply(CacheBlock in, int k) 
 - 
applypublic MatrixBlock apply(CacheBlock in, MatrixBlock out, int outputCol) Description copied from interface:EncoderApply the generated metadata to the FrameBlock and saved the result in out.
 - 
applypublic MatrixBlock apply(CacheBlock in, MatrixBlock out, int outputCol, int k) 
 - 
allocateMetaDatapublic void allocateMetaData(FrameBlock meta) Description copied from interface:EncoderPre-allocate a FrameBlock for metadata collection.- Specified by:
- allocateMetaDatain interface- Encoder
- Parameters:
- meta- frame block
 
 - 
getMetaDatapublic FrameBlock getMetaData(FrameBlock meta) Description copied from interface:EncoderConstruct a frame block out of the transform meta data.- Specified by:
- getMetaDatain interface- Encoder
- Parameters:
- meta- output frame block
- Returns:
- output frame block?
 
 - 
getMetaDatapublic FrameBlock getMetaData(FrameBlock meta, int k) 
 - 
initMetaDatapublic void initMetaData(FrameBlock meta) Description copied from interface:EncoderSets up the required meta data for a subsequent call to apply.- Specified by:
- initMetaDatain interface- Encoder
- Parameters:
- meta- frame block
 
 - 
prepareBuildPartialpublic void prepareBuildPartial() Description copied from interface:EncoderAllocates internal data structures for partial build.- Specified by:
- prepareBuildPartialin interface- Encoder
 
 - 
buildPartialpublic void buildPartial(FrameBlock in) Description copied from interface:EncoderPartial build of internal data structures (e.g., in distributed spark operations).- Specified by:
- buildPartialin interface- Encoder
- Parameters:
- in- input frame block
 
 - 
getColMappingpublic MatrixBlock getColMapping(FrameBlock meta) Obtain the column mapping of encoded frames based on the passed meta data frame.- Parameters:
- meta- meta data frame block
- Returns:
- matrix with column mapping (one row per attribute)
 
 - 
updateIndexRangespublic void updateIndexRanges(long[] beginDims, long[] endDims, int offset)Description copied from interface:EncoderUpdate index-ranges to after encoding. Note that only Dummycoding changes the ranges.- Specified by:
- updateIndexRangesin interface- Encoder
- Parameters:
- beginDims- begin dimensions of range
- endDims- end dimensions of range
- offset- is applied to begin and endDims
 
 - 
writeExternalpublic void writeExternal(ObjectOutput out) throws IOException - Specified by:
- writeExternalin interface- Externalizable
- Throws:
- IOException
 
 - 
readExternalpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException - Specified by:
- readExternalin interface- Externalizable
- Throws:
- IOException
- ClassNotFoundException
 
 - 
getColumnEncoderspublic <T extends ColumnEncoder> List<T> getColumnEncoders(Class<T> type) 
 - 
getColumnEncoderpublic <T extends ColumnEncoder> T getColumnEncoder(int colID, Class<T> type) 
 - 
getFromAllpublic <T extends ColumnEncoder,E> List<E> getFromAll(Class<T> type, Function<? super T,? extends E> mapper) 
 - 
getFromAllIntArraypublic <T extends ColumnEncoder> int[] getFromAllIntArray(Class<T> type, Function<? super T,? extends Integer> mapper) 
 - 
getFromAllDoubleArraypublic <T extends ColumnEncoder> double[] getFromAllDoubleArray(Class<T> type, Function<? super T,? extends Double> mapper) 
 - 
getColumnEncoderspublic List<ColumnEncoderComposite> getColumnEncoders() 
 - 
getCompositeEncodersForIDpublic List<ColumnEncoderComposite> getCompositeEncodersForID(int colID) 
 - 
getEncoderTypespublic List<Class<? extends ColumnEncoder>> getEncoderTypes(int colID) 
 - 
getEncoderTypespublic List<Class<? extends ColumnEncoder>> getEncoderTypes() 
 - 
getNumExtraColspublic int getNumExtraCols() 
 - 
getNumExtraColspublic int getNumExtraCols(IndexRange ixRange) 
 - 
containsEncoderForIDpublic <T extends ColumnEncoder> boolean containsEncoderForID(int colID, Class<T> type) 
 - 
applyToAllpublic <T extends ColumnEncoder,E> void applyToAll(Class<T> type, Consumer<? super T> function) 
 - 
applyToAllpublic <T extends ColumnEncoder,E> void applyToAll(Consumer<? super ColumnEncoderComposite> function) 
 - 
subRangeEncoderpublic MultiColumnEncoder subRangeEncoder(IndexRange ixRange) 
 - 
subRangeEncoderpublic <T extends ColumnEncoder> MultiColumnEncoder subRangeEncoder(IndexRange ixRange, Class<T> type) 
 - 
mergeReplacepublic void mergeReplace(MultiColumnEncoder multiEncoder) 
 - 
mergeAtpublic void mergeAt(Encoder other, int columnOffset, int row) 
 - 
addReplaceLegacyEncoderpublic <T extends LegacyEncoder> void addReplaceLegacyEncoder(T encoder) 
 - 
hasLegacyEncoderpublic <T extends LegacyEncoder> boolean hasLegacyEncoder() 
 - 
hasLegacyEncoderpublic <T extends LegacyEncoder> boolean hasLegacyEncoder(Class<T> type) 
 - 
getLegacyEncoderpublic <T extends LegacyEncoder> T getLegacyEncoder(Class<T> type) 
 - 
applyColumnOffsetpublic void applyColumnOffset() 
 
- 
 
-