@GridSpiMultipleInstancesSupport(value=true) public class GridNeverFailoverSpi extends GridSpiAdapter implements GridFailoverSpi, GridNeverFailoverSpiMBean
null out of
GridFailoverSpi.failover(GridFailoverContext, List) method.
Here is a Java example on how to configure grid with GridNeverFailoverSpi:
GridNeverFailoverSpi spi = new GridNeverFailoverSpi(); GridConfiguration cfg = new GridConfiguration(); // Override default failover SPI. cfg.setFailoverSpiSpi(spi); // Starts grid. G.start(cfg);Here is an example on how to configure grid with
GridNeverFailoverSpi from Spring XML configuration file:
<property name="failoverSpi">
<bean class="org.gridgain.grid.spi.failover.never.GridNeverFailoverSpi"/>
</property>
For information about Spring framework visit www.springframework.org
GridFailoverSpi| Constructor and Description |
|---|
GridNeverFailoverSpi() |
| Modifier and Type | Method and Description |
|---|---|
GridNode |
failover(GridFailoverContext ctx,
List<GridNode> top)
This method is called when method
GridComputeTask.result(GridComputeJobResult, List) returns
value GridComputeJobResultPolicy.FAILOVER policy indicating that the result of
job execution must be failed over. |
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, onContextInitializedgetGridGainHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormattedpublic void spiStart(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.public GridNode failover(GridFailoverContext ctx, List<GridNode> top)
GridComputeTask.result(GridComputeJobResult, List) returns
value GridComputeJobResultPolicy.FAILOVER policy indicating that the result of
job execution must be failed over. Implementation of this method should examine failover
context and choose one of the grid nodes from supplied topology to retry job execution
on it. For best performance it is advised that GridFailoverContext.getBalancedNode(List)
method is used to select node for execution of failed job.failover in interface GridFailoverSpictx - Failover context.top - Collection of all grid nodes within task topology (may include failed node).null if new node cannot be picked.
If job failover fails (returns null) the whole task will be failed.Copyright © 2014. All rights reserved.