crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwi...@apache.org
Subject git commit: CRUNCH-356: Switch from deprecated Closeables.closeQuietly to IOUtils.closeQuietly. Contributed by John Leacox.
Date Tue, 25 Feb 2014 16:58:08 GMT
Repository: crunch
Updated Branches:
  refs/heads/master 0da8e3c3e -> d68895f32


CRUNCH-356: Switch from deprecated Closeables.closeQuietly to IOUtils.closeQuietly. Contributed
by John Leacox.


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

Branch: refs/heads/master
Commit: d68895f32fbc22001c0577ed6a91aa5a0fd37ef0
Parents: 0da8e3c
Author: Josh Wills <jwills@apache.org>
Authored: Tue Feb 25 08:55:32 2014 -0800
Committer: Josh Wills <jwills@apache.org>
Committed: Tue Feb 25 08:55:32 2014 -0800

----------------------------------------------------------------------
 crunch-core/pom.xml                                            | 6 ++++++
 .../java/org/apache/crunch/io/impl/AutoClosingIterator.java    | 4 ++--
 .../apache/crunch/scrunch/interpreter/InterpreterRunner.scala  | 4 ++--
 3 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/crunch/blob/d68895f3/crunch-core/pom.xml
----------------------------------------------------------------------
diff --git a/crunch-core/pom.xml b/crunch-core/pom.xml
index 24fa4cd..06a8a19 100644
--- a/crunch-core/pom.xml
+++ b/crunch-core/pom.xml
@@ -84,6 +84,12 @@ under the License.
     </dependency>
 
     <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
       <groupId>org.codehaus.jackson</groupId>
       <artifactId>jackson-core-asl</artifactId>
       <scope>provided</scope>

http://git-wip-us.apache.org/repos/asf/crunch/blob/d68895f3/crunch-core/src/main/java/org/apache/crunch/io/impl/AutoClosingIterator.java
----------------------------------------------------------------------
diff --git a/crunch-core/src/main/java/org/apache/crunch/io/impl/AutoClosingIterator.java
b/crunch-core/src/main/java/org/apache/crunch/io/impl/AutoClosingIterator.java
index a854ebc..caddb73 100644
--- a/crunch-core/src/main/java/org/apache/crunch/io/impl/AutoClosingIterator.java
+++ b/crunch-core/src/main/java/org/apache/crunch/io/impl/AutoClosingIterator.java
@@ -22,7 +22,7 @@ import java.io.IOException;
 import java.util.Iterator;
 
 import com.google.common.collect.UnmodifiableIterator;
-import com.google.common.io.Closeables;
+import org.apache.commons.io.IOUtils;
 
 /**
  * Closes the wrapped {@code Closeable} when {@link #hasNext()} returns false.  As long a
client loops through to
@@ -42,7 +42,7 @@ public class AutoClosingIterator<T> extends UnmodifiableIterator<T>
implements C
     if (iter.hasNext()) {
       return true;
     } else {
-      Closeables.closeQuietly(this);
+      IOUtils.closeQuietly(this);
       return false;
     }
   }

http://git-wip-us.apache.org/repos/asf/crunch/blob/d68895f3/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/interpreter/InterpreterRunner.scala
----------------------------------------------------------------------
diff --git a/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/interpreter/InterpreterRunner.scala
b/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/interpreter/InterpreterRunner.scala
index 196e222..9443f68 100644
--- a/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/interpreter/InterpreterRunner.scala
+++ b/crunch-scrunch/src/main/scala/org/apache/crunch/scrunch/interpreter/InterpreterRunner.scala
@@ -33,10 +33,10 @@ import scala.tools.nsc.io.Jar
 import scala.tools.nsc.io.VirtualDirectory
 
 import com.google.common.io.Files
-import com.google.common.io.Closeables
 import org.apache.hadoop.conf.Configuration
 
 import org.apache.crunch.util.DistCache
+import org.apache.commons.io.IOUtils
 
 /**
  * An object used to run a Scala REPL with modifications to facilitate Scrunch jobs running
@@ -153,7 +153,7 @@ object InterpreterRunner extends MainGenericRunner {
       addVirtualDirectoryToJar(virtualDirectory, "", jarStream)
       return tempJar
     } finally {
-      Closeables.closeQuietly(jarStream)
+      IOUtils.closeQuietly(jarStream)
     }
   }
 


Mime
View raw message