incubator-crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwi...@apache.org
Subject git commit: Make MemPipeline consistent w/MRPipeline for reading missing files
Date Wed, 04 Jul 2012 03:35:48 GMT
Updated Branches:
  refs/heads/master 7397d98a5 -> 5eec5ad92


Make MemPipeline consistent w/MRPipeline for reading missing files


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

Branch: refs/heads/master
Commit: 5eec5ad92c8847a70b7e7ce4557e0bc475c7a0f1
Parents: 7397d98
Author: Josh Wills <jwills@cloudera.com>
Authored: Tue Jul 3 20:35:31 2012 -0700
Committer: Josh Wills <jwills@cloudera.com>
Committed: Tue Jul 3 20:35:31 2012 -0700

----------------------------------------------------------------------
 .../com/cloudera/crunch/impl/mem/MemPipeline.java  |    8 ++++----
 .../cloudera/crunch/PCollectionGetSizeTest.java    |    3 ---
 2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/5eec5ad9/src/main/java/com/cloudera/crunch/impl/mem/MemPipeline.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/cloudera/crunch/impl/mem/MemPipeline.java b/src/main/java/com/cloudera/crunch/impl/mem/MemPipeline.java
index 2b21efc..ac81e95 100644
--- a/src/main/java/com/cloudera/crunch/impl/mem/MemPipeline.java
+++ b/src/main/java/com/cloudera/crunch/impl/mem/MemPipeline.java
@@ -118,11 +118,11 @@ public class MemPipeline implements Pipeline {
         return new MemCollection<T>(iterable, source.getType(), source.toString());
       } catch (IOException e) {
         LOG.error("Exception reading source: " + source.toString(), e);
-        return null;
+        throw new IllegalStateException(e);
       }
     }
     LOG.error("Source " + source + " is not readable");
-    return null;
+    throw new IllegalStateException("Source " + source + " is not readable");
   }
 
   @Override
@@ -133,11 +133,11 @@ public class MemPipeline implements Pipeline {
         return new MemTable<K, V>(iterable, source.getTableType(), source.toString());
       } catch (IOException e) {
         LOG.error("Exception reading source: " + source.toString(), e);
-        return null;
+        throw new IllegalStateException(e);
       }
     }
     LOG.error("Source " + source + " is not readable");
-    return null;
+    throw new IllegalStateException("Source " + source + " is not readable");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/5eec5ad9/src/test/java/com/cloudera/crunch/PCollectionGetSizeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/com/cloudera/crunch/PCollectionGetSizeTest.java b/src/test/java/com/cloudera/crunch/PCollectionGetSizeTest.java
index 7069267..46f9ffe 100644
--- a/src/test/java/com/cloudera/crunch/PCollectionGetSizeTest.java
+++ b/src/test/java/com/cloudera/crunch/PCollectionGetSizeTest.java
@@ -89,7 +89,6 @@ public class PCollectionGetSizeTest {
     }
 
     @Test
-    @Ignore("MemPipeline implementation is inconsistent with the MRPipeline")
     public void testGetSizeOfEmptyIntermediatePCollection_MemPipeline() {
 
         PCollection<String> emptyIntermediate = createPesistentEmptyIntermediate(MemPipeline.getInstance());
@@ -106,7 +105,6 @@ public class PCollectionGetSizeTest {
     }
 
     @Test
-    @Ignore("MemPipelien impelmentation is inconsistent with the MRPipelien")
     public void testMaterializeOfEmptyIntermediatePCollection_MemPipeline() {
 
         PCollection<String> emptyIntermediate = createPesistentEmptyIntermediate(MemPipeline.getInstance());
@@ -133,7 +131,6 @@ public class PCollectionGetSizeTest {
     }
 
     @Test(expected = IllegalStateException.class)
-    @Ignore("MemPipelien impelmentation is inconsistent with the MRPipelien")
     public void testExpectExceptionForGettingSizeOfNonExistingFile_MemPipeline() {
         MemPipeline.getInstance().readTextFile("non_existing.file").getSize();
     }


Mime
View raw message