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 17:02:43 GMT
Repository: crunch
Updated Branches:
  refs/heads/apache-crunch-0.8 723b5fe29 -> 85d6e4ee6


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/85d6e4ee
Tree: http://git-wip-us.apache.org/repos/asf/crunch/tree/85d6e4ee
Diff: http://git-wip-us.apache.org/repos/asf/crunch/diff/85d6e4ee

Branch: refs/heads/apache-crunch-0.8
Commit: 85d6e4ee6815277bcec8ded1c3c08440e754bc54
Parents: 723b5fe
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:58:31 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/85d6e4ee/crunch-core/pom.xml
----------------------------------------------------------------------
diff --git a/crunch-core/pom.xml b/crunch-core/pom.xml
index 5394765..3f0eff1 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/85d6e4ee/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/85d6e4ee/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