You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2014/01/29 00:03:32 UTC

git commit: ACCUMULO-2210 Closing socket after checking on on Zookeeper

Updated Branches:
  refs/heads/master e7281a248 -> 21f09f42a


ACCUMULO-2210 Closing socket after checking on on Zookeeper


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

Branch: refs/heads/master
Commit: 21f09f42a32059befd715f904047971daecd2c47
Parents: e7281a2
Author: John Vines <vi...@apache.org>
Authored: Tue Jan 28 18:03:08 2014 -0500
Committer: John Vines <vi...@apache.org>
Committed: Tue Jan 28 18:03:08 2014 -0500

----------------------------------------------------------------------
 .../org/apache/accumulo/minicluster/MiniAccumuloCluster.java   | 1 -
 .../accumulo/minicluster/impl/MiniAccumuloClusterImpl.java     | 6 +++++-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/21f09f42/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 6b0b1ff..bc4e271 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -59,7 +59,6 @@ public class MiniAccumuloCluster {
    * @param config
    *          initial configuration
    */
-  @SuppressWarnings("deprecation")
   public MiniAccumuloCluster(MiniAccumuloConfig config) throws IOException {
     this(config.getImpl());
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/21f09f42/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index fa305e5..f42dffb 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -441,8 +441,9 @@ public class MiniAccumuloClusterImpl {
       // sleep a little bit to let zookeeper come up before calling init, seems to work better
       long startTime = System.currentTimeMillis();
       while (true) {
+        Socket s = null;
         try {
-          Socket s = new Socket("localhost", config.getZooKeeperPort());
+          s = new Socket("localhost", config.getZooKeeperPort());
           s.getOutputStream().write("ruok\n".getBytes());
           s.getOutputStream().flush();
           byte buffer[] = new byte[100];
@@ -454,6 +455,9 @@ public class MiniAccumuloClusterImpl {
             throw new RuntimeException("Zookeeper did not start within 10 seconds . Check the logs in " + config.getLogDir() + " for errors.");
           }
           UtilWaitThread.sleep(250);
+        } finally {
+          if (s != null)
+            s.close();
         }
       }
       Process initProcess = exec(Initialize.class, "--instance-name", config.getInstanceName(), "--password", config.getRootPassword());