public final class ExpirationTimeSetter extends Object
Modifier and Type | Method and Description |
---|---|
static long |
calculateExpirationWithDelay(long timeInMillis,
long delayMillis,
boolean backup)
On backup partitions, this method delays key's expiration.
|
static long |
getIdlenessStartTime(Record record)
Returns last-access-time of an entry if it was accessed before, otherwise it returns creation-time of the entry.
|
static long |
getLifeStartTime(Record record)
Returns last-update-time of an entry if it was updated before, otherwise it returns creation-time of the entry.
|
static void |
setExpirationTime(Record record)
Sets expiration time if statistics are enabled.
|
static void |
setExpirationTimes(long operationTTLMillis,
long operationMaxIdleMillis,
Record record,
MapConfig mapConfig,
boolean consultMapConfig)
Updates records TTL and expiration time.
|
public static void setExpirationTime(Record record)
public static long getIdlenessStartTime(Record record)
IMap.put(K, V)
, the lastAccessTime
is zero till the first access.
Any subsequent get or update operation after first put will increase the lastAccessTime
.public static long getLifeStartTime(Record record)
IMap.put(K, V)
, the lastUpdateTime
is zero till the first update.public static void setExpirationTimes(long operationTTLMillis, long operationMaxIdleMillis, Record record, MapConfig mapConfig, boolean consultMapConfig)
operationTTLMillis
- user provided TTL during operation call like put with TTLrecord
- record to be updatedmapConfig
- map config objectconsultMapConfig
- give true
if this update should consult map ttl configuration,
otherwise give false
to indicate updatepublic static long calculateExpirationWithDelay(long timeInMillis, long delayMillis, boolean backup)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.