mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 09:38:26 +08:00
机器Id位数备注修改
经测试,该实现机器Id范围为0~9,当超过9时会进位到【毫秒内的时间自增】位。 Signed-off-by: duxlei <admakeit@163.com>
This commit is contained in:
parent
d68e66a2e6
commit
dc9b75e9d4
@ -33,7 +33,7 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||||||
* 1、每台机器允许最大的并发量为 10w/s。
|
* 1、每台机器允许最大的并发量为 10w/s。
|
||||||
* 2、出现时间回拨,重启机器时,在时间回拨未恢复的情况下,可能出现 id 重复。
|
* 2、出现时间回拨,重启机器时,在时间回拨未恢复的情况下,可能出现 id 重复。
|
||||||
* <p>
|
* <p>
|
||||||
* ID组成:时间(7+)| 毫秒内的时间自增 (00~99:2)| 机器ID(01 ~ 99:2)| 随机数(000~999:3)用于分库分表时,通过 id 取模,保证分布均衡。
|
* ID组成:时间(7+)| 毫秒内的时间自增 (00~99:2)| 机器ID(0 ~ 9:1)| 随机数(000~999:3)用于分库分表时,通过 id 取模,保证分布均衡。
|
||||||
*/
|
*/
|
||||||
public class FlexIDKeyGenerator implements IKeyGenerator {
|
public class FlexIDKeyGenerator implements IKeyGenerator {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user