Package ml.shifu.guagua.hadoop.io
Class GuaguaWritableSerializer<RESULT extends ml.shifu.guagua.io.Bytable>
- java.lang.Object
-
- ml.shifu.guagua.io.BytableSerializer<RESULT>
-
- ml.shifu.guagua.hadoop.io.GuaguaWritableSerializer<RESULT>
-
- All Implemented Interfaces:
ml.shifu.guagua.io.Serializer<RESULT>
public class GuaguaWritableSerializer<RESULT extends ml.shifu.guagua.io.Bytable> extends ml.shifu.guagua.io.BytableSerializer<RESULT>GuaguaWritableSerializeris to provide the functionality to support use hadoop writable interface.By using this, one should set result class name to Writable, not
Bytablelike this:conf.set(GuaguaConstants.GUAGUA_RESULT_CLASS, LongWritable.class.getName());
-
-
Constructor Summary
Constructors Constructor Description GuaguaWritableSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RESULTbytesToObject(byte[] data, String className)De-serialize from bytes to object.
-
-
-
Method Detail
-
bytesToObject
public RESULT bytesToObject(byte[] data, String className)
De-serialize from bytes to object. One should provide the instance before de-serializing the object.- Specified by:
bytesToObjectin interfaceml.shifu.guagua.io.Serializer<RESULT extends ml.shifu.guagua.io.Bytable>- Overrides:
bytesToObjectin classml.shifu.guagua.io.BytableSerializer<RESULT extends ml.shifu.guagua.io.Bytable>- Throws:
NullPointerException- if className or data is null.ml.shifu.guagua.GuaguaRuntimeException- if any IO exception or other reflection exception.
-
-