@GridSpiNoop @GridSpiMultipleInstancesSupport(value=true) public class GridNoopCheckpointSpi extends GridSpiAdapter implements GridCheckpointSpi
GridCheckpointSpi. This is default implementation
since 4.5.0 version.| Constructor and Description |
|---|
GridNoopCheckpointSpi() |
| Modifier and Type | Method and Description |
|---|---|
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. |
boolean |
saveCheckpoint(String key,
byte[] state,
long timeout,
boolean overwrite)
Saves checkpoint to the storage.
|
void |
setCheckpointListener(GridCheckpointListener lsnr)
Sets the checkpoint listener.
|
void |
spiStart(String gridName)
This method is called to start SPI.
|
void |
spiStop()
This method is called to stop SPI.
|
String |
toString() |
assertParameter, checkConfigurationConsistency0, configInfo, createSpiAttributeName, getConsistentAttributeNames, getGridGainHome, getLocalNodeId, getName, getNodeAttributes, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, injectables, onContextDestroyed, onContextDestroyed0, onContextInitialized, onContextInitialized0, registerMBean, setName, startInfo, startStopwatch, stopInfo, unregisterMBeanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getNodeAttributes, onContextDestroyed, onContextInitializedpublic void spiStart(@Nullable String gridName) throws GridSpiException
spiStart in interface GridSpigridName - Name of grid instance this SPI is being started for
(null for default grid).GridSpiException - Throws in case of any error during SPI start.public void spiStop()
throws GridSpiException
Note that this method can be called at any point including during recovery of failed start. It should make no assumptions on what state SPI will be in when this method is called.
spiStop in interface GridSpiGridSpiException - Thrown in case of any error during SPI stop.@Nullable public byte[] loadCheckpoint(String key) throws GridSpiException
loadCheckpoint in interface GridCheckpointSpikey - Checkpoint key.null if there is no data for a given
key.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.public boolean saveCheckpoint(String key, byte[] state, long timeout, boolean overwrite) throws GridSpiException
saveCheckpoint in interface GridCheckpointSpikey - 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.overwrite - Whether or not overwrite checkpoint if it already exists.true if checkpoint has been actually saved, false otherwise.GridSpiException - Thrown in case of any error while saving
checkpoint data.public boolean removeCheckpoint(String key)
key.removeCheckpoint in interface GridCheckpointSpikey - Key for the checkpoint to remove.true if data has been actually removed, false
otherwise.public void setCheckpointListener(GridCheckpointListener lsnr)
setCheckpointListener in interface GridCheckpointSpilsnr - The listener to set or null.Copyright © 2014. All rights reserved.