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<RowResult>, Scanner
Direct Known Subclasses:
TransactionalTable.TransactionalClientScanner
Enclosing class:
HTable

protected class HTable.ClientScanner
extends Object
implements Scanner

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


Field Summary
protected  RowFilterInterface filter
           
protected  long scanTime
           
 
Constructor Summary
protected HTable.ClientScanner(byte[][] columns, byte[] startRow, long timestamp, RowFilterInterface filter)
           
 
Method Summary
 void close()
          Closes the scanner and releases any resources it has allocated
protected  byte[][] getColumns()
           
protected  RowFilterInterface getFilter()
           
protected  ScannerCallable getScannerCallable(byte[] localStartKey, int nbRows)
           
protected  long getTimestamp()
           
 void initialize()
           
 Iterator<RowResult> iterator()
           
 RowResult next()
          Grab the next row's worth of values.
 RowResult[] next(int nbRows)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scanTime

protected long scanTime

filter

protected RowFilterInterface filter
Constructor Detail

HTable.ClientScanner

protected HTable.ClientScanner(byte[][] columns,
                               byte[] startRow,
                               long timestamp,
                               RowFilterInterface filter)
Method Detail

initialize

public void initialize()
                throws IOException
Throws:
IOException

getColumns

protected byte[][] getColumns()

getTimestamp

protected long getTimestamp()

getFilter

protected RowFilterInterface getFilter()

getScannerCallable

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

next

public RowResult next()
               throws IOException
Description copied from interface: Scanner
Grab the next row's worth of values. The scanner will return a RowResult that contains both the row's key and a map of byte[] column names to Cell value objects. The data returned will only contain the most recent data value for each row that is not newer than the target time passed when the scanner was created.

Specified by:
next in interface Scanner
Returns:
RowResult object if there is another row, null if the scanner is exhausted.
Throws:
IOException

next

public RowResult[] next(int nbRows)
                 throws IOException
Specified by:
next in interface Scanner
Parameters:
nbRows - number of rows to return
Returns:
Between zero and nbRows RowResults
Throws:
IOException

close

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

Specified by:
close in interface Closeable
Specified by:
close in interface Scanner

iterator

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


Copyright © 2008 The Apache Software Foundation