Skip to content

Instantly share code, notes, and snippets.

@barce
Created June 3, 2010 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barce/424528 to your computer and use it in GitHub Desktop.
Save barce/424528 to your computer and use it in GitHub Desktop.
[info] == com.twitter.service.snowflake.IdWorkerSpec ==
[info] IdWorkerSpec
[info] IdWorker should
[info] + generate an id
[info] + return an accurate timestamp
[info] + return the correct job id
[info] + properly mask server id
[info] + properly mask timestamp
[info] + roll over sequence id
[info] + generate increasing ids
generated 1000000 ids in 269 ms, or 3,717,472 ids/second
[info] + generate 1 million ids quickly
[info] + sleep if we would rollover twice in the same millisecond
[info] + generate only unique ids
[info] validUseragent should
[info] + accept the simple case
[info] + reject numbers
[info] + reject missing product name
[info] == com.twitter.service.snowflake.IdWorkerSpec ==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment