public class ExpiryMarker extends Expirable implements Serializable
matches
is trueConstructor and Description |
---|
ExpiryMarker() |
ExpiryMarker(Object version,
long timeout,
String markerId) |
Modifier and Type | Method and Description |
---|---|
ExpiryMarker |
expire(long timestamp)
Expire the marker.
|
int |
getFactoryId()
Returns DataSerializableFactory factory id for this class.
|
int |
getId()
Returns type identifier for this class.
|
Object |
getValue() |
Object |
getValue(long txTimestamp) |
boolean |
isConcurrent() |
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.
|
ExpiryMarker |
markForExpiration(long timeout,
String nextMarkerId)
Mark the entry for expiration with the given timeout and marker id.
|
boolean |
matches(ExpiryMarker lock) |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
getVersion
public boolean isReplaceableBy(long txTimestamp, Object newVersion, Comparator versionComparator)
Expirable
isReplaceableBy
in class Expirable
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 Object getValue()
public Object getValue(long txTimestamp)
public boolean matches(ExpiryMarker lock)
matches
in class Expirable
true
if the Expirable
matches using the specified lock, false
otherwiseexpire(long)
public boolean isConcurrent()
true
if the marker has ever been markForExpiration(long, String)
concurrently, false
otherwisepublic ExpiryMarker markForExpiration(long timeout, String nextMarkerId)
Expirable
expire(long)
should be made, provided that
the returned marker matches
markForExpiration
in class Expirable
timeout
- the timestamp in which the lock times outnextMarkerId
- the next lock id to use if creating a new lockexpire(long)
public ExpiryMarker expire(long timestamp)
replaceable
.timestamp
- the timestamp to specify when it was completely expiredExpiryMarker
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
writeData
in class Expirable
out
- outputIOException
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
readData
in class Expirable
in
- inputIOException
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.