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 |
calculateTTLMillis(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 long |
pickTTL(long ttlMillis,
long ttlMillisFromConfig)
Picks right TTL value.
|
static void |
setExpirationTime(Record record,
long maxIdleMillis)
Sets expiration time if statistics are enabled.
|
static void |
updateExpiryTime(Record record,
long ttl,
MapConfig mapConfig)
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 pickTTL(long ttlMillis, long ttlMillisFromConfig)
public static long calculateMaxIdleMillis(MapConfig mapConfig)
public static long calculateTTLMillis(MapConfig mapConfig)
public static void updateExpiryTime(Record record, long ttl, MapConfig mapConfig)
public static long calculateExpirationWithDelay(long timeInMillis, long delayMillis, boolean backup)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.