Used in: caching-schemes.
The near-scheme defines a two tier cache consisting of a front-tier which caches a subset of a back-tier cache. The front-tier is generally a fast, size limited cache, while the back-tier is slower, but much higher capacity. A typical deployment might use a local-scheme for the front-tier, and a distributed-scheme for the back-tier. The result is that a portion of a large partitioned cache will be cached locally in-memory allowing for very fast read access. See the services overview for a more detailed description of near caches.
The near scheme is implemented by the com.tangosol.net.cache.NearCache class.
Specifying an invalidation-strategy defines a strategy that is used to keep the front tier of the near cache in sync with the back tier. Depending on that strategy a near cache is configured to listen to certain events occurring on the back tier and automatically update (or invalidate) the front portion of the near cache.
The following table describes the elements you can define within the near-scheme element.
Element | Required/Optional | Description |
---|---|---|
<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 near cache.
Any custom implementation must extend the com.tangosol.net.cache.NearCache class and declare the exact same set of public constructors. |
<init-params> | Optional | Specifies initialization parameters, for use in custom near 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. |
<front-scheme> | Required | Specifies the cache-scheme to use in creating the front-tier cache.
Legal values are: The eviction policy of the front-scheme defines which entries will be cached locally. <front-scheme> <local-scheme> <eviction-policy>HYBRID</eviction-policy> <high-units>1000</high-units> </local-scheme> </front-scheme> |
<back-scheme> | Required | Specifies the cache-scheme to use in creating the back-tier cache. Legal values are: For example: <back-scheme> <distributed-scheme> <scheme-ref>default-distributed</scheme-ref> </distributed-scheme> </back-scheme> |
<invalidation-strategy> | Optional | Specifies the strategy used keep the front-tier in-sync with the back-tier. Please see com.tangosol.net.cache.NearCache for more details. Legal values are:
|
<autostart> | Optional | The autostart element is intended to be used by cache servers (i.e. com.tangosol.net.DefaultCacheServer). It specifies whether or not the cache services associated with this cache scheme should be automatically started at a cluster node.
Legal values are true or false. Default value is false. |