Dashboard > GridGain User Guide > Table Of Contents > GridGain Book > Checkpoint SPI > GridCacheCheckpointSPI
GridCacheCheckpointSPI
Added by Yakov Zhdanov, last edited by Yakov Zhdanov on Apr 15, 2011  (view change)
Labels: 
(None)


Click on Javadoc link to open Javadoc documentation.

Package

org.gridgain.grid.spi.checkpoint.cache Javadoc

Description

GridJdbcCheckpointSpi Javadoc uses database to store checkpoints. All checkpoints are stored in the database table and available from all nodes in the grid. Note that every node must have access to the database. The reason of having it is because a job state can be saved on one node and loaded on another (e.g., if a job gets preempted on a different node after node failure).

Configuration

The following configuration parameters can be used to configure GridJdbcCheckpointSpi Javadoc :

Setter Method Description Optional Default
setCacheName(String) Javadoc Sets cache name to use for storing checkpoints. Yes checkpoints (defined by GridCacheCheckpointSpi.DFLT_CACHE_NAME Javadoc )

Examples

GridCacheCheckpointSpi Javadoc can be configured as follows:

GridConfigurationAdapter cfg = new GridConfigurationAdapter();                                    
                                                                                                  
String cacheName = "checkpoints";                                                                 
                                                                                                  
GridCacheConfigurationAdapter cacheConfig = new GridCacheConfigurationAdapter();                  
                                                                                                  
cacheConfig.setName(cacheName);                                                                   
                                                                                                  
GridCacheCheckpointSpi spi = new GridCacheCheckpointSpi();                                        
                                                                                                  
spi.setCacheName(cacheName);                                                                      
                                                                                                  
cfg.setCacheConfiguration(cacheConfig);                                                           
                                                                                                  
// Override default checkpoint SPI.                                                               
cfg.setCheckpointSpi(cpSpi);                                                                      
                                                                                                  
// Start grid.                                                                                    
G.start(cfg);

or from Spring XML configuration file:

<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">       
    ...                                                                                                     
        <!-- Cache configuration. -->                                                                 
        <property name="cacheConfiguration">                                                
            <list>                                                                                    
                <bean class="org.gridgain.grid.cache.GridCacheConfigurationAdapter">        
                    <property name="name" value="CACHE_NAME"/>                    
                </bean>                                                                               
            </list>                                                                                   
        </property>                                                                                   
                                                                                                            
        <!-- SPI configuration. -->                                                                   
        <property name="checkpointSpi">                                                     
            <bean class="org.gridgain.grid.spi.checkpoint.cache.GridCacheCheckpointSpi">    
                <property name="cacheName" value="CACHE_NAME"/>                   
            </bean>                                                                                   
        </property>                                                                                   
    ...                                                                                                     
</bean>


For more information about using Spring framework for configuration click here.

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators