public class MillisecondSnowflakeId extends SnowflakeId
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_MACHINE_BIT |
static int |
DEFAULT_SEQUENCE_BIT |
static int |
DEFAULT_TIMESTAMP_BIT |
epoch, lastStamp, machineBit, machineId, machineLeft, maxMachine, maxSequence, maxTimestamp, sequence, sequenceBit, timestampBit, timestampLeft, TOTAL_BIT| 构造器和说明 |
|---|
MillisecondSnowflakeId(int machineId) |
MillisecondSnowflakeId(long epoch,
int timestampBit,
int machineBit,
int sequenceBit,
int machineId) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected long |
getCurrentTime()
获取当前时间戳
|
generate, getEpoch, getMachineBit, getMaxMachine, getMaxSequence, getMaxTimestamp, getSequenceBit, getTimestampBit, nextTimepublic static final int DEFAULT_TIMESTAMP_BIT
public static final int DEFAULT_MACHINE_BIT
public static final int DEFAULT_SEQUENCE_BIT
public MillisecondSnowflakeId(int machineId)
public MillisecondSnowflakeId(long epoch,
int timestampBit,
int machineBit,
int sequenceBit,
int machineId)
protected long getCurrentTime()
SnowflakeIdgetCurrentTime 在类中 SnowflakeId