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
单实例下,现有128个分库,8039709005,5907536637 这两个字符串,我用他们的hashcode取值后,对1024取模,结果是543,-383。怎么算也不在一个库里。请教下,字符串是怎么计算分片的
The text was updated successfully, but these errors were encountered:
PartitionByString.java 对字符串计算分片,里面有计算hash的函数。
hashcode & 1023 得到的应该在哪个分片上。
Sorry, something went wrong.
(hashcode & 1023)等价于(hashcode % 1024),主要是为了提高性能。落在哪个分片要看hashcode具体的值。 @zhukunqian
No branches or pull requests
单实例下,现有128个分库,8039709005,5907536637 这两个字符串,我用他们的hashcode取值后,对1024取模,结果是543,-383。怎么算也不在一个库里。请教下,字符串是怎么计算分片的
The text was updated successfully, but these errors were encountered: