public class IdWorker extends Object
| Constructor and Description |
|---|
IdWorker(Long workerId)
instantiate an IdWorker using given workerId
|
| Modifier and Type | Method and Description |
|---|---|
long |
nextId()
get next UUID(base on snowflake algorithm), which look like:
highest 1 bit: always 0
next 10 bit: workerId
next 41 bit: timestamp
lowest 12 bit: sequence
|
public IdWorker(Long workerId)
workerId - if null, then will auto assign oneCopyright © 2023 Seata. All rights reserved.