org.apache.hadoop.hbase.client
Class ClientSmallReversedScanner

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.ReversedClientScanner
              extended by org.apache.hadoop.hbase.client.ClientSmallReversedScanner
All Implemented Interfaces:
Closeable, Iterable<Result>, ResultScanner

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class ClientSmallReversedScanner
extends ReversedClientScanner

Client scanner for small reversed scan. Generally, only one RPC is called to fetch the scan results, unless the results cross multiple regions or the row count of results exceed the caching.

For small scan, it will get better performance than ReversedClientScanner


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.client.ClientScanner
cache, caching, callable, caller, closed, currentRegion, lastNext, lastResult, maxScannerResultSize, rpcControllerFactory, scan, scanMetricsPublished, scannerTimeout
 
Fields inherited from class org.apache.hadoop.hbase.client.AbstractClientScanner
scanMetrics
 
Constructor Summary
ClientSmallReversedScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName, HConnection connection)
          Create a new ReversibleClientScanner for the specified table Note that the passed Scan's start row maybe changed.
 
Method Summary
 void close()
          Closes the scanner and releases any resources it has allocated
protected  void initializeScannerInConstruction()
           
protected  void loadCache()
          Contact the servers to load more Results in the cache.
 Result next()
          Grab the next row's worth of values.
protected  void setRpcControllerFactory(RpcControllerFactory rpcControllerFactory)
           
protected  void setRpcRetryingCaller(RpcRetryingCaller<Result[]> caller)
           
protected  void setScannerCallableFactory(ClientSmallScanner.SmallScannerCallableFactory callableFactory)
           
 
Methods inherited from class org.apache.hadoop.hbase.client.ReversedClientScanner
checkScanStopRow, createClosestRowBefore, getScannerCallable, nextScanner
 
Methods inherited from class org.apache.hadoop.hbase.client.ClientScanner
getCacheSize, getConnection, getMaxResultSize, getScan, getScannerCallable, getTable, getTableName, getTimestamp, renewLease, writeScanMetrics
 
Methods inherited from class org.apache.hadoop.hbase.client.AbstractClientScanner
getScanMetrics, initScanMetrics, iterator, next
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSmallReversedScanner

public ClientSmallReversedScanner(org.apache.hadoop.conf.Configuration conf,
                                  Scan scan,
                                  TableName tableName,
                                  HConnection connection)
                           throws IOException
Create a new ReversibleClientScanner for the specified table 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 scan
connection - Connection identifying the cluster
Throws:
IOException
Method Detail

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

loadCache

protected void loadCache()
                  throws IOException
Description copied from class: ClientScanner
Contact the servers to load more Results in the cache.

Overrides:
loadCache in class ClientScanner
Throws:
IOException

initializeScannerInConstruction

protected void initializeScannerInConstruction()
                                        throws IOException
Overrides:
initializeScannerInConstruction in class ClientScanner
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
Overrides:
close in class ClientScanner

setScannerCallableFactory

protected void setScannerCallableFactory(ClientSmallScanner.SmallScannerCallableFactory callableFactory)

setRpcRetryingCaller

protected void setRpcRetryingCaller(RpcRetryingCaller<Result[]> caller)

setRpcControllerFactory

protected void setRpcControllerFactory(RpcControllerFactory rpcControllerFactory)


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.