From 118f738d7ccb3f5f0c3e724bb67183e0440c201d Mon Sep 17 00:00:00 2001 From: tedyu Date: Tue, 3 Feb 2015 20:07:23 -0800 Subject: [PATCH] HBASE-12957 region_mover#isSuccessfulScan may be extremely slow on region with lots of expired data (Hongyu Bi) --- bin/region_mover.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/region_mover.rb b/bin/region_mover.rb index 7a09854c1ba..78979d91a10 100644 --- a/bin/region_mover.rb +++ b/bin/region_mover.rb @@ -31,6 +31,8 @@ import org.apache.hadoop.hbase.client.Scan import org.apache.hadoop.hbase.client.HTable import org.apache.hadoop.hbase.client.HConnectionManager 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.Writables import org.apache.hadoop.conf.Configuration @@ -95,10 +97,10 @@ end # Trys to scan a row from passed region # Throws exception if can't def isSuccessfulScan(admin, r) - scan = Scan.new(r.getStartKey()) + scan = Scan.new(r.getStartKey(), r.getStartKey()) scan.setBatch(1) scan.setCaching(1) - scan.setFilter(FirstKeyOnlyFilter.new()) + scan.setFilter(FilterList.new(FirstKeyOnlyFilter.new(),InclusiveStopFilter().new(r.getStartKey()))) begin table = HTable.new(admin.getConfiguration(), r.getTableName()) scanner = table.getScanner(scan)