Interface INativeSerializer<T>
- All Known Implementing Classes:
DefaultSerializer
@Public
@Evolving
public interface INativeSerializer<T>
an INativeSerializer serializes and deserializes data transferred between
Java and native.
DefaultSerializer provides default implementations.
Note: if you implemented your customized NativeSerializer instead of DefaultSerializer,
you have to make sure the native side can serialize it correctly.-
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(DataInput in, int length, T w) intget length of data to be serialized.voidserialize(T w, DataOutput out)
-
Method Details
-
getLength
get length of data to be serialized. If the data length is already known (like IntWritable) and could immediately be returned from this method, it is good chance to implement customized NativeSerializer for efficiency- Throws:
IOException
-
serialize
- Throws:
IOException
-
deserialize
- Throws:
IOException
-