public class Sequence extends Object
| Constructor and Description |
|---|
Sequence() |
Sequence(long workerId,
long datacenterId)
有参构造器
|
| Modifier and Type | Method and Description |
|---|---|
protected static long |
getDatacenterId(long maxDatacenterId)
数据标识id部分
|
protected static long |
getMaxWorkerId(long datacenterId,
long maxWorkerId)
获取 maxWorkerId
|
long |
nextId()
获取下一个 ID
|
protected long |
tilNextMillis(long lastTimestamp) |
protected long |
timeGen() |
public Sequence()
public Sequence(long workerId,
long datacenterId)
workerId - 工作机器 IDdatacenterId - 序列号protected static long getMaxWorkerId(long datacenterId,
long maxWorkerId)
protected static long getDatacenterId(long maxDatacenterId)
public long nextId()
protected long tilNextMillis(long lastTimestamp)
protected long timeGen()
Copyright © 2020. All rights reserved.