Class CosIdSnowflakeKeyGenerateAlgorithm
java.lang.Object
org.apache.shardingsphere.sharding.cosid.algorithm.keygen.CosIdSnowflakeKeyGenerateAlgorithm
- All Implemented Interfaces:
org.apache.shardingsphere.infra.instance.InstanceContextAware,org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI,KeyGenerateAlgorithm
public final class CosIdSnowflakeKeyGenerateAlgorithm
extends Object
implements KeyGenerateAlgorithm, org.apache.shardingsphere.infra.instance.InstanceContextAware
CosId snowflake key generate algorithm.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionComparable<?>getType()voidinit(Properties props) voidsetInstanceContext(org.apache.shardingsphere.infra.instance.InstanceContext instanceContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm
isSupportAutoIncrementMethods inherited from interface org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI
getTypeAliases, isDefault
-
Field Details
-
DEFAULT_EPOCH
public static final long DEFAULT_EPOCH -
AS_STRING_KEY
- See Also:
-
EPOCH_KEY
- See Also:
-
-
Constructor Details
-
CosIdSnowflakeKeyGenerateAlgorithm
public CosIdSnowflakeKeyGenerateAlgorithm()
-
-
Method Details
-
init
- Specified by:
initin interfaceorg.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI
-
setInstanceContext
public void setInstanceContext(org.apache.shardingsphere.infra.instance.InstanceContext instanceContext) - Specified by:
setInstanceContextin interfaceorg.apache.shardingsphere.infra.instance.InstanceContextAware
-
generateKey
- Specified by:
generateKeyin interfaceKeyGenerateAlgorithm
-
getType
- Specified by:
getTypein interfaceorg.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI
-