| 接口 | 说明 |
|---|---|
| IdGenerator |
Represents a unique id generator.
|
| 类 | 说明 |
|---|---|
| BitsAllocator |
Allocate 64 bits for the Unique ID(long)
sign (fixed 1bit) -> timestamp -> workerId -> sequence(within the same millisecond) |
| SnowFlakeGenerator |
The unique id has 64bits (long)
+------+----------------------+----------------+-----------+
| sign | delta millisecond | worker node id | sequence |
+------+----------------------+----------------+-----------+
1bit timeBits workerBits seqBits
Note that: The total bits must be 64
sign: The highest bit is 0
delta millisecond:
worker id:
sequence: |
Copyright © 2019. All rights reserved.