public abstract class Expirable extends Object implements com.hazelcast.nio.serialization.IdentifiedDataSerializable
| Modifier | Constructor and Description |
|---|---|
protected |
Expirable() |
protected |
Expirable(Object version) |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
getValue() |
abstract Object |
getValue(long txTimestamp) |
Object |
getVersion() |
abstract boolean |
isReplaceableBy(long txTimestamp,
Object newVersion,
Comparator versionComparator)
Determine if the current entry can be overridden with a value corresponding to the given new version
and the transaction timestamp.
|
abstract ExpiryMarker |
markForExpiration(long timeout,
String nextMarkerId)
Mark the entry for expiration with the given timeout and marker id.
|
abstract boolean |
matches(ExpiryMarker lock) |
void |
readData(com.hazelcast.nio.ObjectDataInput in) |
void |
writeData(com.hazelcast.nio.ObjectDataOutput out) |
protected Object version
protected Expirable()
protected Expirable(Object version)
public abstract boolean isReplaceableBy(long txTimestamp,
Object newVersion,
Comparator versionComparator)
txTimestamp - the timestamp of the transactionnewVersion - the new version for the replacement valueversionComparator - the comparator to use for the versiontrue if the value can be replaced, false otherwisepublic abstract Object getValue()
null if none existspublic abstract Object getValue(long txTimestamp)
txTimestamp - the timestamp of the transactionnullpublic Object getVersion()
null if the entry is not versionedpublic abstract boolean matches(ExpiryMarker lock)
lock - ExpiryMarker to be checked for a matchtrue if the Expirable matches using the specified lock, false otherwiseExpiryMarker.expire(long)public abstract ExpiryMarker markForExpiration(long timeout, String nextMarkerId)
For every invocation a corresponding call to ExpiryMarker.expire(long) should be made, provided that
the returned marker matches
timeout - the timestamp in which the lock times outnextMarkerId - the next lock id to use if creating a new lockExpiryMarker.expire(long)public void writeData(com.hazelcast.nio.ObjectDataOutput out)
throws IOException
writeData in interface com.hazelcast.nio.serialization.DataSerializableIOExceptionpublic void readData(com.hazelcast.nio.ObjectDataInput in)
throws IOException
readData in interface com.hazelcast.nio.serialization.DataSerializableIOExceptionCopyright © 2018. All Rights Reserved.