public abstract class Expirable extends Object implements 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(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFactoryId, getId
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 transactionnull
public Object getVersion()
null
if the entry is not versionedpublic abstract boolean matches(ExpiryMarker lock)
true
if the Expirable
matches using the specified lock, false
otherwiseExpiryMarker.expire(long)
public abstract ExpiryMarker markForExpiration(long timeout, String nextMarkerId)
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(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.