Class AerospikeCacheKeyProcessorImpl
java.lang.Object
org.springframework.data.aerospike.cache.AerospikeCacheKeyProcessorImpl
- All Implemented Interfaces:
AerospikeCacheKeyProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateHash(byte[] data) Calculate hash based on the given byte array.voidConfiguration for Kryo instance.byte[]Serialize the given key.serializeAndHash(Object key) Serialize the given key and calculate hash based on the serialization result.
-
Constructor Details
-
AerospikeCacheKeyProcessorImpl
public AerospikeCacheKeyProcessorImpl()
-
-
Method Details
-
configureKryo
public void configureKryo()Configuration for Kryo instance.Classes of the objects to be cached can be pre-registered if required. Registering in advance is not necessary, however it can be done to increase serialization performance. If a class has been pre-registered, the first time it is encountered Kryo can just output a numeric reference to it instead of writing fully qualified class name.
-
serializeAndHash
Description copied from interface:AerospikeCacheKeyProcessorSerialize the given key and calculate hash based on the serialization result.- Specified by:
serializeAndHashin interfaceAerospikeCacheKeyProcessor- Parameters:
key- Object to be serialized and hashed- Returns:
- AerospikeCacheKey instantiated with either a String or a long number
-
serialize
Description copied from interface:AerospikeCacheKeyProcessorSerialize the given key.The default implementation uses Kryo.
- Specified by:
serializein interfaceAerospikeCacheKeyProcessor- Parameters:
key- Object to be serialized- Returns:
- byte[]
-
calculateHash
Description copied from interface:AerospikeCacheKeyProcessorCalculate hash based on the given byte array.The default implementation uses 128 bit Murmur3 hashing.
- Specified by:
calculateHashin interfaceAerospikeCacheKeyProcessor- Parameters:
data- Byte array to be hashed- Returns:
- AerospikeCacheKey instantiated with either a String or a long number
-