HBASE-12957 region_mover#isSuccessfulScan may be extremely slow on region with lots of expired data (Hongyu Bi)
This commit is contained in:
parent
e3032b1770
commit
118f738d7c
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue