public class IdWorker
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
private long |
lastTimestamp |
protected org.apache.commons.logging.Log |
log |
private long |
maxWorkerId |
private long |
sequence |
private long |
sequenceBits |
private long |
sequenceMask |
private long |
timestampLeftShift |
private long |
workerId |
private long |
workerIdBits |
private long |
workerIdShift |
构造器和说明 |
---|
IdWorker(long workerId) |
限定符和类型 | 方法和说明 |
---|---|
long |
nextId() |
protected long |
tilNextMillis(long lastTimestamp)
阻塞到下一个毫秒,直到获得新的时间戳
|
protected long |
timeGen()
返回以毫秒为单位的当前时间
|
protected final org.apache.commons.logging.Log log
private long workerId
private long sequence
private long workerIdBits
private long maxWorkerId
private long sequenceBits
private long workerIdShift
private long timestampLeftShift
private long sequenceMask
private long lastTimestamp