/** * Increment statistic associated with a hit on this cache. * * @param e element deserialized from disk */ void hit(Element e) { hitCount++; expiry = e.getExpirationTime(); }
/** * Updates the stats from memory * @param e */ void updateStats(Element e) { hitCount = e.getHitCount(); expiry = e.getExpirationTime(); } }
@Override long getExpirationTime() { return getElement().getExpirationTime(); }
/** * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past. * * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is * considered not able to expire. * @see #getExpirationTime() */ public boolean isExpired() { if (!isLifespanSet() || isEternal()) { return false; } long now = getCurrentTime(); long expirationTime = getExpirationTime(); return now > expirationTime; }
/** * Create a new marker tied to the given factory instance. * * @param factory factory responsible for this marker * @param position position on disk where the element will be stored * @param size size of the serialized element * @param element element being stored */ DiskMarker(DiskStorageFactory factory, long position, int size, Element element) { super(factory); this.position = position; this.size = size; this.key = element.getObjectKey(); this.hitCount = element.getHitCount(); this.expiry = TimeUtil.toMillis(TimeUtil.toSecs(element.getExpirationTime())); }
/** * Increment statistic associated with a hit on this cache. * * @param e element deserialized from disk */ void hit(Element e) { hitCount++; expiry = e.getExpirationTime(); }
/** * Increment statistic associated with a hit on this cache. * * @param e element deserialized from disk */ void hit(Element e) { hitCount++; expiry = e.getExpirationTime(); } }
/** * Increment statistic associated with a hit on this cache. * * @param e element deserialized from disk */ void hit(Element e) { hitCount++; expiry = e.getExpirationTime(); }
@Override public String getMetaData(Element element) { if (Long.MAX_VALUE == element.getExpirationTime()) { return ""; } return formatTimestamp(element.getExpirationTime()); }},
/** * Updates the stats from memory * @param e */ void updateStats(Element e) { hitCount = e.getHitCount(); expiry = e.getExpirationTime(); } }
/** * Updates the stats from memory * @param e */ void updateStats(Element e) { hitCount = e.getHitCount(); expiry = e.getExpirationTime(); } }
@Override long getExpirationTime() { return getElement().getExpirationTime(); }
@Override long getExpirationTime() { return getElement().getExpirationTime(); }
@Override long getExpirationTime() { return getElement().getExpirationTime(); }
private void updateExpireTime(Object key, Element value) { // Only need to put into the timestamp map only when the invalidator thread // will be active if (isInvalidatorRunning()) { int storeIndex = getStoreIndex(key); dtmStore[storeIndex].put(key, new Long(value.getExpirationTime())); } }
/** * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past. * * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is * considered not able to expire. * @see #getExpirationTime() */ public boolean isExpired() { if (!isLifespanSet() || isEternal()) { return false; } long now = System.currentTimeMillis(); long expirationTime = getExpirationTime(); return now > expirationTime; }
/** * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past. * * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is * considered not able to expire. * @see #getExpirationTime() */ public boolean isExpired() { if (!isLifespanSet() || isEternal()) { return false; } long now = getCurrentTime(); long expirationTime = getExpirationTime(); return now > expirationTime; }
/** * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past. * * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is * considered not able to expire. * @see #getExpirationTime() */ public boolean isExpired() { if (!isLifespanSet() || isEternal()) { return false; } long now = getCurrentTime(); long expirationTime = getExpirationTime(); return now > expirationTime; }
/** * Create a new marker tied to the given factory instance. * * @param factory factory responsible for this marker * @param position position on disk where the element will be stored * @param size size of the serialized element * @param element element being stored */ DiskMarker(DiskStorageFactory factory, long position, int size, Element element) { super(factory); this.position = position; this.size = size; this.key = element.getObjectKey(); this.hitCount = element.getHitCount(); this.expiry = TimeUtil.toMillis(TimeUtil.toSecs(element.getExpirationTime())); }
/** * Create a new marker tied to the given factory instance. * * @param factory factory responsible for this marker * @param position position on disk where the element will be stored * @param size size of the serialized element * @param element element being stored */ DiskMarker(DiskStorageFactory factory, long position, int size, Element element) { super(factory); this.position = position; this.size = size; this.key = element.getObjectKey(); this.hitCount = element.getHitCount(); this.expiry = TimeUtil.toMillis(TimeUtil.toSecs(element.getExpirationTime())); }