public class IdWorker extends Object
| 构造器和说明 |
|---|
IdWorker(long workerId)
Constructor
|
| 限定符和类型 | 方法和说明 |
|---|---|
static IdWorker |
getInstance() |
static void |
init(Long serverNodeId) |
static long |
initWorkerId() |
long |
nextId()
Get the next ID (the method is thread-safe)
|
protected long |
tilNextMillis(long lastTimestamp)
Block until the next millisecond until a new timestamp is obtained
|
protected long |
timeGen()
Returns the current time in milliseconds
|
public long nextId()
protected long tilNextMillis(long lastTimestamp)
lastTimestamp - Time of last ID generationprotected long timeGen()
public static IdWorker getInstance()
public static long initWorkerId()
public static void init(Long serverNodeId)
Copyright © 2020 Seata. All rights reserved.