java.lang.Object
com.hazelcast.hibernate.serialization.Expirable
com.hazelcast.hibernate.serialization.ExpiryMarker
- All Implemented Interfaces:
com.hazelcast.nio.serialization.DataSerializable,com.hazelcast.nio.serialization.IdentifiedDataSerializable,Serializable
An entry which is marked for expiration. This can occur when Hibernate is expecting to update an entry as a result
of changes being made in an in-progress transaction
Such an entry has the following properties
- It will always return a null value, resulting in a cache miss
- It is only replaceable when it is completely expired
- It can be marked by multiple transactions at the same time and will not expire until all transactions complete
- It should not be expired unless
matches(ExpiryMarker)is true
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpire(long timestamp) Expire the marker.intintgetValue()getValue(long txTimestamp) booleanbooleanisReplaceableBy(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.markForExpiration(long timeout, String nextMarkerId) Mark the entry for expiration with the given timeout and marker id.booleanmatches(ExpiryMarker lock) voidreadData(com.hazelcast.nio.ObjectDataInput in) voidwriteData(com.hazelcast.nio.ObjectDataOutput out) Methods inherited from class com.hazelcast.hibernate.serialization.Expirable
equals, getVersion, hashCode
-
Constructor Details
-
ExpiryMarker
public ExpiryMarker() -
ExpiryMarker
-
-
Method Details
-
isReplaceableBy
Description copied from class:ExpirableDetermine if the current entry can be overridden with a value corresponding to the given new version and the transaction timestamp.- Specified by:
isReplaceableByin classExpirable- Parameters:
txTimestamp- the timestamp of the transactionnewVersion- the new version for the replacement valueversionComparator- the comparator to use for the version- Returns:
trueif the value can be replaced,falseotherwise
-
getValue
-
getValue
-
matches
-
isConcurrent
public boolean isConcurrent()- Returns:
trueif the marker has ever beenmarkForExpiration(long, String)concurrently,falseotherwise
-
markForExpiration
Description copied from class:ExpirableMark the entry for expiration with the given timeout and marker id. For every invocation a corresponding call toexpire(long)should be made, provided that the returned markerExpirable.matches(ExpiryMarker)- Specified by:
markForExpirationin classExpirable- Parameters:
timeout- the timestamp in which the lock times outnextMarkerId- the next lock id to use if creating a new lock- Returns:
- the newly created marker, or the current marker with a higher multiplicity
- See Also:
-
expire
Expire the marker. The marker may have been marked multiple times so it may still not bereplaceable.- Parameters:
timestamp- the timestamp to specify when it was completely expired- Returns:
- a new
ExpiryMarker
-
writeData
- Specified by:
writeDatain interfacecom.hazelcast.nio.serialization.DataSerializable- Overrides:
writeDatain classExpirable- Throws:
IOException
-
readData
- Specified by:
readDatain interfacecom.hazelcast.nio.serialization.DataSerializable- Overrides:
readDatain classExpirable- Throws:
IOException
-
getFactoryId
public int getFactoryId()- Specified by:
getFactoryIdin interfacecom.hazelcast.nio.serialization.IdentifiedDataSerializable
-
getClassId
public int getClassId()- Specified by:
getClassIdin interfacecom.hazelcast.nio.serialization.IdentifiedDataSerializable
-