org.apache.hadoop.hbase.client
Class AbstractClientScanner

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

@InterfaceAudience.Private
public abstract class AbstractClientScanner
extends Object
implements ResultScanner

Helper class for custom client scanners.


Field Summary
protected  ScanMetrics scanMetrics
           
 
Constructor Summary
AbstractClientScanner()
           
 
Method Summary
 ScanMetrics getScanMetrics()
           
protected  void initScanMetrics(Scan scan)
          Check and initialize if application wants to collect scan metrics
 Iterator<Result> iterator()
           
 Result[] next(int nbRows)
          Get nbRows rows.
abstract  boolean renewLease()
          Allow the client to renew the scanner's lease on the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hbase.client.ResultScanner
close, next
 

Field Detail

scanMetrics

protected ScanMetrics scanMetrics
Constructor Detail

AbstractClientScanner

public AbstractClientScanner()
Method Detail

initScanMetrics

protected void initScanMetrics(Scan scan)
Check and initialize if application wants to collect scan metrics


getScanMetrics

public ScanMetrics getScanMetrics()

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

iterator

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

renewLease

public abstract boolean renewLease()
Allow the client to renew the scanner's lease on the server.

Returns:
true if the lease was successfully renewed, false otherwise.


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.