public class CacheObject<T> extends Object implements Serializable
payload
it stores information on the last fetch time. The reason for this, instead of using
local cache's TTL-based eviction policy, is that we don't want to evict an object; we want to
fetch a new copy without stampede, and, in the meantime, keep returning a stale one.Modifier and Type | Field and Description |
---|---|
private long |
fetchedTime |
private boolean |
isNull |
private T |
object |
private static long |
serialVersionUID |
Constructor and Description |
---|
CacheObject() |
CacheObject(T value) |
Modifier and Type | Method and Description |
---|---|
long |
getFetchedTime() |
T |
getObject() |
boolean |
isNull() |
void |
setFetchedTime(long fetchedTime) |
void |
setFetchedTimeNow() |
void |
setNull() |
void |
setObject(T object) |
private static final long serialVersionUID
private boolean isNull
private long fetchedTime
private T object
public CacheObject(T value)
public CacheObject()
public boolean isNull()
public void setNull()
public long getFetchedTime()
public void setFetchedTimeNow()
public void setFetchedTime(long fetchedTime)
public T getObject()
public void setObject(T object)