public class MultiColumnEncoder extends Object implements Encoder
Modifier and Type | Field and Description |
---|---|
static int |
BUILD_BLOCKSIZE |
Constructor and Description |
---|
MultiColumnEncoder() |
MultiColumnEncoder(List<ColumnEncoderComposite> columnEncoders) |
Modifier and Type | Method and Description |
---|---|
<T extends LegacyEncoder> |
addReplaceLegacyEncoder(T encoder) |
MatrixBlock |
apply(FrameBlock in) |
MatrixBlock |
apply(FrameBlock in,
int k) |
MatrixBlock |
apply(FrameBlock in,
MatrixBlock out,
int outputCol)
Apply the generated metadata to the FrameBlock and saved the result in out.
|
MatrixBlock |
apply(FrameBlock in,
MatrixBlock out,
int outputCol,
int k) |
void |
applyColumnOffset() |
<T extends ColumnEncoder,E> |
applyToAll(Class<T> type,
Consumer<? super T> function) |
<T extends ColumnEncoder,E> |
applyToAll(Consumer<? super ColumnEncoderComposite> function) |
void |
build(FrameBlock in)
Build the transform meta data for the given block input.
|
void |
build(FrameBlock in,
int k) |
void |
buildPartial(FrameBlock in)
Partial build of internal data structures (e.g., in distributed spark operations).
|
<T extends ColumnEncoder> |
containsEncoderForID(int colID,
Class<T> type) |
MatrixBlock |
encode(FrameBlock in) |
MatrixBlock |
encode(FrameBlock in,
int k) |
MatrixBlock |
getColMapping(FrameBlock meta)
Obtain the column mapping of encoded frames based on the passed meta data frame.
|
<T extends ColumnEncoder> |
getColumnEncoder(int colID,
Class<T> type) |
List<ColumnEncoderComposite> |
getColumnEncoders() |
<T extends ColumnEncoder> |
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> |
getFromAll(Class<T> type,
Function<? super T,? extends E> mapper) |
<T extends ColumnEncoder> |
getFromAllDoubleArray(Class<T> type,
Function<? super T,? extends Double> mapper) |
<T extends ColumnEncoder> |
getFromAllIntArray(Class<T> type,
Function<? super T,? extends Integer> mapper) |
<T extends LegacyEncoder> |
getLegacyEncoder(Class<T> type) |
FrameBlock |
getMetaData(FrameBlock meta)
Construct a frame block out of the transform meta data.
|
int |
getNumExtraCols() |
int |
getNumExtraCols(IndexRange ixRange) |
<T extends LegacyEncoder> |
hasLegacyEncoder(Class<T> type) |
void |
initMetaData(FrameBlock meta)
Sets up the required meta data for a subsequent call to apply.
|
void |
legacyBuild(FrameBlock in) |
void |
mergeAt(Encoder other,
int columnOffset,
int row) |
void |
mergeReplace(MultiColumnEncoder multiEncoder) |
void |
prepareBuildPartial()
Allocates internal data structures for partial build.
|
void |
readExternal(ObjectInput in) |
void |
setApplyBlockSize(int blk) |
void |
setBuildBlockSize(int blk) |
MultiColumnEncoder |
subRangeEncoder(IndexRange ixRange) |
<T extends ColumnEncoder> |
subRangeEncoder(IndexRange ixRange,
Class<T> type) |
void |
updateIndexRanges(long[] beginDims,
long[] endDims,
int offset)
Update index-ranges to after encoding.
|
void |
writeExternal(ObjectOutput out) |
public MultiColumnEncoder(List<ColumnEncoderComposite> columnEncoders)
public MultiColumnEncoder()
public void setApplyBlockSize(int blk)
public void setBuildBlockSize(int blk)
public MatrixBlock encode(FrameBlock in)
public MatrixBlock encode(FrameBlock in, int k)
public void build(FrameBlock in)
Encoder
public void build(FrameBlock in, int k)
public void legacyBuild(FrameBlock in)
public MatrixBlock apply(FrameBlock in)
public MatrixBlock apply(FrameBlock in, int k)
public MatrixBlock apply(FrameBlock in, MatrixBlock out, int outputCol)
Encoder
public MatrixBlock apply(FrameBlock in, MatrixBlock out, int outputCol, int k)
public FrameBlock getMetaData(FrameBlock meta)
Encoder
getMetaData
in interface Encoder
meta
- output frame blockpublic void initMetaData(FrameBlock meta)
Encoder
initMetaData
in interface Encoder
meta
- frame blockpublic void prepareBuildPartial()
Encoder
prepareBuildPartial
in interface Encoder
public void buildPartial(FrameBlock in)
Encoder
buildPartial
in interface Encoder
in
- input frame blockpublic MatrixBlock getColMapping(FrameBlock meta)
meta
- meta data frame blockpublic void updateIndexRanges(long[] beginDims, long[] endDims, int offset)
Encoder
updateIndexRanges
in interface Encoder
beginDims
- begin dimensions of rangeendDims
- end dimensions of rangeoffset
- is applied to begin and endDimspublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public <T extends ColumnEncoder> List<T> getColumnEncoders(Class<T> type)
public <T extends ColumnEncoder> T getColumnEncoder(int colID, Class<T> type)
public <T extends ColumnEncoder,E> List<E> getFromAll(Class<T> type, Function<? super T,? extends E> mapper)
public <T extends ColumnEncoder> int[] getFromAllIntArray(Class<T> type, Function<? super T,? extends Integer> mapper)
public <T extends ColumnEncoder> double[] getFromAllDoubleArray(Class<T> type, Function<? super T,? extends Double> mapper)
public List<ColumnEncoderComposite> getColumnEncoders()
public List<ColumnEncoderComposite> getCompositeEncodersForID(int colID)
public List<Class<? extends ColumnEncoder>> getEncoderTypes(int colID)
public List<Class<? extends ColumnEncoder>> getEncoderTypes()
public int getNumExtraCols()
public int getNumExtraCols(IndexRange ixRange)
public <T extends ColumnEncoder> boolean containsEncoderForID(int colID, Class<T> type)
public <T extends ColumnEncoder,E> void applyToAll(Class<T> type, Consumer<? super T> function)
public <T extends ColumnEncoder,E> void applyToAll(Consumer<? super ColumnEncoderComposite> function)
public MultiColumnEncoder subRangeEncoder(IndexRange ixRange)
public <T extends ColumnEncoder> MultiColumnEncoder subRangeEncoder(IndexRange ixRange, Class<T> type)
public void mergeReplace(MultiColumnEncoder multiEncoder)
public void mergeAt(Encoder other, int columnOffset, int row)
public <T extends LegacyEncoder> void addReplaceLegacyEncoder(T encoder)
public <T extends LegacyEncoder> boolean hasLegacyEncoder(Class<T> type)
public <T extends LegacyEncoder> T getLegacyEncoder(Class<T> type)
public void applyColumnOffset()
Copyright © 2021 The Apache Software Foundation. All rights reserved.