Infinispan Expiration: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 6: Line 6:


* [[Infinispan Concepts#Expiration|Infinispan Concepts]]
* [[Infinispan Concepts#Expiration|Infinispan Concepts]]
* [[Infinispan Eviction]]
* [[Infinispan Eviction|Eviction]]


=Overview=
=Overview=


Expiration is the cache feature that allows the user to configure a ''lifespan'' and/or ''maximum idle time'' to cache entries. The entires that exceed these times are treated as invalid and are removed from the cache. When an entry is removed from the cache due to expiration, it is NOT [[Infinispan_Concepts#Passivation|passivated]] (like [[Infinispan Eviction|evicted]] entries when passivation is turned on) but simply discarded.
Expiration is the cache feature that allows the user to configure a ''[[#Lifespan|lifespan]]'' and/or ''[[#Maximum_Idle_Time|maximum idle time]]'' to cache entries. The entires that exceed these times are treated as invalid and are removed from the cache.  


When an entry is removed from the cache due to expiration, it is NOT [[Infinispan_Concepts#Passivation|passivated]] (like [[Infinispan Eviction|evicted]] entries when passivation is turned on) but simply discarded. Also unlike eviction, expired entries are removed globally - from memory, cache stores, and cluster-wide.


If expiration is not explicitly configured or programmed via the API, the entires are by default ''immortal'' and do not have a lifespan or a maximum idle time.


Unlike eviction, expired entries are removed globally - from memory, cache stores, and cluster-wide.
=Lifespan=
By default entries created are immortal and do not have a lifespan or maximum idle time. Using the cache API, mortal entries can be created with lifespans and/or maximum idle times. Further, default lifespans and/or maximum idle times can be configured by adding the <expiration /> element to your <*-cache /> configuration sections.
 
The time interval, in milliseconds, from when a cache entry is created and until when the entry is expired globally. -1 means never expire.
 
=Maximum Idle Time=
 
The time interval, in milliseconds, from when a cache entry was last "touched"  (written or read) and until the entry is expired globally. -1 means the entries never expire.
 
=Interval=
 
The cache entries that expire are purged periodically globally, from memory and stores, by periodic runs that occur at "interval" milliseconds, by default 60,000. To disable periodic expiration process altogether, set the interval to -1. "interval" is a configuration parameter of the [[Infinispan_Cache_Container_Configuration#.3Cexpiration.3E|<expiration>]] configuration element.


=Configuration=
=Configuration=


For more details about expiration, see:
Lifespans and/or maximum idle times can be configured by adding the <expiration/> element to the cache configuration sections. For more details about expiration configuration, see:


<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
:[[Infinispan_Cache_Container_Configuration#.3Cexpiration.3E|Expiration Configuration]]
:[[Infinispan_Cache_Container_Configuration#.3Cexpiration.3E|Expiration Configuration]]
</blockquote>
</blockquote>

Latest revision as of 01:40, 2 December 2016

External

Internal

Overview

Expiration is the cache feature that allows the user to configure a lifespan and/or maximum idle time to cache entries. The entires that exceed these times are treated as invalid and are removed from the cache.

When an entry is removed from the cache due to expiration, it is NOT passivated (like evicted entries when passivation is turned on) but simply discarded. Also unlike eviction, expired entries are removed globally - from memory, cache stores, and cluster-wide.

If expiration is not explicitly configured or programmed via the API, the entires are by default immortal and do not have a lifespan or a maximum idle time.

Lifespan

The time interval, in milliseconds, from when a cache entry is created and until when the entry is expired globally. -1 means never expire.

Maximum Idle Time

The time interval, in milliseconds, from when a cache entry was last "touched" (written or read) and until the entry is expired globally. -1 means the entries never expire.

Interval

The cache entries that expire are purged periodically globally, from memory and stores, by periodic runs that occur at "interval" milliseconds, by default 60,000. To disable periodic expiration process altogether, set the interval to -1. "interval" is a configuration parameter of the <expiration> configuration element.

Configuration

Lifespans and/or maximum idle times can be configured by adding the <expiration/> element to the cache configuration sections. For more details about expiration configuration, see:

Expiration Configuration