hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From the...@apache.org
Subject hive git commit: HIVE-11224 : AggregateStatsCache triggers java.util.ConcurrentModificationException under some conditions (Pengcheng Xiong via Thejas Nair)
Date Tue, 14 Jul 2015 17:49:34 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 388685c24 -> 0c16534b3


HIVE-11224 :  AggregateStatsCache triggers java.util.ConcurrentModificationException under
some conditions (Pengcheng Xiong via Thejas Nair)


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

Branch: refs/heads/branch-1
Commit: 0c16534b3fb7f7126c23a8869d039f665c27b8fe
Parents: 388685c
Author: Pengcheng Xiong <pxiong@hortonworks.com>
Authored: Tue Jul 14 10:46:30 2015 -0700
Committer: Thejas Nair <thejas@hortonworks.com>
Committed: Tue Jul 14 10:49:28 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/metastore/AggregateStatsCache.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/0c16534b/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java
b/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java
index 44106f5..65e2c65 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java
@@ -241,7 +241,8 @@ public class AggregateStatsCache {
     // We'll count misses as we iterate
     int maxMisses = (int) maxVariance * numPartsRequested;
     for (String partName : partNames) {
-      for (Map.Entry<AggrColStats, MatchStats> entry : candidateMatchStats.entrySet())
{
+      for (Iterator<Map.Entry<AggrColStats, MatchStats>> iterator = candidateMatchStats.entrySet().iterator();
iterator.hasNext();) {
+        Map.Entry<AggrColStats, MatchStats> entry = iterator.next();
         AggrColStats candidate = entry.getKey();
         matchStats = entry.getValue();
         if (candidate.getBloomFilter().test(partName.getBytes())) {
@@ -252,7 +253,7 @@ public class AggregateStatsCache {
         // 2nd pass at removing invalid candidates
         // If misses so far exceed max tolerable misses
         if (matchStats.misses > maxMisses) {
-          candidateMatchStats.remove(candidate);
+          iterator.remove();
           continue;
         }
         // Check if this is the best match so far


Mime
View raw message