public HybridTimestampFactory ( int counterBits ) { if ( counterBits < 0 || counterBits > 31 ) { throw new IllegalArgumentException ( "counterBits must be in [0:31]" ) ; } lastTimestamp = 0L ; this . counterBits = counterBits ; maxCounter = BigInteger . valueOf ( 2 ) . pow ( counterBits ) . intValue ( ) - 1 ; log . warn ( "#counterBits=" + counterBits + ", maxCounter=" + maxCounter ) ; }
Allows up to < code > 2^counterBits < /code > distinct timestamps per millisecond .