Class AerospikeCacheKeyProcessorImpl

java.lang.Object
org.springframework.data.aerospike.cache.AerospikeCacheKeyProcessorImpl
All Implemented Interfaces:
AerospikeCacheKeyProcessor

public class AerospikeCacheKeyProcessorImpl extends Object implements AerospikeCacheKeyProcessor
  • 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

      public AerospikeCacheKey serializeAndHash(Object key)
      Description copied from interface: AerospikeCacheKeyProcessor
      Serialize the given key and calculate hash based on the serialization result.
      Specified by:
      serializeAndHash in interface AerospikeCacheKeyProcessor
      Parameters:
      key - Object to be serialized and hashed
      Returns:
      AerospikeCacheKey instantiated with either a String or a long number
    • serialize

      public byte[] serialize(Object key)
      Description copied from interface: AerospikeCacheKeyProcessor
      Serialize the given key.

      The default implementation uses Kryo.

      Specified by:
      serialize in interface AerospikeCacheKeyProcessor
      Parameters:
      key - Object to be serialized
      Returns:
      byte[]
    • calculateHash

      public AerospikeCacheKey calculateHash(byte[] data)
      Description copied from interface: AerospikeCacheKeyProcessor
      Calculate hash based on the given byte array.

      The default implementation uses 128 bit Murmur3 hashing.

      Specified by:
      calculateHash in interface AerospikeCacheKeyProcessor
      Parameters:
      data - Byte array to be hashed
      Returns:
      AerospikeCacheKey instantiated with either a String or a long number