Questo contenuto non è disponibile nella lingua selezionata.
19.2. Cache Store Configuration Details (Library Mode)
- The
passivationparameter affects the way in which Red Hat JBoss Data Grid interacts with stores. When an object is evicted from in-memory cache, passivation writes it to a secondary data store, such as a system or a database. Valid values for this parameter aretrueandfalsebutpassivationis set tofalseby default.
- The
sharedparameter indicates that the cache store is shared by different cache instances. For example, where all instances in a cluster use the same JDBC settings to talk to the same remote, shared database.sharedisfalseby default. When set totrue, it prevents duplicate data being written to the cache store by different cache instances. For the LevelDB cache stores, this parameter must be excluded from the configuration, or set tofalsebecause sharing this cache store is not supported. - The
preloadparameter is set tofalseby default. When set totruethe data stored in the cache store is preloaded into the memory when the cache starts. This allows data in the cache store to be available immediately after startup and avoids cache operations delays as a result of loading data lazily. Preloaded data is only stored locally on the node, and there is no replication or distribution of the preloaded data. Red Hat JBoss Data Grid will only preload up to the maximum configured number of entries in eviction. - The
fetch-stateparameter determines whether or not to fetch the persistent state of a cache and apply it to the local cache store when joining the cluster. If the cache store is shared the fetch persistent state is ignored, as caches access the same cache store. A configuration exception will be thrown when starting the cache service if more than one cache store has this property set totrue. Thefetch-stateproperty isfalseby default. - In order to speed up lookups, the single file cache store keeps an index of keys and their corresponding position in the file. To avoid this index resulting in memory consumption problems, this cache store can be bounded by a maximum number of entries that it stores, defined by the
max-entriesparameter. If this limit is exceeded, entries are removed permanently using the LRU algorithm both from the in-memory index and the underlying file based cache store. The default value is-1, allowing unlimited entries. - The
singletonparameter enables a singleton store cache store. SingletonStore is a delegating cache store used when only one instance in a cluster can interact with the underlying store; however,singletonparameter is not recommended forfile-store. The default value isfalse. - The
purgeparameter controls whether cache store is purged when it starts up. - The
locationconfiguration element sets a location on disk where the store can write.
The write-behind element contains parameters that configure various aspects of the cache store.
- The
thread-pool-sizeparameter specifies the number of threads that concurrently apply modifications to the store. The default value for this parameter is1. - The
flush-lock-timeoutparameter specifies the time to acquire the lock which guards the state to be flushed to the cache store periodically. The default value for this parameter is1. - The
modification-queue-sizeparameter specifies the size of the modification queue for the asynchronous store. If updates are made at a rate that is faster than the underlying cache store can process this queue, then the asynchronous store behaves like a synchronous store for that period, blocking until the queue can accept more elements. The default value for this parameter is1024elements. - The
shutdown-timeoutparameter specifies maximum amount of time that can be taken to stop the cache store. Default value for this parameter is25000milliseconds.
- The
cacheattribute specifies the name of the remote cache to which it intends to connect in the remote Infinispan cluster. The default cache will be used if the remote cache name is unspecified. - The
fetch-stateattribute, when set totrue, ensures that the persistent state is fetched when the remote cache joins the cluster. If multiple cache stores are chained, only one cache store can have this property set totrue. The default for this value isfalse. - The
sharedattribute is set totruewhen multiple cache instances share a cache store, which prevents multiple cache instances writing the same modification individually. The default for this attribute isfalse. - The
preloadattribute ensures that the cache store data is pre-loaded into memory and is immediately accessible after starting up. The disadvantage of setting this totrueis that the start up time increases. The default value for this attribute isfalse. - The
singletonparameter enables the SingletonStore delegating cache store, used in situations when only one instance in a cluster should interact with the underlying store. The default value isfalse. - The
purgeattribute ensures that the cache store is purged during the start up process. The default value for this attribute isfalse. - The
tcp-no-delayattribute triggers theTCPNODELAYstack. The default value for this attribute istrue. - The
ping-on-startattribute sends a ping request to a back end server to fetch the cluster topology. The default value for this attribute istrue. - The
key-size-estimateattribute provides an estimation of the key size. The default value for this attribute is64. - The
value-size-estimateattribute specifies the size of the byte buffers when serializing and deserializing values. The default value for this attribute is512. - The
force-return-valuesattribute sets whetherFORCE_RETURN_VALUEis enabled for all calls. The default value for this attribute isfalse.
Create a remote-server element within the remote-store element to define the server information.
- The
hostattribute configures the host address. - The
portattribute configures the port used by the Remote Cache Store. This defaults to11222.
- The
max-activeparameter indicates the maximum number of active connections for each server at a time. The default value for this attribute is-1which indicates an infinite number of active connections. - The
max-idleparameter indicates the maximum number of idle connections for each server at a time. The default value for this attribute is-1which indicates an infinite number of idle connections. - The
max-totalparameter indicates the maximum number of persistent connections within the combined set of servers. The default setting for this attribute is-1which indicates an infinite number of connections. - The
min-idle-timeparameter sets a target value for the minimum number of idle connections (per server) that should always be available. If this parameter is set to a positive number andtimeBetweenEvictionRunsMillis> 0, each time the idle connection eviction thread runs, it will try to create enough idle instances so that there will beminIdleidle instances available for each server. The default setting for this parameter is1. - The
eviction-intervalparameter indicates how long the eviction thread should sleep before "runs" of examining idle connections. When non-positive, no eviction thread will be launched. The default setting for this parameter is120000milliseconds, or 2 minutes. - The
min-evictable-idle-timeparameter specifies the minimum amount of time that an connection may sit idle in the pool before it is eligible for eviction due to idle time. When non-positive, no connection will be dropped from the pool due to idle time alone. This setting has no effect unlesstimeBetweenEvictionRunsMillis> 0. The default setting for this parameter is1800000, or (30 minutes). - The
test-idleparameter indicates whether or not idle connections should be validated by sending an TCP packet to the server, during idle connection eviction runs. Connections that fail to validate will be dropped from the pool. This setting has no effect unlesstimeBetweenEvictionRunsMillis> 0. The default setting for this parameter istrue.
- The
relative-toparameter specifies the base directory in which to store the cache state. - The
pathparameter specifies the location within therelative-toparameter to store the cache state. - The
sharedparameter specifies whether the cache store is shared. The only supported value for this parameter in the LevelDB cache store isfalse. - The
preloadparameter specifies whether the cache store will be pre-loaded. Valid values aretrueandfalse. - The
block-sizeparameter defines the block size of the cache store. - The
singletonparameter enables the SingletonStore delegating cache store, used in situations when only one instance in a cluster should interact with the underlying store. The default value isfalse. - The
cache-sizeparameter defines the cache size of the cache store. - The
clear-thresholdparameter defines the cache clear threshold of the cache store.
- The
persistence-unitattribute specifies the name of the JPA cache store. - The
entity-classattribute specifies the fully qualified class name of the JPA entity used to store the cache entry value. - The
batch-size(optional) attribute specifies the batch size for cache store streaming. The default value for this attribute is100. - The
store-metadata(optional) attribute specifies whether the cache store keeps the metadata (for example expiration and versioning information) with the entries. The default value for this attribute istrue. - The
singletonparameter enables the SingletonStore delegating cache store, used in situations when only one instance in a cluster should interact with the underlying store. The default value isfalse.
- The
fetch-stateparameter determines whether the persistent state is fetched when joining a cluster. Set this totrueif using a replication and invalidation in a clustered environment. Additionally, if multiple cache stores are chained, only one cache store can have this property enabled. If a shared cache store is used, the cache does not allow a persistent state transfer despite this property being set totrue. Thefetch-stateparameter isfalseby default. - The
singletonparameter enables the SingletonStore delegating cache store, used in situations when only one instance in a cluster should interact with the underlying store. The default value isfalse. - The
purgeparameter specifies whether the cache store is purged when initially started. - The
key-to-string-mapperparameter specifies the class name used to map keys to strings for the database tables.
- The
connection-urlparameter specifies the JDBC driver-specific connection URL. - The
usernameparameter contains the username used to connect via theconnection-url. - The
passwordparameter contains the password to use when connecting via theconnection-url - The
driverparameter specifies the class name of the driver used to connect to the database.
- The
prefixattribute defines the string prepended to name of the target cache when composing the name of the cache bucket table. - The
drop-on-exitparameter specifies whether the database tables are dropped upon shutdown. - The
create-on-startparameter specifies whether the database tables are created by the store on startup. - The
fetch-sizeparameter specifies the size to use when querying from this table. Use this parameter to avoid heap memory exhaustion when the query is large. - The
batch-sizeparameter specifies the batch size used when modifying this table.
- The
nameparameter specifies the name of the column used. - The
typeparameter specifies the type of the column used.
- The
classparameter specifies the class name of the cache store implementation. - The
preloadparameter specifies whether to load entries into the cache during start up. Valid values for this parameter aretrueandfalse. - The
sharedparameter specifies whether the cache store is shared. This is used when multiple cache instances share a cache store. Valid values for this parameter aretrueandfalse.
A property may be defined inside of a cache store, with the entry between the property tags being the stored value. For instance, in the below example a value of 1 is defined for minOccurs.
<property name="minOccurs">1</property>
<property name="minOccurs">1</property>
- The
nameattribute specifies the name of the property.