Package org.apache.storm.state
Class DefaultStateEncoder<K,V> 
java.lang.Object
org.apache.storm.state.DefaultStateEncoder<K,V> 
- All Implemented Interfaces:
- StateEncoder<K,- V, - byte[], - byte[]> 
Default state encoder class for encoding/decoding key values. This class assumes encoded types of key and value are both binary (byte
 array) due to keep backward compatibility.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultStateEncoder(Serializer<K> keySerializer, Serializer<V> valueSerializer) 
- 
Method SummaryModifier and TypeMethodDescriptiondecodeKey(byte[] encodedKey) Decode key.decodeValue(byte[] encodedValue) Decode value.byte[]Encode key.byte[]encodeValue(V value) Encode value.byte[]Get the tombstone value (deletion mark).
- 
Field Details- 
INTERNAL_VALUE_SERIALIZER
- 
TOMBSTONEpublic static final byte[] TOMBSTONE
 
- 
- 
Constructor Details- 
DefaultStateEncoder
 
- 
- 
Method Details- 
getKeySerializer
- 
getValueSerializer
- 
encodeKeyDescription copied from interface:StateEncoderEncode key.- Specified by:
- encodeKeyin interface- StateEncoder<K,- V, - byte[], - byte[]> 
- Parameters:
- key- the value of key (K type)
- Returns:
- the encoded value of key (KENCODEDT type)
 
- 
encodeValueDescription copied from interface:StateEncoderEncode value.- Specified by:
- encodeValuein interface- StateEncoder<K,- V, - byte[], - byte[]> 
- Parameters:
- value- the value of value (V type)
- Returns:
- the encoded value of value (VENCODEDT type)
 
- 
decodeKeyDescription copied from interface:StateEncoderDecode key.- Specified by:
- decodeKeyin interface- StateEncoder<K,- V, - byte[], - byte[]> 
- Parameters:
- encodedKey- the value of key (KRAW type)
- Returns:
- the decoded value of key (K type)
 
- 
decodeValueDescription copied from interface:StateEncoderDecode value.- Specified by:
- decodeValuein interface- StateEncoder<K,- V, - byte[], - byte[]> 
- Parameters:
- encodedValue- the value of key (VENCODEDT type)
- Returns:
- the decoded value of key (V type)
 
- 
getTombstoneValuepublic byte[] getTombstoneValue()Description copied from interface:StateEncoderGet the tombstone value (deletion mark).- Specified by:
- getTombstoneValuein interface- StateEncoder<K,- V, - byte[], - byte[]> 
- Returns:
- the tomestone value (VENCODEDT type)
 
 
-