Class DecoderRecode
- java.lang.Object
-
- org.apache.sysds.runtime.transform.decode.Decoder
-
- org.apache.sysds.runtime.transform.decode.DecoderRecode
-
- All Implemented Interfaces:
Externalizable,Serializable
public class DecoderRecode extends Decoder
Simple atomic decoder for recoded columns. This decoder builds internally inverted recode maps from the given frame meta data.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DecoderRecode()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FrameBlockdecode(MatrixBlock in, FrameBlock out)Block decode API converting a matrix block into a frame block.voidinitMetaData(FrameBlock meta)static voidparseRecodeMapEntry(String entry, Pair<String,String> pair)Parses a line of <token, ID, count> into <token, ID> pairs, where quoted tokens (potentially including separators) are supported.voidreadExternal(ObjectInput in)Redirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast/rdd deserialization.DecodersubRangeDecoder(int colStart, int colEnd, int dummycodedOffset)Returns a new Decoder that only handles a sub range of columns.voidwriteExternal(ObjectOutput out)Redirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast/rdd serialization.-
Methods inherited from class org.apache.sysds.runtime.transform.decode.Decoder
getColnames, getSchema, setColnames, updateIndexRanges
-
-
-
-
Method Detail
-
decode
public FrameBlock decode(MatrixBlock in, FrameBlock out)
Description copied from class:DecoderBlock decode API converting a matrix block into a frame block.
-
subRangeDecoder
public Decoder subRangeDecoder(int colStart, int colEnd, int dummycodedOffset)
Description copied from class:DecoderReturns a new Decoder that only handles a sub range of columns. The sub-range refers to the columns after decoding.- Overrides:
subRangeDecoderin classDecoder- Parameters:
colStart- the start index of the sub-range (1-based, inclusive)colEnd- the end index of the sub-range (1-based, exclusive)dummycodedOffset- the offset of dummycoded segments before colStart- Returns:
- a decoder of the same type, just for the sub-range
-
initMetaData
public void initMetaData(FrameBlock meta)
- Specified by:
initMetaDatain classDecoder
-
parseRecodeMapEntry
public static void parseRecodeMapEntry(String entry, Pair<String,String> pair)
Parses a line of <token, ID, count> into <token, ID> pairs, where quoted tokens (potentially including separators) are supported.- Parameters:
entry- entry line (token, ID, count)pair- token-ID pair
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
Description copied from class:DecoderRedirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast/rdd serialization.- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classDecoder- Parameters:
out- object output- Throws:
IOException- if IOException occurs
-
readExternal
public void readExternal(ObjectInput in) throws IOException
Description copied from class:DecoderRedirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast/rdd deserialization.- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classDecoder- Parameters:
in- object input- Throws:
IOException- if IOException occur
-
-