GridGain™ 2.1.0
Java API Specification

org.gridgain.grid
Interface GridNodeFilter

All Known Implementing Classes:
GridJexlNodeFilter

@Apache20LicenseCompatible
public interface GridNodeFilter

Instances of classes that implement this interface are used to filter grid nodes. These instances are used to filter nodes in method Grid.getNodes(GridNodeFilter). They are also used by GridNodeFilterTopologySpi to provide task topology based on user-defined node filters.

GridGain also comes with GridJexlNodeFilter implementation which allows you to conveniently filter nodes based on Apache JEXL expression language. For more information refer to Apache JEXL documentation.

Together with GridNodeFilterTopologySpi GridJexlNodeFilter allows for a fairly simple way to provide complex SLA-based task topology specifications. For example, expression below shows how the SPI can be configured with GridJexlNodeFilter to include all Windows XP nodes with more than one processor or core and that are not loaded over 50%

 <bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
       ...
       <property name="topologySpi">
           <bean class="org.gridgain.grid.spi.topology.nodefilter.GridNodeFilterTopologySpi">
               <property name="filter">
                    <bean class="org.gridgain.grid.GridJexlNodeFilter">
                        <property name="expression"
                            value="node.metrics.availableProcessors > 1 && node.metrics.averageCpuLoad < 0.5 && node.attributes['os.name'] == 'Windows XP'"/>
                    </bean>
                </property>
           </bean>
       </property>
       ...
 </bean>
 




See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

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

 

Method Summary
 boolean accept(GridNode node)
          Tests if a specified grid node should be accepted.
 

Method Detail

accept

boolean accept(GridNode node)
Tests if a specified grid node should be accepted.

Parameters:
node - Node to check.
Returns:
True if node is accepted, false otherwise.

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.