HBASE-9606 Apply small scan to meta scan where rowLimit is low

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1525634 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2013-09-23 16:05:30 +00:00
parent 0edcdfa4e3
commit ae42059586
2 changed files with 9 additions and 3 deletions

View File

@ -163,8 +163,12 @@ public class MetaScanner {
HConstants.ZEROES, false);
}
final Scan scan = new Scan(startRow).addFamily(HConstants.CATALOG_FAMILY);
int rows = Math.min(rowLimit, configuration.getInt(HConstants.HBASE_META_SCANNER_CACHING,
HConstants.DEFAULT_HBASE_META_SCANNER_CACHING));
int scannerCaching = configuration.getInt(HConstants.HBASE_META_SCANNER_CACHING,
HConstants.DEFAULT_HBASE_META_SCANNER_CACHING);
if (rowUpperLimit <= scannerCaching) {
scan.setSmall(true);
}
int rows = Math.min(rowLimit, scannerCaching);
scan.setCaching(rows);
if (LOG.isTraceEnabled()) {
LOG.trace("Scanning " + metaTableName.getNameAsString() + " starting at row=" +

View File

@ -738,9 +738,11 @@ public class Scan extends OperationWithAttributes {
* considered as a small scan.
*
* @param small
* @return this instance
*/
public void setSmall(boolean small) {
public Scan setSmall(boolean small) {
this.small = small;
return this;
}
/**