V - the type of the value stored by this AbstractNearCacheRecordpublic abstract class AbstractNearCacheRecord<V> extends Object implements NearCacheRecord<V>
NearCacheRecord with value and expiration time as internal state.| Modifier and Type | Field and Description |
|---|---|
protected int |
accessHit |
protected long |
accessTime |
protected long |
creationTime |
protected long |
expirationTime |
static int |
NUMBER_OF_INTEGER_FIELD_TYPES |
static int |
NUMBER_OF_LONG_FIELD_TYPES |
protected int |
partitionId |
protected long |
recordState |
protected long |
sequence |
protected UUID |
uuid |
protected V |
value |
NOT_RESERVED, READ_PERMITTED, RESERVED, TIME_NOT_SET, UPDATE_STARTED| Constructor and Description |
|---|
AbstractNearCacheRecord(V value,
long creationTime,
long expirationTime) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
casRecordState(long expect,
long update) |
int |
getAccessHit()
Gets the access hit count of this
Evictable. |
long |
getCreationTime()
Gets the creation time of this
Evictable in milliseconds. |
long |
getExpirationTime()
Gets the expiration time in milliseconds.
|
long |
getInvalidationSequence() |
long |
getLastAccessTime()
Gets the latest access time difference of this
Evictable in milliseconds. |
int |
getPartitionId() |
long |
getRecordState() |
V |
getValue()
Gets the value of this
Evictable. |
boolean |
hasSameUuid(UUID thatUuid) |
void |
incrementAccessHit()
Increases the access hit count of this
Evictable by 1. |
boolean |
isExpiredAt(long now)
Checks whether the expiration time is passed with respect to the provided time.
|
boolean |
isIdleAt(long maxIdleMilliSeconds,
long now)
Checks whether the maximum idle time is passed with respect to the provided time
without any access during this time period as
maxIdleSeconds. |
void |
resetAccessHit()
Resets the access hit count of this
Evictable to 0. |
void |
setAccessHit(int accessHit)
Sets the access hit count of this
Evictable. |
void |
setAccessTime(long accessTime)
Sets the access time of this
Evictable in milliseconds. |
void |
setCreationTime(long creationTime)
Sets the creation time of this
Evictable in milliseconds. |
void |
setExpirationTime(long expirationTime)
Sets the expiration time in milliseconds.
|
void |
setInvalidationSequence(long sequence) |
void |
setPartitionId(int partitionId) |
void |
setUuid(UUID uuid) |
void |
setValue(V value)
Sets the value of this
NearCacheRecord. |
String |
toString() |
public static final int NUMBER_OF_LONG_FIELD_TYPES
public static final int NUMBER_OF_INTEGER_FIELD_TYPES
protected long creationTime
protected volatile int partitionId
protected volatile long sequence
protected volatile UUID uuid
protected volatile V value
protected volatile long expirationTime
protected volatile long accessTime
protected volatile long recordState
protected volatile int accessHit
public AbstractNearCacheRecord(V value, long creationTime, long expirationTime)
public V getValue()
EvictableEvictable.public void setValue(V value)
NearCacheRecordNearCacheRecord.setValue in interface NearCacheRecord<V>value - the value for this NearCacheRecordpublic long getExpirationTime()
ExpirablegetExpirationTime in interface ExpirableSystem.currentTimeMillis()public void setExpirationTime(long expirationTime)
ExpirablesetExpirationTime in interface ExpirableSystem.currentTimeMillis()public long getCreationTime()
EvictableEvictable in milliseconds.getCreationTime in interface Evictable<V>Evictable in millisecondspublic void setCreationTime(long creationTime)
NearCacheRecordEvictable in milliseconds.setCreationTime in interface NearCacheRecord<V>creationTime - the creation time for this Evictable in millisecondspublic long getLastAccessTime()
EvictableEvictable in milliseconds.getLastAccessTime in interface Evictable<V>Evictable in millisecondspublic void setAccessTime(long accessTime)
NearCacheRecordEvictable in milliseconds.setAccessTime in interface NearCacheRecord<V>accessTime - the latest access time of this Evictable in millisecondspublic int getAccessHit()
EvictableEvictable.getAccessHit in interface Evictable<V>Evictablepublic void setAccessHit(int accessHit)
NearCacheRecordEvictable.setAccessHit in interface NearCacheRecord<V>accessHit - the access hit count for this Evictablepublic void incrementAccessHit()
NearCacheRecordEvictable by 1.incrementAccessHit in interface NearCacheRecord<V>public void resetAccessHit()
NearCacheRecordEvictable to 0.resetAccessHit in interface NearCacheRecord<V>public boolean isExpiredAt(long now)
ExpirableReturns true if and only if now > getExpirationTime()
isExpiredAt in interface Expirablenow - time in milliseconds.public boolean isIdleAt(long maxIdleMilliSeconds,
long now)
NearCacheRecordmaxIdleSeconds.isIdleAt in interface NearCacheRecord<V>maxIdleMilliSeconds - maximum idle time in millisecondsnow - current time in millisecondstrue if exceeds max idle seconds, otherwise falsepublic long getRecordState()
getRecordState in interface NearCacheRecord<V>public boolean casRecordState(long expect,
long update)
casRecordState in interface NearCacheRecord<V>expect - expected valueupdate - updated valuetrue if successful. False return indicates that
the actual value was not equal to the expected value.public int getPartitionId()
getPartitionId in interface NearCacheRecord<V>public void setPartitionId(int partitionId)
setPartitionId in interface NearCacheRecord<V>partitionId - the partition ID of this recordpublic long getInvalidationSequence()
getInvalidationSequence in interface NearCacheRecord<V>public void setInvalidationSequence(long sequence)
setInvalidationSequence in interface NearCacheRecord<V>sequence - last known invalidation sequence at time of this records' creationpublic void setUuid(UUID uuid)
setUuid in interface NearCacheRecord<V>uuid - last known UUID of invalidation source at time of this records' creationpublic boolean hasSameUuid(UUID thatUuid)
hasSameUuid in interface NearCacheRecord<V>true if supplied UUID equals existing one, otherwise and when one of supplied
or existing is null returns falseCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.