Click on Javadoc link to open Javadoc documentation.
Package
org.gridgain.grid.spi.failover ![]()
Built-in Implementations
GridGain comes with following implementations for failover SPI:
Description
Starting with GridGain 2.1 you can provide multiple instances of Failover SPIs and then specify which one to use on per-task level via @GridTaskSpis ![]()
GridFailoverSpi ![]()
![]()
![]()
- Job execution threw an exception (this condition has to be handled by user explicitly).
- Job returned bad result (this condition has to be handled by user explicitly).
- Node on which job was executing left topology, crashed, or stopped (failover is handled by default in GridTaskAdapter
Javadoc ).
- Job was rejected before it got a chance to execute, while still on waiting list (failover is handled by default in GridTaskAdapter
Javadoc ).
In all cases Failover SPI takes failed job (as failover context) and list of all grid nodes and produces another node on which the job execution will be retried. It is up to failover SPI to make sure that job is not mapped to the node it failed on. The failed node can be retrieved from GridFailoverContext.getJobResult().getNode() ![]()
Note that for any job spawned by a task, Failover SPI will be invoked only on the node that initiated the task (obviously, it cannot be invoked on failed node).
Configuration
GridFailoverSpi ![]()
![]()
GridConfigurationAdapter cfg = new GridConfigurationAdapter(); GridNeverFailoverSpi failSpi = new GridNeverFailoverSpi(); // Configure your own failover SPI. cfg.setFailoverSpi(failSpi); GridFactory.start(cfg);
Note that GridConfiguration ![]()

For more information about using Spring framework for configuration click here.
Default Implementation
If no failover SPI is provided in configuration by default GridAlwaysFailoverSpi is used.


