Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.0 f88b76662 -> 918990971
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/91899097 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/91899097 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/91899097 Branch: refs/heads/4.x-HBase-1.0 Commit: 918990971d321ed70b37f74cb8e7b4844f427841 Parents: f88b766 Author: Ankit Singhal <[email protected]> Authored: Fri Feb 19 22:28:56 2016 +0530 Committer: Ankit Singhal <[email protected]> Committed: Fri Feb 19 22:28:56 2016 +0530 ---------------------------------------------------------------------- .../phoenix/schema/stats/DefaultStatisticsCollector.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/91899097/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 38e1ca5..ce6e7db 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 @@ -125,6 +125,14 @@ 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()) {
