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
| Modifier and Type | Field and Description |
|---|---|
static long |
EPOCH |
| Constructor and Description |
|---|
SnowflakeKeyGenerateAlgorithm() |
| Modifier and Type | Method and Description |
|---|---|
Comparable<?> |
generateKey() |
String |
getType() |
void |
init() |
public void init()
init in interface org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmPostProcessorpublic Comparable<?> generateKey()
generateKey in interface KeyGenerateAlgorithmpublic String getType()
getType in interface org.apache.shardingsphere.infra.spi.typed.TypedSPICopyright © 2021 The Apache Software Foundation. All rights reserved.