public class SFIdProducer extends Object implements IdProducer<Long,IdInfo>
| 限定符和类型 | 字段和说明 |
|---|---|
protected IdInfo |
idInfo |
protected long |
startTimestamp
起始时间戳,id中有效值 ,这个值的设置直接影响到id的使用年限
|
| 构造器和说明 |
|---|
SFIdProducer(IdInfo idInfo) |
| 限定符和类型 | 方法和说明 |
|---|---|
IdInfo |
analyze(Long id) |
Long |
next() |
protected void |
saveLastTimestamp(long lastTimestamp)
保存最后时间戳
|
void |
setLastTimestamp(long lastTimestamp) |
void |
setStartTimestamp(long startTimestamp) |
protected final IdInfo idInfo
protected long startTimestamp
public SFIdProducer(IdInfo idInfo)
public final void setStartTimestamp(long startTimestamp)
public final void setLastTimestamp(long lastTimestamp)
protected void saveLastTimestamp(long lastTimestamp)
public final Long next()
next 在接口中 IdProducer<Long,IdInfo>Copyright © 2022. All rights reserved.