hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li...@apache.org
Subject svn commit: r1459469 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Thu, 21 Mar 2013 18:53:52 GMT
Author: liyin
Date: Thu Mar 21 18:53:51 2013
New Revision: 1459469

URL: http://svn.apache.org/r1459469
Log:
[0.89-fb] 	[HBASE-5783] Fix a possible ConcurrentModificationException

Author: aaiyer

Summary: Fix possible ConcurrentModificationException

Test Plan: unit tests

Reviewers: adela, liyintang

Reviewed By: adela

CC: hbase-eng@, manukranthk

Differential Revision: https://phabricator.fb.com/D719424

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1459469&r1=1459468&r2=1459469&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Thu Mar 21 18:53:51 2013
@@ -32,6 +32,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -2818,12 +2819,13 @@ public class HConnectionManager {
           Map<HRegionInfo, Long> flushedTSMap =
               getRegionFlushTimes(regionsUpdated, options);
 
-          for (Entry<HRegionInfo, Long> entry: targetTSMap.entrySet()) {
+          for (Iterator<Entry<HRegionInfo, Long>> iter = targetTSMap.entrySet().iterator();
iter.hasNext();) {
+            Entry<HRegionInfo, Long> entry = iter.next();
             HRegionInfo region = entry.getKey();
             long targetTime = entry.getValue().longValue();
             long flushedTime = flushedTSMap.get(region).longValue();
             if (flushedTime > targetTime) {
-              targetTSMap.remove(region);
+              iter.remove();
             }
             LOG.debug("Region " + region.getEncodedName() + " was flushed at "
                 + flushedTime



Mime
View raw message