public static int rowKeyContainsMetric ( final byte [ ] metric , final byte [ ] row_key ) { int idx = Const . SALT_WIDTH ( ) ; for ( int i = 0 ; i < metric . length ; i ++ , idx ++ ) { if ( metric [ i ] != row_key [ idx ] ) { return ( metric [ i ] & 0xFF ) - ( row_key [ idx ] & 0xFF ) ; // "promote" to unsigned. } } return 0 ; }
Checks a row key to determine if it contains the metric UID . If salting is enabled we skip the salt bytes .