public class SnowflakeGenerator extends Object
基于snowflake的ID生成器
An object that generates IDs. This is broken into a separate class in case we ever want to context multiple worker threads per process
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.slf4j.Logger |
LOG |
| 构造器和说明 |
|---|
SnowflakeGenerator(long workerId,
long dataCenterId) |
public static SnowflakeGenerator getInstance()
public long nextId()
protected long tilNextMillis(long lastTimestamp)
protected long timeGen()
Copyright © 2019. All rights reserved.