简体   繁体   中英

Hbase scan timeout

I know Hbase timeouts can be configured db-wide, but I was wondering if it's possible to set a timeout for a Scan from Java? Ideally I would like to be able to set a max timeout for the entire scan, such that I'd stop processing after 1 second.

See if this helps : http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HConstants.html#HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD

I doubt if it is included in the latest stable release. You have to build it yourself in that case.

You can use these constants in HConstants:

HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD

public static String HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD
The client scanner timeout period in milliseconds.
DEFAULT_HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD

public static int DEFAULT_HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD
Default value of HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD.

The code use case:

HTable.scannerTimeout

this.scannerTimeout =   
     (int) conf.getLong(HConstants.HBASE_REGIONSERVER_LEASE_PERIOD_KEY, HConstants.DEFAULT_HBASE_REGIONSERVER_LEASE_PERIOD);  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM