cn.hutool.core.lang.ConsistentHash Maven / Gradle / Ivy
package cn.hutool.core.lang;
import cn.hutool.core.lang.hash.Hash32;
import cn.hutool.core.util.HashUtil;
import java.io.Serializable;
import java.util.Collection;
import java.util.SortedMap;
import java.util.TreeMap;
/**
* 一致性Hash算法
* 算法详解:http://blog.csdn.net/sparkliang/article/details/5279393
* 算法实现:https://weblogs.java.net/blog/2007/11/27/consistent-hashing
* @author xiaoleilu
*
* @param 节点类型
*/
public class ConsistentHash implements Serializable{
private static final long serialVersionUID = 1L;
/** Hash计算对象,用于自定义hash算法 */
Hash32
© 2015 - 2024 Weber Informatics LLC | Privacy Policy