Used in: caching-schemes, distributed-scheme, replicated-scheme, optimistic-scheme, near-scheme, versioned-near-scheme, overflow-scheme, read-write-backing-map-scheme, versioned-backing-map-scheme
External schemes define caches which are not JVM heap based, allowing for greater storage capacity. See the local cache samples for examples of various external cache configurations.
This scheme is implemented by:
The implementation type is chosen based on the following rule:
External schemes use a pluggable store manager to store and retrieve binary key value pairs. Supported store managers include:
The cache may be configured as size-limited, which means that once it reaches its maximum allowable size it prunes itself.
|Eviction against disk based caches can be expensive, consider using a paged-external-scheme for such cases.|
External schemes support automatic expiration of entries based on the age of the value, as configured by the expiry-delay.
External caches are generally used for temporary storage of large data sets, for example as the back-tier of an overflow-scheme. Certain implementations do however support persistence for non-clustered caches, see the bdb-store-manager and lh-file-manager for details. Clustered persistence should be configured via a read-write-backing-map-scheme on a distributed-scheme.
The following table describes the elements you can define within the external-scheme element.
|<scheme-name>||Optional||Specifies the scheme's name. The name must be unique within a configuration file.|
|<scheme-ref>||Optional||Specifies the name of another scheme to inherit from.|
|<class-name>||Optional||Specifies a custom implementation of the external cache.
Any custom implementation must extend one of the following classes:
and declare the exact same set of public constructors as the superclass.
|<init-params>||Optional||Specifies initialization parameters, for use in custom external cache implementations which implement the com.tangosol.run.xml.XmlConfigurable interface.|
|<listener>||Optional||Specifies an implementation of a com.tangosol.util.MapListener which will be notified of events occurring on the cache.|
|<high-units>||Optional||Used to limit the size of the cache. Contains the maximum number of units that can be placed in the cache before pruning occurs. An entry is the unit of measurement. Once this limit is exceeded, the cache will begin the pruning process, evicting the least recently used entries until the number of units is brought below this limit. The scheme's class-name element may be used to provide custom extensions to SerializationCache, which implement alternative eviction policies.
Legal values are positive integers or zero. Zero implies no limit.
Default value is zero.
|<expiry-delay>||Optional|| Specifies the amount of time from last update that entries will be kept by the cache before being expired. Entries that are expired will not be accessible and will be evicted.
The value of this element must be in the following format:
where the first non-digits (from left to right) indicate the unit of time duration:
If the value does not contain a unit, a unit of seconds is assumed.
|<async-store-manager>||Optional||Configures the external cache to use an asynchronous storage manager wrapper for any other storage manager.|
|<custom-store-manager>||Optional||Configures the external cache to use a custom storage manager implementation.|
|<bdb-store-manager>||Optional||Configures the external cache to use Berkeley Database JE on-disk databases for cache storage.|
|<lh-file-manager>||Optional||Configures the external cache to use a Coherence LH on-disk database for cache storage.|
|<nio-file-manager>||Optional||Configures the external cache to use a memory-mapped file for cache storage.|
|<nio-memory-manager>||Optional||Configures the external cache to use an off JVM heap, memory region for cache storage.|