public Iterator < Result > find ( String startRow , String endRow , List < String > returnFields , QueryOptions options ) throws IOException { Scan scan = new Scan ( startRow . getBytes ( ) , endRow . getBytes ( ) ) ; if ( returnFields != null ) { for ( String field : returnFields ) { String [ ] parts = field . split ( ":" ) ; scan . addColumn ( parts [ 0 ] . getBytes ( ) , parts [ 1 ] . getBytes ( ) ) ; } } else { getReturnFields ( scan , options ) ; } int maxVersions = ( options != null ) ? options . getInt ( "maxVersions" , 0 ) : 0 ; if ( maxVersions > 0 ) { scan . setMaxVersions ( maxVersions ) ; } int limit = ( options != null ) ? options . getInt ( "limit" , 0 ) : 0 ; if ( limit > 0 ) { scan . setFilter ( new PageFilter ( limit ) ) ; } String sort = ( options != null ) ? options . getString ( "sort" ) : null ; if ( sort != null ) { if ( sort . equalsIgnoreCase ( "asc" ) ) { scan . setReversed ( false ) ; } else if ( sort . equalsIgnoreCase ( "desc" ) ) { scan . setReversed ( true ) ; } } ResultScanner scanres = table . getScanner ( scan ) ; return scanres . iterator ( ) ; }
Returns the results from a query to multiple rows performed using a Scan object from HBase API .