public class Value extends Expirable
Constructor and Description |
---|
Value() |
Value(Object version,
long timestamp,
Object value) |
Modifier and Type | Method and Description |
---|---|
int |
getFactoryId()
Returns DataSerializableFactory factory id for this class.
|
int |
getId()
Returns type identifier for this class.
|
long |
getTimestamp() |
Object |
getValue() |
Object |
getValue(long txTimestamp) |
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 long getTimestamp()
public 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
otherwiseExpiryMarker.expire(long)
public ExpiryMarker markForExpiration(long timeout, String nextMarkerId)
Expirable
ExpiryMarker.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 lockExpiryMarker.expire(long)
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
readData
in class Expirable
in
- inputIOException
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
writeData
in class Expirable
out
- outputIOException
public int getFactoryId()
IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.