Package 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 Description DefaultStateSerializer()
DefaultStateSerializer(Map<String,Object> topoConf, TopologyContext context)
DefaultStateSerializer(Map<String,Object> topoConf, TopologyContext context, List<Class<?>> classesToRegister)
Constructs aDefaultStateSerializer
instance with the given list of classes registered in kryo.
-
-
-
Constructor Detail
-
DefaultStateSerializer
public DefaultStateSerializer(Map<String,Object> topoConf, TopologyContext context, List<Class<?>> classesToRegister)
Constructs aDefaultStateSerializer
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 interfaceSerializer<T>
-
deserialize
public T deserialize(byte[] b)
- Specified by:
deserialize
in interfaceSerializer<T>
-
-