public class SecondSnowflakeId extends AbstractSnowflakeId
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MACHINE_BIT |
static int |
DEFAULT_SEQUENCE_BIT |
static long |
DEFAULT_SEQUENCE_RESET_THRESHOLD |
static int |
DEFAULT_TIMESTAMP_BIT |
epoch, lastTimestamp, machineBit, machineId, machineLeft, maxMachine, maxSequence, maxTimestamp, sequence, sequenceBit, timestampBit, timestampLeftTOTAL_BIT| Constructor and Description |
|---|
SecondSnowflakeId(int machineBit,
long machineId) |
SecondSnowflakeId(long machineId) |
SecondSnowflakeId(long epoch,
int timestampBit,
int machineBit,
int sequenceBit,
long machineId) |
SecondSnowflakeId(long epoch,
int timestampBit,
int machineBit,
int sequenceBit,
long machineId,
long sequenceResetThreshold) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
getCurrentTime()
get current timestamp.
|
generate, getEpoch, getLastTimestamp, getMachineBit, getMachineId, getMaxMachine, getMaxSequence, getMaxTimestamp, getSequenceBit, getTimestampBit, nextTimeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdefaultSequenceResetThreshold, isSafeJavascriptgenerateAsString, idConverterpublic static final int DEFAULT_TIMESTAMP_BIT
public static final int DEFAULT_MACHINE_BIT
public static final int DEFAULT_SEQUENCE_BIT
public static final long DEFAULT_SEQUENCE_RESET_THRESHOLD
public SecondSnowflakeId(long machineId)
public SecondSnowflakeId(int machineBit,
long machineId)
public SecondSnowflakeId(long epoch,
int timestampBit,
int machineBit,
int sequenceBit,
long machineId)
public SecondSnowflakeId(long epoch,
int timestampBit,
int machineBit,
int sequenceBit,
long machineId,
long sequenceResetThreshold)
protected long getCurrentTime()
AbstractSnowflakeIdgetCurrentTime in class AbstractSnowflakeId