We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这是TreeMap的源码.
public class TreeMapConsistentHash extends AbstractConsistentHash { private TreeMap<Long,String> treeMap = new TreeMap<Long, String>() ; /** * 虚拟节点数量 */ private static final int VIRTUAL_NODE_SIZE = 2 ; @Override public void add(long key, String value) { for (int i = 0; i < VIRTUAL_NODE_SIZE; i++) { Long hash = super.hash("vir" + key + i); treeMap.put(hash,value); } treeMap.put(key, value); }
这里存在一个bug啊,当有一个节点下线时,虽然ServerCache更新了, 但这里的treeMap里面的数据是一直存在的.那么在获取路由时就会获取到已经下了线的Netty服务器地址.
The text was updated successfully, but these errors were encountered:
收到,近期会修复。
Sorry, something went wrong.
fix #79
bdb846e
那现在这个add方法在clear了以后不是任何时候都只有一个了吗。
Successfully merging a pull request may close this issue.
这是TreeMap的源码.
这里存在一个bug啊,当有一个节点下线时,虽然ServerCache更新了,
但这里的treeMap里面的数据是一直存在的.那么在获取路由时就会获取到已经下了线的Netty服务器地址.
The text was updated successfully, but these errors were encountered: