Interface KeyDistribution

All Known Implementing Classes:
ConsistentHashKeyDistribution

public interface KeyDistribution
Provides key distribution functions.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    forCache(org.infinispan.Cache<?,?> cache)
    Creates a key distribution for the current consistent hash of the specified cache.
    forConsistentHash(org.infinispan.Cache<?,?> cache, org.infinispan.distribution.ch.ConsistentHash hash)
    Creates a key distribution for the specified consistent hash of the specified cache.
    List<org.infinispan.remoting.transport.Address>
    Returns the owners of the specified key.
    org.infinispan.remoting.transport.Address
    Returns the primary owner of the specified key.
  • Method Details

    • getPrimaryOwner

      org.infinispan.remoting.transport.Address getPrimaryOwner(Object key)
      Returns the primary owner of the specified key.
      Parameters:
      key - a cache key
      Returns:
      the address of the primary owner
    • getOwners

      List<org.infinispan.remoting.transport.Address> getOwners(Object key)
      Returns the owners of the specified key.
      Parameters:
      key - a cache key
      Returns:
      a list of addresses for each owner
    • forCache

      static KeyDistribution forCache(org.infinispan.Cache<?,?> cache)
      Creates a key distribution for the current consistent hash of the specified cache.
      Parameters:
      cache - an embedded cache
      Returns:
      a key distribution for the current consistent hash of the specified cache.
    • forConsistentHash

      static KeyDistribution forConsistentHash(org.infinispan.Cache<?,?> cache, org.infinispan.distribution.ch.ConsistentHash hash)
      Creates a key distribution for the specified consistent hash of the specified cache.
      Parameters:
      cache - an embedded cache
      hash - a consistent hash
      Returns:
      a key distribution for the specified consistent hash of the specified cache.