GridGain™ 2.1.0
Java API Specification

org.gridgain.grid.spi.loadbalancing.affinity
Interface GridAffinityLoadBalancingSpiMBean

All Superinterfaces:
GridSpiManagementMBean
All Known Implementing Classes:
GridAffinityLoadBalancingSpi

@GridMBeanDescription(value="MBean that provides access to affinity load balancing SPI configuration.")
public interface GridAffinityLoadBalancingSpiMBean
extends GridSpiManagementMBean

Management bean for GridAffinityLoadBalancingSpi.



See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

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

 

Method Summary
 Map<String,? extends Serializable> getAffinityNodeAttributes()
          Gets map of node attributes for nodes that should participate in affinity assignment.
 String getAffinitySeed()
          Gets affinity seed used by Consistent Hashing algorithm.
 int getVirtualNodeCount()
          Gets number of virtual nodes for Consistent Hashing algorithm.
 
Methods inherited from interface org.gridgain.grid.spi.GridSpiManagementMBean
getAuthor, getGridGainHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion
 

Method Detail

getVirtualNodeCount

@GridMBeanDescription(value="Gets number of virtual nodes for Consistent Hashing algorithm.")
int getVirtualNodeCount()
Gets number of virtual nodes for Consistent Hashing algorithm. For more information about algorithm, see Tom White's Blog.

Returns:
Number of virtual nodes.

getAffinityNodeAttributes

@GridMBeanDescription(value="Gets map of node attributes for nodes that should participate in affinity assignment.")
Map<String,? extends Serializable> getAffinityNodeAttributes()
Gets map of node attributes for nodes that should participate in affinity assignment. Only nodes that have this attributes set will be included.

Default value is null which means all nodes will be added.

Returns:
Map of node attributes.

getAffinitySeed

@GridMBeanDescription(value="Gets affinity seed used for Consistent Hashing algorithm.")
String getAffinitySeed()
Gets affinity seed used by Consistent Hashing algorithm. By default this seed is empty string.

Whenever starting multiple instances of this SPI, you should make sure that every instance has a different seed to achieve different affinity assignment. Otherwise, affinity assignment for different instances of this SPI will be identical, which defeats the purpose of starting multiple affinity load balancing SPI's altogether.

Note that affinity seed must be identical for corresponding instances of this SPI on all nodes. If this is not the case, then different nodes will calculate affinity differently which may result in multiple nodes responsible for the same affinity key.

Returns:
Non-null value for affinity seed.

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.