Documentation ¶
Overview ¶
* 1 42 52 64 * +-----------------------------------------------+------------+---------------+ * | timestamp(ms) | workerid | sequence | * +-----------------------------------------------+------------+---------------+ * | 0000000000 0000000000 0000000000 0000000000 0 | 0000000000 | 0000000000 00 | * +-----------------------------------------------+------------+---------------+ * * 1. 41位时间截(毫秒级),注意这是时间截的差值(当前时间截 - 开始时间截)。可以使用约70年: (1L << 41) / (1000L * 60 * 60 * 24 * 365) = 69 * 2. 10位数据机器位,可以部署在1024个节点 * 3. 12位序列,毫秒内的计数,同一机器,同一时间截并发4096个序号
Click to show internal directories.
Click to hide internal directories.