Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.distribution.ch
Class TopologyAwareSyncConsistentHashFactory

java.lang.Object
  extended by org.infinispan.distribution.ch.SyncConsistentHashFactory
      extended by org.infinispan.distribution.ch.TopologyAwareSyncConsistentHashFactory
All Implemented Interfaces:
ConsistentHashFactory<DefaultConsistentHash>

public class TopologyAwareSyncConsistentHashFactory
extends SyncConsistentHashFactory

A ConsistentHashFactory implementation that guarantees caches with the same members have the same consistent hash and also tries to distribute segments based on the topology information in TransportConfiguration.

It has a drawback compared to DefaultConsistentHashFactory: it can potentially move a lot more segments during a rebalance than strictly necessary.

It is not recommended using the TopologyAwareSyncConsistentHashFactory with a very small number of segments. The distribution of segments to owners gets better with a higher number of segments, and is especially bad when numSegments &lt; numNodes

Since:
5.2
Author:
Dan Berindei

Nested Class Summary
static class TopologyAwareSyncConsistentHashFactory.Externalizer
           
 
Nested classes/interfaces inherited from class org.infinispan.distribution.ch.SyncConsistentHashFactory
SyncConsistentHashFactory.Builder
 
Constructor Summary
TopologyAwareSyncConsistentHashFactory()
           
 
Method Summary
protected  void populateOwnersFewSegments(SyncConsistentHashFactory.Builder builder, SortedMap<Integer,Address> primarySegments)
           
protected  void populateOwnersManySegments(SyncConsistentHashFactory.Builder builder, SortedMap<Integer,Address> primarySegments)
           
 
Methods inherited from class org.infinispan.distribution.ch.SyncConsistentHashFactory
create, normalizedHash, rebalance, union, updateMembers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologyAwareSyncConsistentHashFactory

public TopologyAwareSyncConsistentHashFactory()
Method Detail

populateOwnersFewSegments

protected void populateOwnersFewSegments(SyncConsistentHashFactory.Builder builder,
                                         SortedMap<Integer,Address> primarySegments)
Overrides:
populateOwnersFewSegments in class SyncConsistentHashFactory

populateOwnersManySegments

protected void populateOwnersManySegments(SyncConsistentHashFactory.Builder builder,
                                          SortedMap<Integer,Address> primarySegments)
Overrides:
populateOwnersManySegments in class SyncConsistentHashFactory

Infinispan Distribution 5.2.6.Final-redhat-2

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.