Developing Apama Applications > Developing Apama Applications in EPL > Using Correlator Plug-ins in EPL > Using the MemoryStore > Using the distributed MemoryStore > Configuration files for distributed stores > BigMemory Max driver specific details
BigMemory Max driver specific details
Apama Studio can create configuration files for BigMemory Max; the BigMemory Max installation directory (where the zip files were unpacked) needs to be specified as the providerDir property.
The .properties file for a distributed store contains an option for choosing consistency. The options are STRONG or EVENTUAL consistency. See the BigMemory Max documentation for the trade-offs between these two modes.
Use the storeName-spring.properties file to set configuration properties for the BigMemory Max driver. Documentation is available here: http://terracotta.org/files/documentation/Terracotta-Documentation-4.0.pdf
Using off-heap storage requires setting -XX:MaxDirectMemorySize=. Specify this in the command line for starting the correlator as -J-XX:MaxDirectMemorySize=. See the documentation http://terracotta.org/files/documentation/Terracotta-Documentation-4.0.pdf for recommendations for specifying the value of this property. In Apama Studio, when you add a correlator to a correlator launch configuration you can select the Maximum java off-heap storage in Mb option. See Correlator arguments.
You can set the following BigMemory Max driver properties in the -spring.xml configuration file. Alternatively, you can specify many of these properties in an ehcache.xml configuration file and then specify the path for that file in the -spring.xmlconfiguration file using the ehcacheConfigFile. If this is done, many of the properties in the spring.xml configuration file will be ignored; the settings derived from the ehcache.xml file will be used instead. Refer to the BigMemory Max documentation if using an ehcache.xml file.
Property Name
Type
Description
cache
Configuration
EHCache
CacheConfiguration
bean, shared by all caches (Tables). Typically used as a compound bean name, for example, cacheConfiguration. overflowToOffHeap.
cacheDecorator
Factory
String
Name of a class to use as a cacheDecoratorFactory. The named class must be on the classpath and must implement EHCache's CacheDecoratorFactory interface.
cacheDecorator
FactoryProperties
Properties
Properties to pass to a cacheDecoratorFactory. Allows use of the same class for many caches.
clusterName
String
Comma-separated list of host:port identifiers for the servers, or a tc-config.xml file name. Best practice is to list all Terracotta Server Array (TSA) nodes.
configuration
EHCache Configuration bean. Typically used as a compound bean name, for example, configuration.monitoring.
maxMBLocal
OffHeap
long
Number of MB of local off-heap data. Total across all tables, per correlator process.
pinning
String
Either an attribute value of "inCache" (default) or "localMemory" or a <null/> XML element (i.e.<property name="pinning"><null/></property>.) Pinning prevents eviction if the cache size exceeds the configured maximum size. Recommended if the cache is being used as a system of record
terracotta
Configuration
EHCache TerracottaConfiguration bean. Typically used as a compound bean name, for example, terracottaConfiguration. consistency.
ehcache
ConfigFile
String
Path to an ehcache.xml configuration file. Note that if this is specified, any other properties listed in this table will be ignored.
You can set the following BigMemory Max driver properties in the spring.xml configuration file, but not in the ehcache.xml configuration file as they modify how the driver accesses the BigMemory Max Cache.
Property Name
Type
Description
backupCopies
int
Ignored. Not supported. The number of backups is governed by the TSA topology defined in tc-config.xml used to configure the TSA nodes.
initialMin
ClusterSize
int
The minimum cluster size (number of correlators) that must be connected for prepare to finish.
logLevel
String
The log level.
rowChangedOld
ValueRequired
boolean
Whether to expose old values in rowChanged events. Must be set to false.
useCompare
AndSwap
boolean
Whether to use compare and swap (CaS) operations or just put/remove. Some versions of BigMemory Max support only CaS in
Strong
consistency.
useCompare
AndSwapMap
Map(String,
Boolean)
Per-table (cache) configuration for whether to use CaS or put/remove.
The following compound properties are also exposed in the .properties file, or set by default in the spring.xmlconfiguration file:
Property Name
Type
Notes
cacheConfiguration.
eternal
boolean
Disables expiration (removing old, unused values) of entries if true. Set to true in the default spring.xml configuration file.
cacheConfiguration.
maxEntriesLocalHeap
int
The number of entries for each table.
This is the maxEntriesLocalHeap entry in the .properties file.
cacheConfiguration.
overflowToOffHeap
boolean
Whether to use off-heap storage. For scenarios where data is fast changing and being written from multiple correlators, the cache may perform better if this is disabled.
This is the cacheConfiguration.overflowToOffHeap entry in the .properties file.
pinning
String
Set to inCache by default.
terracotta
Configuration.
localCacheEnabled
boolean
Whether to cache entries in the correlator process. Set to true in the default spring.xml configuration file.
terracotta
Configuration.
clustered
boolean
Whether to use a TSA. Set to true in the default spring.xml configuration file.
terracotta
Configuration.
consistency
String
Either 'STRONG' or 'EVENTUAL'. STRONG gives MemoryStore-like guarantees, while EVENTUAL is faster but may have stale values read.
This is the terracottaConfiguration.consistency entry in the .properties file.
terracotta
Configuration.
synchronousWrites
boolean
If true, then data is guaranteed to be out of process by the time a Row.commit() action completes. Disabling this can increase speed.
This is the terracottaConfiguration.synchronousWrites entry in the .properties file.
Note the following when using the BigMemory Max driver:
For reference, the following table maps Apama MemoryStore terminology to BigMemory Max classes; this may be useful when referring to the BigMemory Max documentation:
MemoryStore Event Object
BigMemory Max Class
Store
CacheManager
Table
Cache
Row
Element
In a cluster, if one correlator calls subscribeRowChanged() for a given MemoryStore table, then all correlators in that cluster that modify the entries in that table must also call subscribeRowChanged() on that table even if they do not consume the events.
Iterating over a table may require pulling the entire table into memory. It may fail if the table is being modified.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.