Package org.xipki.ca.server
Class UniqueIdGenerator
- java.lang.Object
-
- org.xipki.ca.server.UniqueIdGenerator
-
public class UniqueIdGenerator extends Object
Unique Identifier Generator.An id consists of
- highest bit is set to 0 to assure positive long.
- epoch in ms: 46 bits for 1312 years after the epoch
- offset: 10 bits
- shard_id: 7 bits
Idea is borrowed from http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram
- Since:
- 2.0.0
- Author:
- Lijun Liao (xipki)
-
-
Constructor Summary
Constructors Constructor Description UniqueIdGenerator(long epoch, int shardId)
-