private static Scanner getSuggestScanner ( final HBaseClient client , final byte [ ] tsd_uid_table , final String search , final byte [ ] kind_or_null , final int max_results ) { final byte [ ] start_row ; final byte [ ] end_row ; if ( search . isEmpty ( ) ) { start_row = START_ROW ; end_row = END_ROW ; } else { start_row = toBytes ( search ) ; end_row = Arrays . copyOf ( start_row , start_row . length ) ; end_row [ start_row . length - 1 ] ++ ; } final Scanner scanner = client . newScanner ( tsd_uid_table ) ; scanner . setStartKey ( start_row ) ; scanner . setStopKey ( end_row ) ; scanner . setFamily ( ID_FAMILY ) ; if ( kind_or_null != null ) { scanner . setQualifier ( kind_or_null ) ; } scanner . setMaxNumRows ( max_results <= 4096 ? max_results : 4096 ) ; return scanner ; }
Creates a scanner that scans the right range of rows for suggestions .