
com.github.drinkjava2.jdialects.annotation.jdia.Snowflake Maven / Gradle / Ivy
package com.github.drinkjava2.jdialects.annotation.jdia;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.FIELD;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Mark a Long type column value build by using SnowFlake algorithm from twitter
*
*
* In jDialects SnowFlake algorithm source code originated from:
* https://github.com/downgoon/snowflake
*
* The SnowFlake algorithm follows below basic rule:
* 1 bit const=0
* 41 bits Timestamp based on machine
* 10 bits Confighured by user, used as machine ID, an example is assign 5 bits
* for dataCenterID + 5 bits for workerID
* 12 bits Sequence number
*
*
*/
@Target(FIELD)
@Retention(RUNTIME)
public @interface Snowflake {
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy