类 IdWorker
java.lang.Object
com.ksptooi.uac.commons.IdWorker
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected static longgetDatacenterId(long maxDatacenterId) 数据标识id部分protected static longgetMaxWorkerId(long datacenterId, long maxWorkerId) 获取 maxWorkerIdstatic voidlongnextId()获取下一个ID
-
构造器详细资料
-
IdWorker
public IdWorker() -
IdWorker
public IdWorker(long workerId, long datacenterId) - 参数:
workerId- 工作机器IDdatacenterId- 序列号
-
-
方法详细资料
-
nextId
public long nextId()获取下一个ID- 返回:
-
getMaxWorkerId
protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) 获取 maxWorkerId
-
getDatacenterId
protected static long getDatacenterId(long maxDatacenterId) 数据标识id部分
-
main
-