1
0
mirror of synced 2026-04-20 07:18:40 +08:00

auto commit

This commit is contained in:
yitter
2021-09-27 14:30:35 +08:00
parent 069cf45625
commit 1e2cd11be2
6 changed files with 138 additions and 17 deletions

View File

@@ -146,7 +146,7 @@ QQ群646049993
***WorkerIdBitLength***,机器码位长,决定 WorkerId 的最大值,**默认值6**,取值范围 [1, 19],实际上有些语言采用 无符号 ushort (uint16) 类型接收该参数所以最大值是16如果是采用 有符号 short (int16)则最大值为15。
**WorkerId**,机器码,**最重要参数**,无默认值,必须 **全局唯一**,必须 **程序设定**缺省条件WorkerIdBitLength取默认值时最大值63理论最大值 2^WorkerIdBitLength-1不同实现语言可能会限定在 65535 或 32767原理同 WorkerIdBitLength 规则)。不同机器或不同应用实例 **不能相同**你可通过应用程序配置该值也可通过调用外部服务获取值。针对自动注册WorkerId需求本算法提供默认实现通过 redis 自动注册 WorkerId 的动态库详见“Tools\AutoRegisterWorkerId”。
**WorkerId**,机器码,**最重要参数**,无默认值,必须 **全局唯一**(或相同 DataCenterId 内唯一),必须 **程序设定**缺省条件WorkerIdBitLength取默认值时最大值63理论最大值 2^WorkerIdBitLength-1不同实现语言可能会限定在 65535 或 32767原理同 WorkerIdBitLength 规则)。不同机器或不同应用实例 **不能相同**你可通过应用程序配置该值也可通过调用外部服务获取值。针对自动注册WorkerId需求本算法提供默认实现通过 redis 自动注册 WorkerId 的动态库详见“Tools\AutoRegisterWorkerId”。
**特别提示**:如果一台服务器部署多个独立服务,需要为每个服务指定不同的 WorkerId。
@@ -158,6 +158,14 @@ QQ群646049993
***BaseTime***基础时间也称基点时间、原点时间、纪元时间有默认值2020年是毫秒时间戳是整数.NET是DatetTime类型作用是用生成ID时的系统时间与基础时间的差值毫秒数作为生成ID的时间戳。基础时间一般无需设置如果觉得默认值太老你可以重新设置不过要注意这个值以后最好不变。
第二版增加参数(非必须):
***DataCenterId***数据中心ID默认0请确保全局唯一。
***DataCenterIdBitLength***数据中心ID长度默认0
***TimestampType***时间戳类型0-毫秒1-秒默认0。
#### 常规集成