|
Configuring the CacheLoader - CacheLifeCycleManagerThe CacheLifeCycleManager provides ability to control the lifecycle of the CacheLoader and CacheStore implementation. The CacheLoader is configured in space schema XML configuration file as a persistent adapter. The Entity-Class Settingwhen using the Map API users should define the table name (called also Entity) to use when reading value object data. Central Data SourceRecovery should be set to false in cluster-xml when working with central-data-source since the Entries are already in the database and there is no need to recover them from a backup space. Central Data Source with Partitioned SpaceWhen running in partition space cluster topology each partition may use the same database server instance to store its data. Class MappingCacheLifeCycleManager.init should introduce to the space the Directory which holds the domain classes gs.xml. Inheritance (Sub-Classes) SupportIf the underlying data source supports sub-class query, like Hibernate, the CacheLoader will invoke a call to loadAll/load only once for the queried super class. Otherwise CacheLoader.loadAll/load will be called for the super class and each of its sub-classes. Cache Preload and Refresh AheadThe user can load data into the space when started or pre-fetch "extra" to speed up future queries. The Space Mapping Configuration File gs.xmlYou can define space class meta data using class and field level decorations. These can be defined via Annotations and XML space class mapping configuration files.
Space ClasspathThe space classpath includes user classes and gs.xml files that are loaded as resources. The following table shows when these are used and where they should be located.
TroubleshootingTo enable logging for CacheLoader\Store, edit the <GigaSpaces Root>\config\gs_logging.properties file and set the persistent level to CONFIG or FINER.
com.gigaspaces.persistent.level = CONFIG for example: +_CONFIG: schema-xml configuration: <persistent> <CacheLoaderClass>com.gigaspaces.hibernate.HibernateCacheStoreImpl</CacheLoaderClass> <StorageAdapterClass>com.j_spaces.sadapter.cache.CacheAdapter</StorageAdapterClass> <entity-class>com.gigaspaces.test.cacheloader.PersonPojo</entity-class> </persistent> cluster-xml configuration: <cache-loader> <external-data-source>false</external-data-source> <central-data-source>false</central-data-source> </cache-loader> _
com.gigaspaces.persistent.level = FINER For example: _Jul 3, 2006 4:13:16 PM com.j_spaces.sadapter.cache.CacheStorage CacheLoader#load FINER: ENTRY IGSEntry<com.gigaspaces.test.cacheloader.PersonEntry> Jul 3, 2006 4:13:16 PM com.j_spaces.sadapter.cache.CacheStorage CacheLoader#load FINER: RETURN null_
|
Wiki Content Tree
Your Feedback Needed!
We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.
Add Comment