|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.esper.eql.db.DataCacheExpiringImpl
public class DataCacheExpiringImpl
Implements an expiry-time cache that evicts data when data becomes stale after a given number of seconds.
Constructor Summary | |
---|---|
DataCacheExpiringImpl(double maxAgeSec,
double purgeIntervalSec,
SchedulingService schedulingService,
ScheduleSlot scheduleSlot,
EPStatementHandle epStatementHandle)
Ctor. |
Method Summary | |
---|---|
List<EventBean> |
getCached(Object[] lookupKeys)
Ask the cache if the keyed value is cached, returning a list or rows if the key is in the cache, or returning null to indicate no such key cached. |
protected long |
getMaxAgeMSec()
Returns the maximum age in milliseconds. |
protected long |
getPurgeIntervalMSec()
Returns the purge interval in milliseconds. |
protected long |
getSize()
Returns the current cache size. |
void |
put(Object[] lookupKeys,
List<EventBean> rows)
Puts into the cache a key and a list of rows, or an empty list if zero rows. |
void |
scheduledTrigger()
Callback that is invoked as indicated by a schedule added to the scheduling service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataCacheExpiringImpl(double maxAgeSec, double purgeIntervalSec, SchedulingService schedulingService, ScheduleSlot scheduleSlot, EPStatementHandle epStatementHandle)
maxAgeSec
- is the maximum age in secondspurgeIntervalSec
- is the purge interval in secondsschedulingService
- is a service for call backs at a scheduled time, for purgingscheduleSlot
- slot for scheduling callbacks for this cacheepStatementHandle
- is the statements-own handle for use in registering callbacks with servicesMethod Detail |
---|
public List<EventBean> getCached(Object[] lookupKeys)
DataCache
getCached
in interface DataCache
lookupKeys
- is the keys to look up in the cache
public void put(Object[] lookupKeys, List<EventBean> rows)
DataCache
The put method is designed to be called when the cache does not contain a key as determined by the get method. Implementations typically simply overwrite any keys put into the cache that already existed in the cache.
put
in interface DataCache
lookupKeys
- is the keys to the cache entryrows
- is a number of rowsprotected long getMaxAgeMSec()
protected long getPurgeIntervalMSec()
protected long getSize()
public void scheduledTrigger()
ScheduleHandleCallback
scheduledTrigger
in interface ScheduleHandleCallback
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |