org.apache.hadoop.mapred.nativetask.serde

## Interface INativeSerializer<T>

- All Known Implementing Classes:
    BoolWritableSerializer, BytesWritableSerializer, ByteWritableSerializer, DefaultSerializer, DoubleWritableSerializer, FloatWritableSerializer, IntWritableSerializer, LongWritableSerializer, NullWritableSerializer, TextSerializer, VIntWritableSerializer, VLongWritableSerializer

      @InterfaceAudience.Public
       @InterfaceStability.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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deserialize(DataInput in, int length, T w)`
    `int` | `getLength(T w)` get length of data to be serialized.
    `void` | `serialize(T w, DataOutput out)`

- - ### Method Detail

    - #### getLength

          int getLength(T w)
                 throws IOException

      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

          void serialize(T w,
                         DataOutput out)
                  throws IOException

      Throws:
        `IOException`

    - #### deserialize

          void deserialize(DataInput in,
                           int length,
                           T w)
                    throws IOException

      Throws:
        `IOException`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.