|
GridGain 2.0.3
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridgain.grid.spi.GridSpiAdapter
org.gridgain.grid.spi.checkpoint.gigaspaces.GridGigaSpacesCheckpointSpi
@GridSpiInfo(author="GridGain Systems",
url="www.gridgain.org",
email="support@gridgain.com",
version="x.x")
@GridSpiMultipleInstancesSupport(value=true)
public class GridGigaSpacesCheckpointSpiThis class defines GigaSpaces-based implementation for checkpoint SPI. All checkpoints are stored in distributed cache and available for all nodes in the grid. Note that every node must have access to the cache. The reason for 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).
GridGigaSpacesCheckpointSpi.setSpaceUrl(String))GridGigaSpacesCheckpointSpi.setSpace(GigaSpace))
GridGigaSpacesCheckpointSpi checkpointSpi = new GridGigaSpacesCheckpointSpi();
// Provide GigaSpaces URL.
checkpointSpi.setSpaceUrl("/./mySpace");
GridConfigurationAdapter cfg = new GridConfigurationAdapter();
// Override default checkpoint SPI.
cfg.setCheckpointSpi(checkpointSpi);
// Start grid.
GridFactory.start(cfg);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
...
<property name="checkpointSpi">
<bean class="org.gridgain.grid.spi.checkpoint.gigaspaces.GridGigaSpacesCheckpointSpi">
<!-- Change to GigaSpaces URL in your environment. -->
<property name="spaceUrl" value="/./mySpace"/>
</bean>
</property>
...
</bean>
For information about Spring framework visit www.springframework.org
See Also:
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3
GridCheckpointSpi
![]() |
![]() |
| Constructor Summary | |
|---|---|
GridGigaSpacesCheckpointSpi()
|
|
| Method Summary | |
|---|---|
org.openspaces.core.GigaSpace |
getSpace()
Gets space object used by SPI. |
String |
getSpaceUrl()
Gets GigaSpaces URL. |
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. |
void |
setSpace(org.openspaces.core.GigaSpace gigaSpace)
Sets GigaSpace gigaSpace object. |
void |
setSpaceUrl(String spaceUrl)
Sets GigaSpaces connection URL. |
void |
spiStart(String gridName)
This method is called to start SPI. |
void |
spiStop()
This method is called to stop SPI. |
String |
toString()
|
| Methods inherited from class org.gridgain.grid.spi.GridSpiAdapter |
|---|
assertParameter, checkConfigurationConsistency, configInfo, getAuthor, getGridGainHome, getLocalNodeId, getNodeAttributes, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion, onContextDestroyed, onContextInitialized, registerMBean, setSpiContext, startInfo, startStopwatch, stopInfo, unregisterMBean, warnSpi, warnSpiParameter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.gridgain.grid.spi.GridSpi |
|---|
getNodeAttributes, onContextDestroyed, onContextInitialized |
| Methods inherited from interface org.gridgain.grid.spi.GridSpiManagementMBean |
|---|
getAuthor, getGridGainHome, getLocalNodeId, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion |
| Constructor Detail |
|---|
public GridGigaSpacesCheckpointSpi()
| Method Detail |
|---|
public String getSpaceUrl()
getSpaceUrl in interface GridGigaSpacesCheckpointSpiMBean@GridSpiConfiguration(optional=true) public void setSpaceUrl(String spaceUrl)
spaceUrl - GigaSpaces URL to set.public org.openspaces.core.GigaSpace getSpace()
getSpace in interface GridGigaSpacesCheckpointSpiMBean@GridSpiConfiguration(optional=true) public void setSpace(org.openspaces.core.GigaSpace gigaSpace)
gigaSpace - GigaSpace gigaSpace.
public void spiStart(String gridName)
throws GridSpiException
spiStart in interface GridSpiGridSpiException - Throws in case of any error during SPI start.gridName - Name of grid instance this SPI is being started for
(null for default grid).
public void spiStop()
throws GridSpiException
spiStop in interface GridSpiGridSpiException - Thrown in case of any error during SPI stop.
public byte[] loadCheckpoint(String key)
throws GridSpiException
loadCheckpoint in interface GridCheckpointSpiGridSpiException - 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.
public void saveCheckpoint(String key,
byte[] state,
long timeout)
throws GridSpiException
saveCheckpoint in interface GridCheckpointSpiGridSpiException - 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.public boolean removeCheckpoint(String key)
removeCheckpoint in interface GridCheckpointSpikey - Key for the checkpoint to remove.
public String toString()
toString in class Object
|
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. |
|