Dashboard > GridGain User Guide > Table Of Contents > Developers Guide > Checkpoint SPI
Checkpoint SPI
Added by architect, last edited by link on Jun 11, 2008  (view change)
Labels: 
(None)


Click on Javadoc link to open Javadoc documentation.

Package

org.gridgain.grid.spi.checkpoint Javadoc

Built-in Implementations

GridGain comes with three checkpoint SPIs supported out of the box:

Description

GridCheckpointSpi Javadoc provides an ability to save an intermediate job state. It can be useful when long running jobs need to store some intermediate state to protect from node failures. Then on restart of a failed node, a job would load the saved check point and continue from where it left off. Checkpoint SPI can also be used for exchanging data between jobs on different nodes, e. g. a job on one node can save some state and another job on a different node can load this state to use it in its own execution. The only requirement for job state is to implement java.io.Serializable interface.

Checkpoint Access

Checkpoints must be equally accessible from all grid nodes. So if a job saves a check point on one node, another job on a different node should be able to retrieve it. This is required because grid topology is dynamic and the same task can be executed on different nodes every time. Hence for a task job to pick up from where the previous job left off, it must have access to the checkpoint saved by another job potentially on another node.

Checkpoints are available through GridTaskSession Javadoc :

  • GridTaskSession.loadCheckPoint(...) Javadoc
  • GridTaskSession.removeCheckPoint(...) Javadoc
  • GridTaskSession.saveCheckPoint(...) Javadoc

Configuration

GridCheckpointSpi Javadoc is provided in GridConfiguration Interface passed into GridFactory Javadoc at startup. You can configure a different checkpoint SPI implementations as follows:

GridConfigurationAdapter cfg = new GridConfigurationAdapter();

// Configure Shared Filesystem Checkpoint SPI to load/save
// checkpoints from a shared file system.
cfg.setCheckpointSpi(new GridSharedFsCheckpointSpi());

GridFactory.start(cfg);

Note that GridConfiguration Javadoc interface is just a bean and can also be configured using spring XML configuration.


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

Default Implementation

If no checkpoint SPI is provided in configuration by default GridSharedFsCheckpointSpi is used.

GridSharedFsCheckpointSpi (GridGain User Guide)

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