public abstract class BaseSequence extends Object implements IQuietSequence
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
dataCenterId
数据中心编号
|
protected int |
dataCenterIdBits |
protected int |
dataCenterIdShift |
protected long |
lastTimestamp
最后一次计算的时间
|
protected long |
sequence |
protected int |
sequenceBits |
protected long |
sequenceMask
用mask防止溢出:位与运算保证计算
|
protected int |
workerId
机器编号
|
protected int |
workerIdBits |
protected int |
workerIdShift |
| 构造器和说明 |
|---|
BaseSequence(int workerId,
int dataCenterId,
int workerIdBits,
int dataCenterIdBits,
int sequenceBits) |
protected final int workerId
protected final int dataCenterId
protected final long sequenceMask
protected final int workerIdShift
protected final int dataCenterIdShift
protected final int workerIdBits
protected final int dataCenterIdBits
protected final int sequenceBits
protected long sequence
protected long lastTimestamp
Copyright © 2017–2018. All rights reserved.