Repository: hbase Updated Branches: refs/heads/0.98 409983a99 -> beab86116
HBASE-12957 region_mover#isSuccessfulScan may be extremely slow on region with lots of expired data (Hongyu Bi) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/beab8611 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/beab8611 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/beab8611 Branch: refs/heads/0.98 Commit: beab86116db20a3c9287184084e55625d1bec313 Parents: 409983a Author: tedyu <[email protected]> Authored: Tue Feb 3 20:07:23 2015 -0800 Committer: Andrew Purtell <[email protected]> Committed: Thu Feb 5 18:34:47 2015 -0800 ---------------------------------------------------------------------- bin/region_mover.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/beab8611/bin/region_mover.rb ---------------------------------------------------------------------- diff --git a/bin/region_mover.rb b/bin/region_mover.rb index de25170..36105dd 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 @@ -97,10 +99,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)
