Interface MarshallableEntry<K,V>


public interface MarshallableEntry<K,V>
Defines an externally persisted entry. External stores that keep the data in serialised form should return an MarshalledEntry that contains the data in binary form (ByteBuffer) and unmarshall it lazily when getKey/Value/Metadata are invoked. This approach avoids unnecessary object (de)serialization e.g when the entries are fetched from the external store for the sole purpose of being sent over the wire to another requestor node.
Since:
10.0
Author:
Ryan Emerson
  • Method Details

    • getKeyBytes

      ByteBuffer getKeyBytes()
      Returns the key in serialized format.
    • getValueBytes

      ByteBuffer getValueBytes()
      Returns the value in serialize format.
    • getMetadataBytes

      ByteBuffer getMetadataBytes()
      Returns:
      null if there's no metadata associated with the object (e.g. expiry info, version..)
    • getInternalMetadataBytes

      ByteBuffer getInternalMetadataBytes()
      Returns:
      null if there is no internal metadata associated with the object.
    • getKey

      K getKey()
      Returns the same key as getKeyBytes(), but unmarshalled.
    • getValue

      V getValue()
      Returns the same value as getKeyBytes(), but unmarshalled.
    • getMetadata

      Metadata getMetadata()
      Returns:
      might be null if there's no metadata associated with the object (e.g. expiry info, version..).
    • getInternalMetadata

      PrivateMetadata getInternalMetadata()
      Returns:
      null if there is no internal metadata associated with the object.
    • created

      long created()
    • lastUsed

      long lastUsed()
    • isExpired

      boolean isExpired(long now)
    • expiryTime

      long expiryTime()
    • getMarshalledValue

      MarshalledValue getMarshalledValue()