Class SyncConsistentHashFactory

java.lang.Object
org.infinispan.distribution.ch.impl.SyncConsistentHashFactory
All Implemented Interfaces:
ConsistentHashFactory<DefaultConsistentHash>
Direct Known Subclasses:
TopologyAwareSyncConsistentHashFactory

@ProtoTypeId(1231) public class SyncConsistentHashFactory extends Object implements ConsistentHashFactory<DefaultConsistentHash>
ConsistentHashFactory implementation that guarantees that multiple caches with the same members will have the same consistent hash (unlike DefaultConsistentHashFactory).

It has a drawback compared to DefaultConsistentHashFactory though: it can potentially move a lot more segments during a rebalance than strictly necessary. E.g. {0:AB, 1:BA, 2:CD, 3:DA} could turn into {0:BC, 1:CA, 2:CB, 3:AB} when D leaves, even though {0:AB, 1:BA, 2:CB, 3:AC} would require fewer segment ownership changes.

It may also reorder the owners of a segments, e.g. AB -> BA (same as DefaultConsistentHashFactory).

Since:
5.2
Author:
Dan Berindei
  • Constructor Details

    • SyncConsistentHashFactory

      protected SyncConsistentHashFactory()
  • Method Details