incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1236873 - /incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Date Fri, 27 Jan 2012 20:35:28 GMT
Author: ecn
Date: Fri Jan 27 20:35:27 2012
New Revision: 1236873

URL: http://svn.apache.org/viewvc?rev=1236873&view=rev
Log:
ACCUMULO-352 make copies of the migrations set whenever iterating over it

Modified:
    incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/master/Master.java

Modified: incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1236873&r1=1236872&r2=1236873&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
(original)
+++ incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Fri Jan 27 20:35:27 2012
@@ -1246,7 +1246,10 @@ public class Master implements Listener,
           found.add(extent);
         }
       }
-      Set<KeyExtent> notFound = new HashSet<KeyExtent>(migrations.keySet());
+      Set<KeyExtent> notFound = new HashSet<KeyExtent>();
+      synchronized (migrations) {
+        notFound.addAll(migrations.keySet());
+      }
       notFound.remove(found);
       for (KeyExtent extent : notFound) {
         log.info("Canceling migration of " + extent + " to " + migrations.get(extent) + ":
tablet no longer exists (probably due to a split)");
@@ -1371,7 +1374,11 @@ public class Master implements Listener,
     
     private long balanceTablets() {
       List<TabletMigration> migrationsOut = new ArrayList<TabletMigration>();
-      long wait = tabletBalancer.balance(Collections.unmodifiableSortedMap(tserverStatus),
Collections.unmodifiableSet(migrations.keySet()), migrationsOut);
+      Set<KeyExtent> migrationsCopy = new HashSet<KeyExtent>();
+      synchronized (migrations) {
+        migrationsCopy.addAll(migrations.keySet());
+      }
+      long wait = tabletBalancer.balance(Collections.unmodifiableSortedMap(tserverStatus),
Collections.unmodifiableSet(migrationsCopy), migrationsOut);
       
       for (TabletMigration m : TabletBalancer.checkMigrationSanity(tserverStatus.keySet(),
migrationsOut)) {
         if (migrations.containsKey(m.tablet)) {



Mime
View raw message