Persistent Space Schema

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: All the persistency options in the persistent space schema file.

Overview

The Persistent space options described as part of the space schema file:

<space-config>
    <persistent>
        <enabled>true</enabled>
        <!-- name of the storage adapter class to be used by the space
               - by default, it is com.j_spaces.sadapter.GenericPA.GenericPersistentAdapter -->
               <StorageAdapterClass>com.j_spaces.sadapter.GenericPA.GenericPersistentAdapter
               </StorageAdapterClass>
               <AdapterType>com.j_spaces.sadapter.GenericPA.PerstPersistentAdapter</AdapterType>
               <CacheLoaderClass></CacheLoaderClass>
               <entity-class></entity-class>
<DataBaseName>${com.gs.home}/GenericPersistProperties/${com.gs.container.name}_${com.gs.space.name}/
${com.gs.container.name}
_${com.gs.space.name}DB.dbs</DataBaseName>
     <userName></userName>
     <password></password>
     <Number_Sync_Objects>-1</Number_Sync_Objects>
     <Check_Point_Period>-1</Check_Point_Period>
     <Page_Pool_Size>32768</Page_Pool_Size>
     <Sync_On_Commit>true</Sync_On_Commit>
     <!-- path to the directory that holds the database properties and data type mapping
     e.g ${com.gs.home}/GenericPersistProperties -->
                 <StorageAdapterURL>${com.gs.home}/GenericPersistProperties</StorageAdapterURL>
     <!-- if true persistent space will be forced to start in COLD_INIT(empty) otherwise WARM_INIT -->
     <force-cold-init>false</force-cold-init>
    </persistent>
    <!--RDBMS configuration-->
    <init_sa_connections>10</init_sa_connections>
    <max_sa_connections>100</max_sa_connections>
    <!--if true all data will be lost, if WARM INIT FAILED-->
    <sa_reset_on_failure>false</sa_reset_on_failure>
</space-config>
Element XPath property Description Default Value
<enabled> space-config.
persistent.enabled
Boolean value. If set to true, moves the space into persistent mode allowing it to persist data into a file or database or use CacheLoader and CacheStore interfaces.  
<StorageAdapterClass> space-config.
persistent.
StorageAdapterClass
Adapter implementation. Can have the following options:
  • Generic SA - com.j_spaces.sadapter
    .GenericPA.GenericPersistent
    Adapter – using indexed file for persistency or CacheLoader/CacheStore implementation.
  • JDBC SA - com.j_spaces.sadapter.
    GenericJDBC.JDBCStorageAdapter - using RDBMS for persistency.
com.
j_spaces.
sadapter.
GenericPA.
Generic
Persistent
Adapter
<AdapterType> space-config.
persistent.
AdapterType
When using the GenericPersistent
Adapter as the <StorageAdapterClass> should have the com.j_spaces.sadapter.
GenericPA.PerstPersistentAdapter value.
When using CacheLoader and CacheStore implementations should have the com.j_spaces.sadapter.
GenericPA.CustomPesistentCache value.
 
<CacheLoaderClass> space-config.
persistent.
CacheLoaderClass
The CacheLoader or CacheStore implementation class name.
Should be defined when using the CacheLoader and CacheStore interfaces.
 
<entity-class> space-config.
persistent.
entity-class
Used only with the Map API. This tag represents the mapping between the Map.key class name, and an external data source table name.  
<DataBaseName> space-config.
persistent.
DataBaseName
Used with the GenericPersistentAdapter.
This defines the file name to store the space data.
${com.gs.
home}/
Generic
Persist
Properties
${com.gs.
container.
name}
${com.gs.
space.name}
${com.gs.
container.
name}
${com.gs.
space.name}DB.dbs
<username> space-config.
persistent.
username
Should be defined when using the CacheLoader and CacheStore interfaces.
You may pass the database user name. This is passed to the CacheLifeCycleManager.init() implementation.
 
<password> space-config.
persistent.
password
Should be defined when using the CacheLoader and CacheStore interfaces.
You may pass the database password. This is passed to the CacheLifeCycleManager.init() implementation.
 
<Number_Sync_Objects> space-config.
persistent.
Number_Sync_Objects
Number of destructive operations to happen (i.e., write, take) before flushing the file cache into the disk - file cache data will be flushed into the disk after a specified number of destructive space operations have been called.
The default value for this parameter is -1 - i.e., No flush into disk.
-1
<Check_Point_Period> space-config.
persistent.
Check_Point_Period
The Check_Point_Period specifies a time[ms] to wait between flush operations - you can specify a time interval to flush the file cache into the disk. The default value for this parameter is -1 - i.e., No periodic flush into disk. -1
<Page_Pool_Size> space-config.
persistent.
Page_Pool_Size
Relevant only for the Generic SA.
Defines the file cache size[kb]. If you have transactions that are larger than 32M you should increase this value to accommodate the largest transaction size.
When the file cache is full, data is flushed into the disk. Minimum size 64kb.
32768 (32M)
<Sync_On_Commit> space-config.
persistent.
Sync_On_Commit
Boolean value. Used with the Generic SA. When set to true, flush data from OS file cache into disk when commit called. true
<StorageAdapterURL> space-config.
persistent.
StorageAdapterURL
The location of the JDBC SA properties files or the Generic SA files that stores the space data. Example:
<StorageAdapterURL>
/GenericJDBCProperties/
HSQLProperties</StorageAdapterURL>
<StorageAdapterURL>$com.gs.home
/GenericPersistProperties
</StorageAdapterURL>
When using the JDBC SA, the path that is defined as part of the <StorageAdapterURL> property should be part of the JVM classpath running the space.
For Generic SA:
${com.gs.
home}/
Generic
Persist
Properties
<force-cold-init> space-config.
persistent.
force-cold-init
Clears the space data stored at persistent data source when the space is started. false
<init_sa_connections> space-config.
init_sa_
connections
Relevant only for the JDBC SA. Connection pool maximum size. 10
<max_sa_
connections>
space-config.
max_sa_
connections
Relevant only for the JDBC SA. Connection pool minimum size. 100
<sa_reset_
on_failure>
space-config.
sa_reset_
on_failure
Clears the persistent data source if it identifies problems with database tables. false

Defining Cache Size

When a persistent space (using the JDBC SA or an indexed file) is using LRU cache policy and the space has been restarted, it loads data from the underlying durable data source (RDBMS, indexed file) before being available for clients to access.

The default behavior is to load data up to 50% of the <cache_size> value.

When the <memory_usage> is true (evicting data from the space based on free heap size), is it recommended to have a large value for the <cache_size> property. This instructs the space engine to ignore the amount of Entries inside the space when launching the eviction mechanism. This ensures that the eviction is based only on heap size free memory.

The combination of the above (large <cache_size> and space restart) may lead to out of memory problems. To avoid this, configure the space-config.engine.initial_load to have a low value (5 below means 5% of the <cache_size> – default is 50%):

XML schema tag:

<space-config>
   <engine>
         <initial_load>5</initial_load>
</space-config>
   </engine>

XPATH property:

space-config.engine.initial_load=5
The space schema file does not include the <initial_load> tag by default. You should add it into the correct location.

The <initial_load_class> tag can also be added to the space schema. This tag specifies which class to load. For example:

<space-config>
   <engine>
      <initial_load_class>com.myCompany.myEntry</initial_load_class>
</space-config>
   </engine>

Setting <initial_load_class>_</initial_load_class> is the same as not having this element in the schema.


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.

Labels

 
(None)