public final class SnowflakeKeyGenerateAlgorithm extends Object implements KeyGenerateAlgorithm
Length of key is 64 bit.
1 bit sign bit.
41 bits timestamp offset from 2016.11.01(ShardingSphere distributed primary key published data) to now.
10 bits worker process id.
12 bits auto increment offset in one mills
| 限定符和类型 | 字段和说明 |
|---|---|
static long |
EPOCH |
| 构造器和说明 |
|---|
SnowflakeKeyGenerateAlgorithm() |
public void init()
init 在接口中 org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmPostProcessorpublic Comparable<?> generateKey()
generateKey 在接口中 KeyGenerateAlgorithmpublic String getType()
getType 在接口中 org.apache.shardingsphere.spi.typed.TypedSPIpublic boolean isDefault()
isDefault 在接口中 org.apache.shardingsphere.spi.required.RequiredSPICopyright © 2021 The Apache Software Foundation. All rights reserved.