GridGain™ 3.6.0e
Enterprise Edition

org.gridgain.grid.spi.topology
Interface GridTopologySpi

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

public interface GridTopologySpi
extends GridSpi, GridSpiJsonConfigurable

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:

NOTE: this SPI (i.e. methods in this interface) should never be used directly. SPIs provide internal view on the subsystem and is used internally by GridGain kernal. In rare use cases when access to a specific implementation of this SPI is required - an instance of this SPI can be obtained via Grid.configuration() method to check its configuration properties or call other non-SPI methods. Note again that calling methods from this interface on the obtained instance can lead to undefined behavior and explicitly not supported.

Wiki & Forum:


Wiki
Forum

 

Method Summary
 Collection<? extends GridNode> getTopology(GridTaskSession ses, Collection<? extends 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
 
Methods inherited from interface org.gridgain.grid.spi.GridSpiJsonConfigurable
setJson
 

Method Detail

getTopology

Collection<? extends GridNode> getTopology(GridTaskSession ses,
                                           Collection<? extends 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™ 3.6.0e
Enterprise Edition

GridGain - Real Time Big Data
Enterprise Edition, ver. 3.6.0e.13012012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Follow GridGain on Facebook Join GridGain User Group Follow GridGain on Twitter Follow GridGain on YouTube