Package org.infinispan.persistence.spi
Interface MarshallableEntry<K,V>
-
- All Known Subinterfaces:
MarshalledEntry<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 Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default MarshalledEntry<K,V>
asMarshalledEntry()
Deprecated.This should not be used by users and will be removed in subsequent versions along withMarshalledEntry
.long
created()
long
expiryTime()
K
getKey()
Returns the same key asgetKeyBytes()
, but unmarshalled.ByteBuffer
getKeyBytes()
Returns the key in serialized format.MarshalledValue
getMarshalledValue()
Metadata
getMetadata()
ByteBuffer
getMetadataBytes()
V
getValue()
Returns the same value asgetKeyBytes()
, but unmarshalled.ByteBuffer
getValueBytes()
Returns the value in serialize format.boolean
isExpired(long now)
long
lastUsed()
-
-
-
Method Detail
-
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..)
-
getKey
K getKey()
Returns the same key asgetKeyBytes()
, but unmarshalled.
-
getValue
V getValue()
Returns the same value asgetKeyBytes()
, but unmarshalled.
-
getMetadata
Metadata getMetadata()
- Returns:
- might be null if there's no metadata associated with the object (e.g. expiry info, version..).
-
created
long created()
-
lastUsed
long lastUsed()
-
isExpired
boolean isExpired(long now)
-
expiryTime
long expiryTime()
-
asMarshalledEntry
@Deprecated default MarshalledEntry<K,V> asMarshalledEntry()
Deprecated.This should not be used by users and will be removed in subsequent versions along withMarshalledEntry
.A bridge method required to ensure backwards compatibility with old store implementations that rely onMarshalledEntry
. It's not possible to simply create a static wrapper class around aMarshallableEntry
asgetMetadataBytes()
is different fromgetMetadataBytes()
and we require aMarshaller
instance to generate said bytes.
-
getMarshalledValue
MarshalledValue getMarshalledValue()
-
-