From ac190e807739ccf5ae2236b8d39c342d23630358 Mon Sep 17 00:00:00 2001 From: stack Date: Tue, 7 Apr 2015 17:07:39 -0700 Subject: [PATCH] HBASE-13377 Canary may generate false alarm on the first region when there are many delete markers (He Liangliang) Amending-Author: Andrew Purtell Conflicts: hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java --- .../src/main/java/org/apache/hadoop/hbase/tool/Canary.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java index 625828f2510..1dfe115512a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java @@ -56,6 +56,7 @@ import org.apache.hadoop.hbase.client.RegionLocator; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; @@ -551,10 +552,15 @@ public final class Canary implements Tool { // Can't do a get on empty start row so do a Scan of first element if any instead. if (startKey.length > 0) { get = new Get(startKey); + get.setCacheBlocks(false); + get.setFilter(new FirstKeyOnlyFilter()); get.addFamily(column.getName()); } else { scan = new Scan(); + scan.setRaw(true); scan.setCaching(1); + scan.setCacheBlocks(false); + scan.setFilter(new FirstKeyOnlyFilter()); scan.addFamily(column.getName()); scan.setMaxResultSize(1L); }