HBASE-12957 region_mover#isSuccessfulScan may be extremely slow on region with lots of expired data (Hongyu Bi)

This commit is contained in:
tedyu 2015-02-03 20:07:23 -08:00
parent e3032b1770
commit 118f738d7c
1 changed files with 4 additions and 2 deletions

View File

@ -31,6 +31,8 @@ import org.apache.hadoop.hbase.client.Scan
import org.apache.hadoop.hbase.client.HTable import org.apache.hadoop.hbase.client.HTable
import org.apache.hadoop.hbase.client.HConnectionManager import org.apache.hadoop.hbase.client.HConnectionManager
import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter; import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
import org.apache.hadoop.hbase.filter.InclusiveStopFilter;
import org.apache.hadoop.hbase.filter.FilterList;
import org.apache.hadoop.hbase.util.Bytes import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.util.Writables import org.apache.hadoop.hbase.util.Writables
import org.apache.hadoop.conf.Configuration import org.apache.hadoop.conf.Configuration
@ -95,10 +97,10 @@ end
# Trys to scan a row from passed region # Trys to scan a row from passed region
# Throws exception if can't # Throws exception if can't
def isSuccessfulScan(admin, r) def isSuccessfulScan(admin, r)
scan = Scan.new(r.getStartKey()) scan = Scan.new(r.getStartKey(), r.getStartKey())
scan.setBatch(1) scan.setBatch(1)
scan.setCaching(1) scan.setCaching(1)
scan.setFilter(FirstKeyOnlyFilter.new()) scan.setFilter(FilterList.new(FirstKeyOnlyFilter.new(),InclusiveStopFilter().new(r.getStartKey())))
begin begin
table = HTable.new(admin.getConfiguration(), r.getTableName()) table = HTable.new(admin.getConfiguration(), r.getTableName())
scanner = table.getScanner(scan) scanner = table.getScanner(scan)