org.apache.hadoop.hbase.client
Class HTable.ClientScanner

java.lang.Object
  extended by org.apache.hadoop.hbase.client.HTable.ClientScanner
All Implemented Interfaces:
Closeable, Iterable<Result>, ResultScanner
Enclosing class:
HTable

protected class HTable.ClientScanner
extends Object
implements ResultScanner

Implements the scanner interface for the HBase client. If there are multiple regions in a table, this scanner will iterate through them all.


Constructor Summary
protected HTable.ClientScanner(Scan scan)
           
 
Method Summary
 void close()
          Closes the scanner and releases any resources it has allocated
protected  Scan getScan()
           
protected  ScannerCallable getScannerCallable(byte[] localStartKey, int nbRows)
           
protected  long getTimestamp()
           
 void initialize()
           
 Iterator<Result> iterator()
           
 Result next()
          Grab the next row's worth of values.
 Result[] next(int nbRows)
          Get nbRows rows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTable.ClientScanner

protected HTable.ClientScanner(Scan scan)
Method Detail

initialize

public void initialize()
                throws IOException
Throws:
IOException

getScan

protected Scan getScan()

getTimestamp

protected long getTimestamp()

getScannerCallable

protected ScannerCallable getScannerCallable(byte[] localStartKey,
                                             int nbRows)

next

public Result next()
            throws IOException
Description copied from interface: ResultScanner
Grab the next row's worth of values. The scanner will return a Result.

Specified by:
next in interface ResultScanner
Returns:
Result object if there is another row, null if the scanner is exhausted.
Throws:
IOException - e

next

public Result[] next(int nbRows)
              throws IOException
Get nbRows rows. How many RPCs are made is determined by the Scan.setCaching(int) setting (or hbase.client.scanner.caching in hbase-site.xml).

Specified by:
next in interface ResultScanner
Parameters:
nbRows - number of rows to return
Returns:
Between zero and nbRows RowResults. Scan is done if returned array is of zero-length (We never return null).
Throws:
IOException

close

public void close()
Description copied from interface: ResultScanner
Closes the scanner and releases any resources it has allocated

Specified by:
close in interface Closeable
Specified by:
close in interface ResultScanner

iterator

public Iterator<Result> iterator()
Specified by:
iterator in interface Iterable<Result>


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.