All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.client.hotrod.impl.consistenthash.ConsistentHash Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.client.hotrod.impl.consistenthash;

import java.net.SocketAddress;
import java.util.Map;
import java.util.Set;

/**
 * Abstraction for the used consistent hash.
 *
 * @author [email protected]
 * @since 4.1
 */
public interface ConsistentHash {

   @Deprecated(forRemoval=true, since = "11.0")
   void init(Map> servers2Hash, int numKeyOwners, int hashSpace);

   SocketAddress getServer(Object key);

   /**
    * Computes hash code of a given object, and then normalizes it to ensure a positive
    * value is always returned.
    * @param object to hash
    * @return a non-null, non-negative normalized hash code for a given object
    */
   int getNormalizedHash(Object object);

   Map> getSegmentsByServer();

   default Map> getPrimarySegmentsByServer() {
      return null;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy