static byte [ ] getValueId ( final TSDB tsdb , final byte [ ] row , final byte [ ] tag_id ) { final short name_width = tsdb . tag_names . width ( ) ; final short value_width = tsdb . tag_values . width ( ) ; // TODO(tsuna): Can do a binary search. for ( short pos = ( short ) ( Const . SALT_WIDTH ( ) + tsdb . metrics . width ( ) + Const . TIMESTAMP_BYTES ) ; pos < row . length ; pos += name_width + value_width ) { if ( rowContains ( row , pos , tag_id ) ) { pos += name_width ; return Arrays . copyOfRange ( row , pos , pos + value_width ) ; } } return null ; }
Extracts the value ID of the given tag UD name from the given row key .