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 |
calculateMaxIdleMillis(MapConfig mapConfig) |
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,
long maxIdleMillis)
Sets expiration time if statistics are enabled.
|
static void |
setTTLAndUpdateExpiryTime(long operationTTLMillis,
Record record,
MapConfig mapConfig,
boolean entryCreated)
Updates records TTL and expiration time.
|
public static void setExpirationTime(Record record, long maxIdleMillis)
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 long calculateMaxIdleMillis(MapConfig mapConfig)
public static void setTTLAndUpdateExpiryTime(long operationTTLMillis, Record record, MapConfig mapConfig, boolean entryCreated)
operationTTLMillis
- user provided TTL during operation call like put with TTLrecord
- record to be updatedmapConfig
- map config objectentryCreated
- give true
if this is the first creation of entry,
otherwise give false
to indicate updatepublic static long calculateExpirationWithDelay(long timeInMillis, long delayMillis, boolean backup)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.