accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cjno...@apache.org
Subject [1/4] git commit: ACCUMULO-1776 Synchronizing methods that manipulate the list of tablet server processes
Date Tue, 15 Oct 2013 21:07:19 GMT
Updated Branches:
  refs/heads/master 5413543ae -> 611463972


ACCUMULO-1776 Synchronizing methods that manipulate the list of tablet server processes


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

Branch: refs/heads/master
Commit: 5d1e7b8b59c7ae6140b13f2deaa675e5a44187a7
Parents: 5413543
Author: Corey J. Nolet <cjnolet@gmail.com>
Authored: Sat Oct 12 21:12:56 2013 -0400
Committer: Corey J. Nolet <cjnolet@gmail.com>
Committed: Tue Oct 15 16:58:39 2013 -0400

----------------------------------------------------------------------
 .../minicluster/MiniAccumuloCluster.java        | 29 ++++++++++++--------
 1 file changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/5d1e7b8b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
index a3bd8d5..1cb8f04 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -431,9 +431,10 @@ public class MiniAccumuloCluster {
       }
       initialized = true;
     }
-
-    for (int i = tabletServerProcesses.size(); i < config.getNumTservers(); i++) {
-      tabletServerProcesses.add(exec(TabletServer.class, ServerType.TABLET_SERVER));
+    synchronized (tabletServerProcesses) {
+      for (int i = tabletServerProcesses.size(); i < config.getNumTservers(); i++) {
+        tabletServerProcesses.add(exec(TabletServer.class, ServerType.TABLET_SERVER));
+      }
     }
     int ret = 0;
     for (int i = 0; i < 5; i++) {
@@ -495,12 +496,14 @@ public class MiniAccumuloCluster {
         }
         break;
       case TABLET_SERVER:
-        for (Process tserver : tabletServerProcesses) {
-          if (proc.equals(tserver)) {
-            tabletServerProcesses.remove(tserver);
-            tserver.destroy();
-            found = true;
-            break;
+        synchronized (tabletServerProcesses) {
+          for (Process tserver : tabletServerProcesses) {
+            if (proc.equals(tserver)) {
+              tabletServerProcesses.remove(tserver);
+              tserver.destroy();
+              found = true;
+              break;
+            }
           }
         }
         break;
@@ -552,9 +555,11 @@ public class MiniAccumuloCluster {
     if (masterProcess != null) {
       masterProcess.destroy();
     }
-    if (tabletServerProcesses != null) {
-      for (Process tserver : tabletServerProcesses) {
-        tserver.destroy();
+    synchronized (tabletServerProcesses) {
+      if (tabletServerProcesses != null) {
+        for (Process tserver : tabletServerProcesses) {
+          tserver.destroy();
+        }
       }
     }
     if (gcProcess != null) {


Mime
View raw message