org.apache.hadoop.hbase.client
Class ClientScanner

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

@InterfaceAudience.Public
@InterfaceStability.Stable
public class ClientScanner
extends AbstractClientScanner

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
ClientScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName)
          Create a new ClientScanner for the specified table.
ClientScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName, HConnection connection)
          Create a new ClientScanner for the specified table Note that the passed Scan's start row maybe changed changed.
ClientScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName, HConnection connection, RpcRetryingCallerFactory rpcFactory)
          Create a new ClientScanner for the specified table Note that the passed Scan's start row maybe changed changed.
 
Method Summary
 void close()
          Closes the scanner and releases any resources it has allocated
protected  HConnection getConnection()
           
protected  Scan getScan()
           
protected  ScannerCallable getScannerCallable(byte[] localStartKey, int nbRows)
           
protected  TableName getTableName()
           
protected  long getTimestamp()
           
 Result next()
          Grab the next row's worth of values.
 Result[] next(int nbRows)
          Get nbRows rows.
 
Methods inherited from class org.apache.hadoop.hbase.client.AbstractClientScanner
iterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientScanner

public ClientScanner(org.apache.hadoop.conf.Configuration conf,
                     Scan scan,
                     TableName tableName)
              throws IOException
Create a new ClientScanner for the specified table. An HConnection will be retrieved using the passed Configuration. Note that the passed Scan's start row maybe changed changed.

Parameters:
conf - The Configuration to use.
scan - Scan to use in this scanner
tableName - The table that we wish to scan
Throws:
IOException

ClientScanner

public ClientScanner(org.apache.hadoop.conf.Configuration conf,
                     Scan scan,
                     TableName tableName,
                     HConnection connection)
              throws IOException
Create a new ClientScanner for the specified table Note that the passed Scan's start row maybe changed changed.

Parameters:
conf - The Configuration to use.
scan - Scan to use in this scanner
tableName - The table that we wish to scan
connection - Connection identifying the cluster
Throws:
IOException

ClientScanner

public ClientScanner(org.apache.hadoop.conf.Configuration conf,
                     Scan scan,
                     TableName tableName,
                     HConnection connection,
                     RpcRetryingCallerFactory rpcFactory)
              throws IOException
Create a new ClientScanner for the specified table Note that the passed Scan's start row maybe changed changed.

Parameters:
conf - The Configuration to use.
scan - Scan to use in this scanner
tableName - The table that we wish to scan
connection - Connection identifying the cluster
Throws:
IOException
Method Detail

getConnection

protected HConnection getConnection()

getTableName

protected TableName getTableName()

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.

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).

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



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