org.apache.storm.state

## Class DefaultStateSerializer<T>

- java.lang.Object
- - org.apache.storm.state.DefaultStateSerializer<T>

- All Implemented Interfaces:
    Serializable, Serializer<T>

      public class DefaultStateSerializer<T>
      extends Object
      implements Serializer<T>

  A default implementation that uses Kryo to serialize and de-serialize the state.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultStateSerializer()`
    `DefaultStateSerializer(Map<String,Object> topoConf, TopologyContext context)`
    `DefaultStateSerializer(Map<String,Object> topoConf, TopologyContext context, List<Class<?>> classesToRegister)` Constructs a `DefaultStateSerializer` instance with the given list of classes registered in kryo.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `deserialize(byte[] b)`
    `byte[]` | `serialize(T obj)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultStateSerializer

          public DefaultStateSerializer(Map<String,Object> topoConf,
                                        TopologyContext context,
                                        List<Class<?>> classesToRegister)

      Constructs a `DefaultStateSerializer` instance with the given list of classes registered in kryo.

      Parameters:
        `classesToRegister` - the classes to register.

    - #### DefaultStateSerializer

          public DefaultStateSerializer(Map<String,Object> topoConf,
                                        TopologyContext context)

    - #### DefaultStateSerializer

          public DefaultStateSerializer()

  - ### Method Detail

    - #### serialize

          public byte[] serialize(T obj)

      Specified by:
        `serialize` in interface `Serializer<T>`

    - #### deserialize

          public T deserialize(byte[] b)

      Specified by:
        `deserialize` in interface `Serializer<T>`

Copyright © 2021 The Apache Software Foundation. All rights reserved.