near-scheme
Used in: caching-schemes.
Description
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, and the near cache sample for an example of a near cache configurations.
Implementation
The near scheme is implemented by the ${xhtml} class.
Front-tier Invalidation
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.
Elements
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 ${xhtml} 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 ${xhtml} (or ${xhtml} for C++) interface. |
| <listener> | Optional | Specifies an implementation of a ${xhtml} (or ${xhtml} for C++) 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. |
| <back-scheme> | Required | Specifies the cache-scheme to use in creating the back-tier cache. Legal values are: For example: |
| <invalidation-strategy> | Optional | Specifies the strategy used keep the front-tier in-sync with the back-tier. Please see ${xhtml} for more details. Legal values are:
|
| <autostart> | Optional | The autostart element is intended to be used by cache servers (that is,
${xhtml}). 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. |