To use Virtual Data Window in order to use a Terracotta cache (known as Ehcache), you must place an Ehcache configuration file (ehcache.xml) on the CEP Server. Place the Ehcache configuration file in the following location:
/etc/opt/FJSVcep/config/ehcache.xml
Refer to the Terracotta manual for information on the Ehcache configuration file. The table below explains the settings required for Terracotta Collaboration.
Element or attribute | Description | |||||
---|---|---|---|---|---|---|
ehcache | Root element of the configuration file. | |||||
name | Specify the name of the cache manager specified when creating the cache. | |||||
maxBytesLocalHeap | Size of the data pool to be used. | |||||
terracottaConfig | Element for defining a Terracotta server. | |||||
url | List of Terracotta servers in the format "hostNameOrIpAddress:portNumber", delimited with a comma (,). | |||||
cache | Element for defining a cache. Multiple <cache> elements can be specified in a single <ehcache> element. | |||||
name | Name of the cache. This is the cache name specified using vdw:ehcache. | |||||
terracotta | Defined for using a Terracotta server. | |||||
nonstop | Defined for use as a nonstop cache. | |||||
immediateTimeout | Specify whether to respond with a timeout when a network disconnection is detected. Specify "true" as the value. | |||||
timeoutMillis | Specify the standby time until timeout. | |||||
timeoutBehavior | Specify the operation to be performed if a timeout occurs. | |||||
type | Specify "exception" as the value. | |||||
searchable | Defined for searching a cache. |
Example
The following example uses the cache "Cache001" configured on two Terracotta servers (192.168.1.1 and 192.168.1.2) using Terracotta collaboration:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"
name="SearchConfig"
maxBytesLocalHeap="64M">
<terracottaConfig url="192.168.1.1:9510,192.168.1.2:9510"/>
<cache name="Cache001">
<terracotta>
<nonstop immediateTimeout="true" timeoutMillis="3000">
<timeoutBehavior type="exception"/>
</nonstop>
</terracotta>
<searchable />
</cache>
</ehcache>
Note
If you edit the file while the CEP engine is running, you must restart the CEP engine to enable the contents.