accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-3228 Remove additional resource leak warnings
Date Thu, 18 Dec 2014 02:11:05 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 27d4ee212 -> 76e7fffc6
  refs/heads/master 826091460 -> 0c63731da


ACCUMULO-3228 Remove additional resource leak warnings


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

Branch: refs/heads/1.6
Commit: 76e7fffc6e8f28118b619c303908fd31ccc5a1c1
Parents: 27d4ee2
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Wed Dec 17 20:24:11 2014 -0500
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Wed Dec 17 21:08:00 2014 -0500

----------------------------------------------------------------------
 .../core/client/mapreduce/lib/impl/ConfiguratorBase.java         | 1 +
 .../accumulo/core/util/shell/commands/AddSplitsCommand.java      | 2 ++
 .../java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java | 1 +
 .../accumulo/minicluster/impl/MiniAccumuloClusterImpl.java       | 4 +---
 .../accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java   | 3 +--
 5 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/76e7fffc/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
index da83386..a928e26 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
@@ -266,6 +266,7 @@ public class ConfiguratorBase {
       while (fileScanner.hasNextLine()) {
         Credentials creds = Credentials.deserialize(fileScanner.nextLine());
         if (principal.equals(creds.getPrincipal())) {
+          fileScanner.close();
           return creds.getToken();
         }
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/76e7fffc/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java
b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java
index 90a3548..40043a2 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AddSplitsCommand.java
@@ -34,6 +34,7 @@ import org.apache.hadoop.io.Text;
 public class AddSplitsCommand extends Command {
   private Option optSplitsFile, base64Opt;
   
+  @Override
   public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws Exception {
     final String tableName = OptUtil.getTableOpt(cl, shellState);
     final boolean decode = cl.hasOption(base64Opt.getOpt());
@@ -51,6 +52,7 @@ public class AddSplitsCommand extends Command {
           splits.add(decode ? new Text(Base64.decodeBase64(line.getBytes(UTF_8))) : new Text(line));
         }
       }
+      file.close();
     } else {
       if (cl.getArgList().isEmpty()) {
         throw new MissingArgumentException("No split points specified");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/76e7fffc/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
index 22eca84..1e6c4c5 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
@@ -209,6 +209,7 @@ public class MiniAccumuloRunner {
     // start a socket on the shutdown port and block- anything connected to this port will
activate the shutdown
     ServerSocket shutdownServer = new ServerSocket(shutdownPort);
     shutdownServer.accept().close();
+    shutdownServer.close();
 
     System.exit(0);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/76e7fffc/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 19d7746..4692954 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
@@ -246,9 +246,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
 
           if (classLoader instanceof URLClassLoader) {
 
-            URLClassLoader ucl = (URLClassLoader) classLoader;
-
-            for (URL u : ucl.getURLs()) {
+            for (URL u : ((URLClassLoader) classLoader).getURLs()) {
               append(classpathBuilder, u);
             }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/76e7fffc/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
index b08bd7e..983ad7c 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
@@ -350,10 +350,9 @@ public class AccumuloVFSClassLoader {
 
         if (classLoader instanceof URLClassLoader) {
           // If VFS class loader enabled, but no contexts defined.
-          URLClassLoader ucl = (URLClassLoader) classLoader;
           out.print("Level " + classLoaderDescription + " URL classpath items are:");
 
-          for (URL u : ucl.getURLs()) {
+          for (URL u : ((URLClassLoader) classLoader).getURLs()) {
             out.print("\t" + u.toExternalForm());
           }
 


Mime
View raw message