Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 508751847 -> eac2ba7e7


PHOENIX-2696 Delete stale stats for a region if in later run no guidePosts 
found for that region(Ankit Singhal)


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/eac2ba7e
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/eac2ba7e
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/eac2ba7e

Branch: refs/heads/4.x-HBase-0.98
Commit: eac2ba7e770cfd0bec9d4f1a2e5e08bf7a3aa171
Parents: 5087518
Author: Ankit Singhal <ankitsingha...@gmail.com>
Authored: Fri Feb 19 22:29:43 2016 +0530
Committer: Ankit Singhal <ankitsingha...@gmail.com>
Committed: Fri Feb 19 22:29:43 2016 +0530

----------------------------------------------------------------------
 .../phoenix/schema/stats/DefaultStatisticsCollector.java     | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/eac2ba7e/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/DefaultStatisticsCollector.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/DefaultStatisticsCollector.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/DefaultStatisticsCollector.java
index e7ba443..c56c102 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/DefaultStatisticsCollector.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/DefaultStatisticsCollector.java
@@ -124,6 +124,14 @@ public class DefaultStatisticsCollector implements 
StatisticsCollector {
             throws IOException {
         try {
             // update the statistics table
+            // Delete statistics for a region if no guidepost is collected for 
that region during UPDATE STATISTICS
+            // This will not impact a stats collection of single column family 
during compaction as
+            // guidePostsInfoWriterMap cannot be empty in this case.
+            if (guidePostsInfoWriterMap.keySet().isEmpty()) {
+                for (Store store : region.getStores()) {
+                    statsTable.deleteStats(region, this, new 
ImmutableBytesPtr(store.getFamily().getName()), mutations);
+                }
+            }
             for (ImmutableBytesPtr fam : guidePostsInfoWriterMap.keySet()) {
                 if (delete) {
                     if (logger.isDebugEnabled()) {

Reply via email to