Presto Administration : Presto Server Configuration : BigMemory for Caching, Connections and Presto Analytics : Declare BigMemory Stores for Presto Analytics : Declare a New In-Memory Store
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 Presto.
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 Presto 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 presto-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 Presto, 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 the name, datatype and extractor class for each property in these Java objects that will contain data.
See Dataset Paths, Names and Datatypes and Valid RAQL Datatypes for more information on names and datatypes.
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:  
Search attributes are required for datasets stored by external systems. If the dataset is stored using RAQL, search attributes are created automatically.
Searchable columns allow Presto Analytics to access data in Java objects. They also allow Presto Analytics to delegate filtering and sorting to BigMemory which provides better performance.
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 presto-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 Presto is presto-install/apache-tomee-jaxrs/pretso/WEB-INF/lib. If Presto is deployed in a cluster, however, this location may be a separate external folder. For more information, see Setting Up an External Presto Configuration Folder.
3. Restart the Presto Server. For instructions, see Start and Stop the Presto Server.
4. Click Admin Console in the Presto 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 Presto 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 Presto 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 Presto to this resource.
Note:  
Administrators can also manage resources files in the Admin Console. See Manage Files for Presto Features or Artifacts for more information.
Copyright © 2006-2015 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback