Declare a New In-Memory Store
1. Define configuration for one or more In-Memory Stores in a cache configuration file for BigMemory (an ehcache.xml file).
Tip: | It is a best practice to change the default file name ehcache.xml for this configuration file to something more meaningful, such as myCRM-cache.xml. This makes it easier to identify when multiple configuration files are uploaded to MashZone NextGen. |
a. Add a name attribute to the <ehcache> element and assign a unique name.
This is the cache manager name which must be unique for this MashZone NextGen Server. It should consist solely of letters, numbers, underscores(_) or dashes (-).
b. Add a <cache> element for each store you need to declare. The following example shows some common properties. See BigMemory documentation for more information. Note: | You can find this example configuration file, sample-cache.xml, for declared stores in the MashZoneNG-install/prestocli/raql-samples folder. |
<ehcache name="sample-cache" >
<diskStore path="java.io.tmpdir"/>
...
<cache name="StocksDeclCache"
maxBytesLocalHeap="50M"
memoryStoreEvictionPolicy="LRU"
timeToIdleSeconds="0"
timeToLiveSeconds="0">
</cache>
...
</ehcache>
c. If this In-Memory Store will be created and populated by MashZone NextGen, add a <searchable allowDynamicIndexing="true"> element to <cache> to support dynamic searching.
For example:
<ehcache name="sample-cache" >
<diskStore path="java.io.tmpdir"/>
...
<cache name="StocksDeclCache"
maxBytesLocalHeap="50M"
memoryStoreEvictionPolicy="LRU"
timeToIdleSeconds="0"
timeToLiveSeconds="0">
<searchable allowDynamicIndexing="true"/>
</cache>
...
</ehcache>
d. If this In-Memory Store will be populated by external systems with datasets that are Java objects, add <searchable> to the <cache> element and define a <searchAttribute> with the name, datatype and extractor class for each property in these Java objects that will contain data.
For the
class attribute, use the
net.sf.ehcache.search.AttributeExtractor interface provided in the
BigMemory Search API or an implementation class of
AttributeExtractor. See
BigMemory documentation for details.
Important: | MashZone NextGen is only able to access searchable attributes of datasets stored by external systems. For Apama used as external system, search attributes are no more required. If search attributes are not explicitly specified and the dataset is stored using RAQL, all attributes are made searchable automatically. |
Since version 9.9 MashZone NextGen supports the native Apama RowValue format. MashZone NextGen can consume RowValues stored by Apama and convert them into the RAQL record format. In case of caches written by Apama searchable attributes are no more needed for accessing the data at all but they are still required for processing filters, aggregations and sorting directly in BigMemory.
e. Save this file.
2. Copy the JAR file containing the classes used as search attributes to extract data from the dataset in this cache to MashZoneNG-config/lib.
See documentation for the external system that created this dynamic store to determine what JAR files are needed. For Apama, see documentation on the MemoryStore.
The default location for this folder in
MashZone NextGen is
MashZoneNG-install/apache-tomcat/mashzone/WEB-INF/lib. If
MashZone NextGen is deployed in a cluster, however, this location may be a separate external folder. For more information, see
Setting Up an External
MashZone NextGen
Configuration Folder.
4. Click Admin Console in the MashZone NextGen Hub main menu. 5. Click Server to expand this section of the Administration menu.
6. Click BigMemory.
7. Open the BigMemory Cache tap.
The Big Memory Cache tab lists any In-Memory Store configuration files that have already been upload.
8. Click Register a new EhCache Configuration File.
9. Enter the name assigned to <ehcache> in this configuration file (in step 1) as the Big Memory Data Source Name. This name is used as a prefix for all stores defined in this configuration file to uniquely identify each store.
Important: | Data source names must be unique for this MashZone NextGen Server. They should contain only letters, numbers, underscores (_) or dashes (-). If any of the declared In-Memory Stores for this connection have data populated by external systems (not through <storeto>), the data source name must also match the name assigned to the <ehcache> element in the configuration file. |
10. Click Browse to find and select the Cache Configuration File ehcache.xml you created in step 1.
11. Click Add this file.
The file is uploaded to the MashZone NextGen Repository in the standard path bigmemory/caches/file-name and shown in the list by data source name. The URL shown is the relative path in MashZone NextGen to this resource.