public class ClockSyncSnowflakeId extends java.lang.Object implements SnowflakeId, IdGeneratorDecorator
TOTAL_BIT| Constructor and Description |
|---|
ClockSyncSnowflakeId(SnowflakeId actual) |
ClockSyncSnowflakeId(SnowflakeId actual,
ClockBackwardsSynchronizer clockBackwardsSynchronizer) |
| Modifier and Type | Method and Description |
|---|---|
long |
generate()
Generate distributed ID.
|
SnowflakeId |
getActual()
Get decorator actual id generator.
|
long |
getEpoch() |
long |
getLastTimestamp() |
int |
getMachineBit() |
long |
getMachineId() |
long |
getMaxMachine() |
long |
getMaxSequence() |
long |
getMaxTimestamp() |
int |
getSequenceBit() |
int |
getTimestampBit() |
boolean |
isSafeJavascript()
是否是 Javascript 安全的 SnowflakeId.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdefaultSequenceResetThresholdgetActualgenerateAsString, idConverterpublic ClockSyncSnowflakeId(SnowflakeId actual)
public ClockSyncSnowflakeId(SnowflakeId actual, ClockBackwardsSynchronizer clockBackwardsSynchronizer)
public SnowflakeId getActual()
IdGeneratorDecoratorgetActual in interface IdGeneratorDecoratorpublic long generate()
IdGeneratorgenerate in interface IdGeneratorgenerate in interface IdGeneratorDecoratorpublic long getEpoch()
getEpoch in interface SnowflakeIdpublic int getTimestampBit()
getTimestampBit in interface SnowflakeIdpublic int getMachineBit()
getMachineBit in interface SnowflakeIdpublic int getSequenceBit()
getSequenceBit in interface SnowflakeIdpublic boolean isSafeJavascript()
SnowflakeIdSafeJavaScriptSnowflakeId.JAVA_SCRIPT_MAX_SAFE_NUMBER_BIT.isSafeJavascript in interface SnowflakeIdpublic long getMaxTimestamp()
getMaxTimestamp in interface SnowflakeIdpublic long getMaxMachine()
getMaxMachine in interface SnowflakeIdpublic long getMaxSequence()
getMaxSequence in interface SnowflakeIdpublic long getLastTimestamp()
getLastTimestamp in interface SnowflakeIdpublic long getMachineId()
getMachineId in interface SnowflakeId