GridGain™ 2.1.0
Java API Specification

org.gridgain.grid.spi.topology
Interface GridTopologySpi

All Superinterfaces:
GridSpi
All Known Implementing Classes:
GridAttributesTopologySpi, GridBasicTopologySpi, GridNodeFilterTopologySpi

@Apache20LicenseCompatible
public interface GridTopologySpi
extends GridSpi

Topology SPI allows developer to have a custom logic deciding what specific set of grid nodes (topology) is available to GridGain in any given point of time. This SPI is called every time before grid task gets mapped (GridTask.map(List, Object)).

Implementations can employ various strategies, e.g., some may be time based when certain nodes are available only at certain time or dates, or topology can be based on average load of the nodes, or it can be based on specifics of the task obtained from the task session and ability to match them to grid nodes.

Note that in simple environments the topology is often the same as entire grid (sometimes minus the local node). More complex topology management is required only when available topology changes per task or per some other condition.

GridGain comes with following implementations:





See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

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

 

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.
 
Methods inherited from interface org.gridgain.grid.spi.GridSpi
getName, getNodeAttributes, onContextDestroyed, onContextInitialized, spiStart, spiStop
 

Method Detail

getTopology

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

Throws:
GridSpiException - 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.

GridGain™ 2.1.0
Java API Specification

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