T - the data object type.public class CachedEntity<T> extends Object
Clock to control the elapsed time calculation.| Constructor and Description |
|---|
CachedEntity(TimeUnit expiryTimeUnit,
long expiryLength) |
CachedEntity(TimeUnit expiryTimeUnit,
long expiryLength,
org.apache.hadoop.yarn.util.Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
void |
enforceExpiration()
Enforces the expiration of the cached entry.
|
T |
getValue()
If the entry has expired, it reset the cache reference through
clearExpiredEntry(). |
boolean |
isExpired() |
void |
setValue(T newEntry)
Safely sets the cached data.
|
public CachedEntity(TimeUnit expiryTimeUnit, long expiryLength, org.apache.hadoop.yarn.util.Clock clock)
public CachedEntity(TimeUnit expiryTimeUnit, long expiryLength)
public boolean isExpired()
expiryDurationMSpublic T getValue()
clearExpiredEntry().public void setValue(T newEntry)
newEntry - public void enforceExpiration()
Copyright © 2022 Apache Software Foundation. All rights reserved.