Dashboard > GridGain User Guide > Table Of Contents > GridGain Book > Checkpoint SPI > GridSharedFsCheckpointSpi
GridSharedFsCheckpointSpi
Added by usr1, 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.sharedfs Javadoc

Description

GridSharedFsCheckpointSpi Javadoc uses shared file system directory to store checkpoints. All checkpoints are stored on shared storage and available for all nodes in grid. Note that every node must have access to the shared directory. The reason the directory needs to be shared is because a job state can be saved on one node and loaded on another (e.g. if a job gets re-executed on a different node after node failure). When started, this SPI tracks all checkpoints saved by localhost for expiration. Note that SPI does not cache data stored in checkpoints - all the data is loaded from file system on demand.

Configuration Directories

Directories for checkpoints should either be empty or contain previously stored checkpoint files.

Configuration

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

Setter Method Description Optional Default
setDirectoryPaths(Collection) Javadoc Sets directory paths to the shared folders where checkpoints are stored. The path can either be absolute of relative to to the path specified in GRIDGAIN_HOME environment or system varialble. Yes GRIDGAIN_HOME/work/cp/sharedfs

Note that GridConfiguration Javadoc as well as all SPI interfaces can be configured via spring XML configuration.

Examples

GridSharedFsCheckpointSpi can be configured as follows:

GridConfigurationAdapter cfg = new GridConfigurationAdapter();                  
                                                                                
GridSharedFsCheckpointSpi checkpointSpi = new GridSharedFsCheckpointSpi();      
                                                                                
// List of checkpoint directories where all files are stored.                   
Collection<String> dirPaths = new ArrayList<String>();                          
                                                                                
dirPaths.add("/my/directory/path");                                             
dirPaths.add("/other/directory/path");                                          
                                                                                
// Override default directory path.                                             
checkpointSpi.setDirectoryPaths(dirPaths);                                      
                                                                                
// Override default checkpoint SPI.                                             
cfg.setCheckpointSpi(checkpointSpi);                                            
                                                                                
// Starts grid.                                                                 
G.start(cfg);

or from Spring configuration file:

<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">       
    ...                                                                                                     
    <property name="checkpointSpi">                                                                   
        <bean class="org.gridgain.grid.spi.checkpoint.sharedfs.GridSharedFsCheckpointSpi">            
            <!-- Change to shared directory path in your environment. -->                             
            <property name="directoryPaths">                                                          
                <list>                                                                                
                    <value>/my/directory/path</value>                                           
                    <value>/other/directory/path</value>                                        
                </list>                                                                               
            </property>                                                                               
        </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