public class SequenceTools extends Object
Constructor and Description |
---|
SequenceTools(long workerId,
long datacenterId) |
Modifier and Type | Method and Description |
---|---|
long |
nextId()
获得下一个ID (该方法是线程安全的)
|
protected long |
tilNextMillis(long lastTimestamp)
阻塞到下一个毫秒,直到获得新的时间戳
|
protected long |
timeGen()
返回以毫秒为单位的当前时间
|
Copyright © 2018. All rights reserved.