Class HashConfiguration

  • All Implemented Interfaces:

    public class HashConfiguration
    extends java.lang.Object
    implements Matchable<HashConfiguration>
    Allows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.
    • Method Detail

      • consistentHashFactory

        public ConsistentHashFactory<?> consistentHashFactory()
        The consistent hash factory in use.
      • hash

        public Hash hash()
        Since 8.2, use keyPartitioner() instead.
        The hash function in use. Used as a bit spreader and a general hash code generator. Typically one of the the many default ConsistentHash implementations shipped.
      • numOwners

        public int numOwners()
        Number of cluster-wide replicas for each cache entry.
      • numSegments

        public int numSegments()
        Controls the total number of hash space segments (per cluster).

        A hash space segment is the granularity for key distribution in the cluster: a node can own (or primary-own) one or more full segments, but not a fraction of a segment. As such, larger numSegments values will mean a more even distribution of keys between nodes.

        On the other hand, the memory/bandwidth usage of the new consistent hash grows linearly with numSegments. So we recommend keeping numSegments <= 10 * clusterSize.

      • rehashEnabled

        public boolean rehashEnabled()
        If false, no rebalancing or rehashing will take place when a new node joins the cluster or a node leaves
      • capacityFactor

        public float capacityFactor()
        Controls the proportion of entries that will reside on the local node, compared to the other nodes in the cluster. This is just a suggestion, there is no guarantee that a node with a capacity factor of 2 will have twice as many entries as a node with a capacity factor of 1.
      • groups

        public GroupsConfiguration groups()
        Configuration for various grouper definitions. See the user guide for more information.
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object