类 Sequence
- java.lang.Object
-
- team.bangbang.common.data.generator.Sequence
-
public class Sequence extends java.lang.Object分布式高效有序ID生产黑科技(sequence)- 作者:
- lry
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 protected static longgetDatacenterId(long maxDatacenterId)protected static longgetMaxWorkerId(long datacenterId, long maxWorkerId)获取 maxWorkerIdlongnextId()获取下一个IDprotected longtilNextMillis(long lastTimestamp)protected longtimeGen()
-
-
-
方法详细资料
-
nextId
public long nextId()
获取下一个ID- 返回:
- 下一个ID
-
tilNextMillis
protected long tilNextMillis(long lastTimestamp)
-
timeGen
protected long timeGen()
-
getMaxWorkerId
protected static long getMaxWorkerId(long datacenterId, long maxWorkerId)获取 maxWorkerId- 参数:
datacenterId- I don't knowmaxWorkerId- I don't know- 返回:
- I don't know
-
getDatacenterId
protected static long getDatacenterId(long maxDatacenterId)
- 参数:
maxDatacenterId- I don't know- 返回:
- 数据标识id部分
-
-