public class SnowFlakeSequence extends Object implements IdSequence
+------+----------------------+----------------+-----------+
| sign | delta millisecond | worker node id | sequence |
+------+----------------------+----------------+-----------+
1bit timeBits workerBits seqBits
Note that: The total bits must be 64
| 构造器和说明 |
|---|
SnowFlakeSequence(int timeBits,
int workerBits,
int seqBits,
long epochTimestamp,
long workerId) |
SnowFlakeSequence(TimeUnit timeUnit,
int timeBits,
int workerBits,
int seqBits,
long epochTimestamp,
long workerId) |
public SnowFlakeSequence(int timeBits,
int workerBits,
int seqBits,
long epochTimestamp,
long workerId)
public SnowFlakeSequence(TimeUnit timeUnit, int timeBits, int workerBits, int seqBits, long epochTimestamp, long workerId)
public long nextId()
nextId 在接口中 IdSequenceSnowFlakeException - in the case: Clock moved backwards; Exceeds the max timestamppublic String parse(long id)
IdSequenceparse 在接口中 IdSequenceCopyright © 2018. All rights reserved.