|
GridGain 2.0.3
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Apache20LicenseCompatible public interface GridCheckpointSpi
Checkpoint SPI 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 system or application failures. Grid job can save intermediate
state in certain points of the execution (e.g., periodically) and upon start
check if previously saved state exists. This allows job to restart from the last
save checkpoint in case of preemption or other types of failover. The only
requirement for job state to be a checkpoint is to implement Serializable
interface.
Note, that since a job can execute on different nodes, checkpoints need to be accessible by all nodes.
To manipulate checkpoints from grid job the following public methods are available on task session (that can be injected into grid job):
GridTaskSession.loadCheckpoint(String)GridTaskSession.removeCheckpoint(String)GridTaskSession.saveCheckpoint(String, Serializable)GridTaskSession.saveCheckpoint(String, Serializable, GridCheckpointScope, long)GridGain provides the following GridCheckpointSpi implementations:
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3

| Method Summary | |
|---|---|
byte[] |
loadCheckpoint(String key)
Loads checkpoint from storage by its unique key. |
boolean |
removeCheckpoint(String key)
This method instructs the checkpoint provider to clean saved data for a given key. |
void |
saveCheckpoint(String key,
byte[] state,
long timeout)
Saves checkpoint to the storage. |
| Methods inherited from interface org.gridgain.grid.spi.GridSpi |
|---|
getNodeAttributes, onContextDestroyed, onContextInitialized, spiStart, spiStop |
| Method Detail |
|---|
byte[] loadCheckpoint(String key)
throws GridSpiException
GridSpiException - Thrown in case of any error while loading
checkpoint data. Note that in case when given key is not
found this method will return null.key - Checkpoint key.
void saveCheckpoint(String key,
byte[] state,
long timeout)
throws GridSpiException
GridSpiException - Thrown in case of any error while saving
checkpoint data.key - Checkpoint unique key.state - Saved data.timeout - Every intermediate data stored by checkpoint provider
should have a timeout. Timeout allows for effective resource
management by checkpoint provider by cleaning saved data that are not
needed anymore. Generally, the user should choose the minimum
possible timeout to avoid long-term resource acquisition by checkpoint
provider. Value 0 means that timeout will never expire.boolean removeCheckpoint(String key)
key - Key for the checkpoint to remove.
|
GridGain 2.0.3
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Grid Computing Made Simple, ver. 2.0.3.20052008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|