private static int partitionForKey ( byte [ ] key , int numPartitions ) { CRC32 crc32 = new CRC32 ( ) ; crc32 . update ( key ) ; long rv = ( crc32 . getValue ( ) >> 16 ) & 0x7fff ; return ( int ) rv & numPartitions - 1 ; }
Calculate the vbucket for the given key .