GridGain™ 2.0.3
Java API Specification

org.gridgain.grid.spi.topology.basic
Class GridBasicTopologySpi

java.lang.Object
  extended by org.gridgain.grid.spi.GridSpiAdapter
      extended by org.gridgain.grid.spi.topology.basic.GridBasicTopologySpi
All Implemented Interfaces:
GridSpi, GridSpiManagementMBean, GridBasicTopologySpiMBean, GridTopologySpi

@GridSpiInfo(author="GridGain Systems",
             url="www.gridgain.org",
             email="support@gridgain.com",
             version="x.x")
@GridSpiMultipleInstancesSupport(value=true)
public class GridBasicTopologySpi
extends GridSpiAdapter
implements GridTopologySpi, GridBasicTopologySpiMBean

This class provides basic implementation for topology SPI. This implementation always returns either all available remote grid nodes, remote and local nodes, or only a local node.

Configuration

Mandatory

This SPI has no mandatory configuration parameters.

Optional

This SPI has following optional configuration parameters:



See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

Author:   2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3

 

Constructor Summary
GridBasicTopologySpi()
           
 
Method Summary
 Collection<GridNode> getTopology(GridTaskSession ses, Collection<GridNode> grid)
          This method is called by GridGain right before calling GridTask.map(List, Object) to obtain a topology for the task's split.
 boolean isLocalNode()
          Indicates whether or not to return local node.
 boolean isRemoteNodes()
          Indicates whether or not to return remote nodes.
 void setLocalNode(boolean isLocalNode)
          Sets the flag on whether or not return local node.
 void setRemoteNodes(boolean isRmtNodes)
          Sets the flag on whether or not return available remote nodes.
 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

GridBasicTopologySpi

public GridBasicTopologySpi()
Method Detail

isLocalNode

public boolean isLocalNode()
Indicates whether or not to return local node.

Specified by:
isLocalNode in interface GridBasicTopologySpiMBean
Returns:
Whether or not to return local node.

setLocalNode

@GridSpiConfiguration(optional=true)
public void setLocalNode(boolean isLocalNode)
Sets the flag on whether or not return local node.

Parameters:
isLocalNode - true to return local node, false otherwise.

isRemoteNodes

public boolean isRemoteNodes()
Indicates whether or not to return remote nodes.

Specified by:
isRemoteNodes in interface GridBasicTopologySpiMBean
Returns:
Whether or not to return remote nodes.

setRemoteNodes

@GridSpiConfiguration(optional=true)
public void setRemoteNodes(boolean isRmtNodes)
Sets the flag on whether or not return available remote nodes.

Parameters:
isRmtNodes - true to return remote nodes, false otherwise.

getTopology

public Collection<GridNode> getTopology(GridTaskSession ses,
                                        Collection<GridNode> grid)
                                 throws GridException
This method is called by GridGain right before calling GridTask.map(List, Object) to obtain a topology for the task's split.

Specified by:
getTopology in interface GridTopologySpi
Throws:
GridException - Thrown in case if topology cannot be obtained.
Parameters:
ses - Current task's session. If implementation does not depend on task's information it may ignore it.
grid - Full set of all grid nodes.
Returns:
Topology to use for execution of the task represented by the session passed in.

spiStart

public void spiStart(String gridName)
              throws GridSpiException
This method is called to start SPI. After this method returns successfully kernel assumes that SPI is fully operational.

Specified by:
spiStart in interface GridSpi
Throws:
GridSpiException - Throws in case of any error during SPI start.
Parameters:
gridName - Name of grid instance this SPI is being started for (null for default grid).

spiStop

public void spiStop()
             throws GridSpiException
This method is called to stop SPI. After this method returns kernel assumes that this SPI is finished and all resources acquired by it are released. 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.

Specified by:
spiStop in interface GridSpi
Throws:
GridSpiException - Thrown in case of any error during SPI stop.

toString

public String toString()

Overrides:
toString in class Object

GridGain™ 2.0.3
Java API Specification

GridGain™ - Grid Computing Made Simple, ver. 2.0.3.20052008
2005-2008 Copyright © GridGain Systems. All Rights Reserved.