Dashboard > GridGain User Guide > Table Of Contents > Developers Guide > Failover SPI > GridAlwaysFailoverSpi
GridAlwaysFailoverSpi
Added by morpheus, last edited by morpheus on Feb 04, 2008  (view change)
Labels: 
(None)


Click on Javadoc link to open Javadoc documentation.

Package

org.gridgain.grid.spi.failover.always Javadoc

Description

GridAlwaysFailoverSpi Javadoc which always reroutes a failed job to another node. Note, that at first an attempt will be made to reroute the failed job to a node that was not part of initial split for a better chance of success. If no such nodes are available, then an attempt will be made to reroute the failed job to the nodes in the initial split minus the node the job is failed on. If none of the above attempts succeeded, then the job will not be failed over and null will be returned.

Configuration

The following configuration parameters can be used to configure GridJobStealingFailoverSpi Javadoc

Setter Method Description Optional Default
setMaximumFailoverAttempts(int) Javadoc Sets maximum number of attempts to execute a failed job on another node. This parameter is available starting with GridGain 2.0 Yes 5 specified in GridAlwaysFailoverSpi.DFLT_MAX_FAILOVER_ATTEMPTS Javadoc .

Examples

As any GridGain SPI, GridAlwaysFailoverSpi Javadoc can be configured either directly from code or from Spring configuration file. Here is an example of GridAlwaysFailoverSpi Javadoc configuration from code:

GridAlwaysFailoverSpi failSpi = new GridAlwaysFailoverSpi();

GridConfigurationAdapter cfg = new GridConfigurationAdapter();

// Override maximum failover attempts.
failSpi.setMaximumFailoverAttempts(5);

// Override default failover SPI.
cfg.setFailoverSpi(failSpi);

// Start grid.
GridFactory.start(cfg);

or from Spring configuration file

<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
    ...
    <bean class="org.gridgain.grid.spi.failover.always.GridAlwaysFailoverSpi">
         <property name="maximumFailoverAttempts" value="5"/>
    </bean>
    ...
</bean>


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

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