public class Sequence extends Object
Constructor and Description |
---|
Sequence(long workerId,
long dataCenterId)
基于Snowflake创建分布式ID生成器
|
public Sequence(long workerId, long dataCenterId)
注:sequence
workerId
- 工作机器ID,数据范围为0~31dataCenterId
- 数据中心ID,数据范围为0~31public void setClock(boolean clock)
public Long nextId()
Copyright © 2018. All rights reserved.