Click on Javadoc link to open Javadoc documentation.
Package
org.gridgain.grid.spi.toplogy.basic Javadoc![]()
Description
GridAttributesTopologySpi ![]()
will be included into topology.
Configuration
The following configuration parameters can be used to configure GridAttributesTopologySpi ![]()
| Setter Method | Description | Optional | Default |
|---|---|---|---|
| setAttributes(Map<String, Serializable>) |
Sets attributes that all nodes should have, to be in topology. | Yes | No value |
Examples
As any GridGain SPI, GridAttributesTopologySpi ![]()
![]()
GridAttributesTopologySpi topSpi = new GridAttributesTopologySpi(); // Create attributes map. Map<String, Serializable> attrs = new HashMap<String, Serializable>(1); attrs.put("group", "myTask"); // Include nodes that have attribute with name "group" and value "myTask". topSpi.setAttributes(attrs); GridConfigurationAdapter cfg = new GridConfigurationAdapter(); // Override default topology SPI. cfg.setTopologySpi(topSpi); // Start grid. GridFactory.start(cfg);
or from Spring configuration file
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true"> ... <property name="topologySpi"> <bean class="org.gridgain.grid.spi.topology.attributes.GridAttributesTopologySpi"> <property name="attributes"> <map> <entry key="group"> <value>myTask</value> </entry> </map> </property> </bean> </property> ... </bean>

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