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
StringHashUtil.index 方法,按照文章介绍这里不是取模吗? 但代码好像直接是除法了
public static int index(int slot, int shardingCount) { int segment = 1024 / shardingCount; int index = slot / segment; return index; }
The text was updated successfully, but these errors were encountered:
我的思路是这样的:假如有四个分片,segment = 1024/4 = 256 , slot 是对 1024取余 ,所以 slot / segment = 该 shardingkey 对应的分片。
Sorry, something went wrong.
@makemyownlife 勇哥,这个地方我提交了个一致性hash算法实现,你那种写法,如果后面新增或者减少节点,会对存量数据有较大的影响。
No branches or pull requests
StringHashUtil.index 方法,按照文章介绍这里不是取模吗? 但代码好像直接是除法了
The text was updated successfully, but these errors were encountered: