crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwi...@apache.org
Subject crunch git commit: CRUNCH-582: Upgrade Crunch Guava to 14.0.1
Date Tue, 02 Feb 2016 18:42:58 GMT
Repository: crunch
Updated Branches:
  refs/heads/master 1e6224594 -> 55d73bf17


CRUNCH-582: Upgrade Crunch Guava to 14.0.1


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

Branch: refs/heads/master
Commit: 55d73bf17e41ef100121b95c82d0dbd23d8d5b8d
Parents: 1e62245
Author: Josh Wills <jwills@apache.org>
Authored: Sun Dec 6 18:13:00 2015 -0800
Committer: Josh Wills <jwills@apache.org>
Committed: Tue Feb 2 10:27:35 2016 -0800

----------------------------------------------------------------------
 .../crunch/io/text/csv/CSVRecordIterator.java    | 19 +++++++++++++------
 crunch-spark/pom.xml                             |  1 -
 .../org/apache/crunch/test/TemporaryPath.java    |  2 +-
 pom.xml                                          |  2 +-
 4 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/crunch/blob/55d73bf1/crunch-core/src/main/java/org/apache/crunch/io/text/csv/CSVRecordIterator.java
----------------------------------------------------------------------
diff --git a/crunch-core/src/main/java/org/apache/crunch/io/text/csv/CSVRecordIterator.java
b/crunch-core/src/main/java/org/apache/crunch/io/text/csv/CSVRecordIterator.java
index 5645344..c57c019 100644
--- a/crunch-core/src/main/java/org/apache/crunch/io/text/csv/CSVRecordIterator.java
+++ b/crunch-core/src/main/java/org/apache/crunch/io/text/csv/CSVRecordIterator.java
@@ -17,20 +17,23 @@
  */
 package org.apache.crunch.io.text.csv;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.io.Text;
+
 import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.Iterator;
 
-import org.apache.hadoop.io.Text;
-
-import com.google.common.io.Closeables;
-
 /**
  * An {@code Iterator} for an internally created {@code CSVLineReader}
  */
 public class CSVRecordIterator implements Iterator<String>, Closeable {
+
+  private static final Log LOG = LogFactory.getLog(CSVRecordIterator.class);
+
   private final CSVLineReader csvLineReader;
   private InputStream inputStream;
   private String currentLine;
@@ -83,7 +86,11 @@ public class CSVRecordIterator implements Iterator<String>, Closeable
{
     if (!(currentLine == null)) {
       return true;
     }
-    Closeables.closeQuietly(this);
+    try {
+      this.close();
+    } catch (IOException e) {
+      LOG.error("Failed to close CSVRecordIterator", e);
+    }
     return false;
   }
 
@@ -121,4 +128,4 @@ public class CSVRecordIterator implements Iterator<String>, Closeable
{
       inputStream = null;
     }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/crunch/blob/55d73bf1/crunch-spark/pom.xml
----------------------------------------------------------------------
diff --git a/crunch-spark/pom.xml b/crunch-spark/pom.xml
index 566e198..0e6fe0e 100644
--- a/crunch-spark/pom.xml
+++ b/crunch-spark/pom.xml
@@ -36,7 +36,6 @@ under the License.
     <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
-      <version>14.0.1</version>
     </dependency>
     <dependency>
       <groupId>org.apache.crunch</groupId>

http://git-wip-us.apache.org/repos/asf/crunch/blob/55d73bf1/crunch-test/src/main/java/org/apache/crunch/test/TemporaryPath.java
----------------------------------------------------------------------
diff --git a/crunch-test/src/main/java/org/apache/crunch/test/TemporaryPath.java b/crunch-test/src/main/java/org/apache/crunch/test/TemporaryPath.java
index 1d25fc7..0d750e1 100644
--- a/crunch-test/src/main/java/org/apache/crunch/test/TemporaryPath.java
+++ b/crunch-test/src/main/java/org/apache/crunch/test/TemporaryPath.java
@@ -139,7 +139,7 @@ public final class TemporaryPath extends ExternalResource {
   }
 
   private static void copy(String resourceName, File dest) throws IOException {
-    Files.copy(Resources.newInputStreamSupplier(Resources.getResource(resourceName)), dest);
+    Resources.asByteSource(Resources.getResource(resourceName)).copyTo(Files.asByteSink(dest));
   }
 
   private static Path toPath(File file) {

http://git-wip-us.apache.org/repos/asf/crunch/blob/55d73bf1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b628a77..a12029e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,7 +78,7 @@ under the License.
               classpath. Additionally, please keep licensing information
               in NOTICE and LICENSE files up to date.
     -->
-    <guava.version>11.0.2</guava.version>
+    <guava.version>14.0.1</guava.version>
     <commons-io.version>2.1</commons-io.version>
     <commons-lang.version>2.6</commons-lang.version>
     <commons-codec.version>1.4</commons-codec.version>


Mime
View raw message