public LongToken getToken ( ByteBuffer key ) { if ( key . remaining ( ) == 0 ) return MINIMUM ; long [ ] hash = new long [ 2 ] ; MurmurHash . hash3_x64_128 ( key , key . position ( ) , key . remaining ( ) , 0 , hash ) ; return new LongToken ( normalize ( hash [ 0 ] ) ) ; }
Generate the token of a key . Note that we need to ensure all generated token are strictly bigger than MINIMUM . In particular we don t want MINIMUM to correspond to any key because the range ( MINIMUM X ] doesn t include MINIMUM but we use such range to select all data whose token is smaller than X .