org.apache.hadoop.hbase.client
Class ClientSmallScanner

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

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class ClientSmallScanner
extends ClientScanner

Client scanner for small scan. Generally, only one RPC is called to fetch the scan results, unless the results cross multiple regions or the row count of results excess the caching. For small scan, it will get better performance than ClientScanner


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.client.ClientScanner
cache, caching, caller, closed, currentRegion, lastNext, lastResult, maxScannerResultSize, scan, scanMetrics, scanMetricsPublished
 
Constructor Summary
ClientSmallScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName)
          Create a new ClientSmallScanner for the specified table.
ClientSmallScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName, HConnection connection)
          Create a new ClientSmallScanner for the specified table.
ClientSmallScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName, HConnection connection, RpcRetryingCallerFactory rpcFactory)
          Create a new ShortClientScanner 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  void initializeScannerInConstruction()
           
 Result next()
          Grab the next row's worth of values.
 
Methods inherited from class org.apache.hadoop.hbase.client.ClientScanner
checkScanStopRow, getConnection, getScan, getScannerCallable, getTable, getTableName, getTimestamp, next, writeScanMetrics
 
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

ClientSmallScanner

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

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

ClientSmallScanner

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

Parameters:
conf -
scan -
tableName -
connection -
Throws:
IOException

ClientSmallScanner

public ClientSmallScanner(org.apache.hadoop.conf.Configuration conf,
                          Scan scan,
                          TableName tableName,
                          HConnection connection,
                          RpcRetryingCallerFactory rpcFactory)
                   throws IOException
Create a new ShortClientScanner 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 rangeGet
connection - Connection identifying the cluster
rpcFactory -
Throws:
IOException
Method Detail

initializeScannerInConstruction

protected void initializeScannerInConstruction()
                                        throws IOException
Overrides:
initializeScannerInConstruction in class ClientScanner
Throws:
IOException

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
Overrides:
next in class ClientScanner
Returns:
Result object if there is another row, null if the scanner is exhausted.
Throws:
IOException - e

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
Overrides:
close in class ClientScanner


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