Updated Branches: refs/heads/master dd9456b92 -> b645a55dd
CRUNCH-20: Temporarily drop BSON support. Remove dependency to jackson-smile due to conflicts with CDH-3. BSON support can be re-added as soon as support for CDH-3 ends. Signed-off-by: jwills <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-crunch/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-crunch/commit/b645a55d Tree: http://git-wip-us.apache.org/repos/asf/incubator-crunch/tree/b645a55d Diff: http://git-wip-us.apache.org/repos/asf/incubator-crunch/diff/b645a55d Branch: refs/heads/master Commit: b645a55ddb63f0bda67dd50607d13529cf7f7e97 Parents: dd9456b Author: Matthias Friedrich <[email protected]> Authored: Sat Jul 21 07:51:18 2012 +0200 Committer: jwills <[email protected]> Committed: Sat Jul 21 13:17:48 2012 -0700 ---------------------------------------------------------------------- crunch/pom.xml | 5 -- .../src/it/java/org/apache/crunch/PageRankIT.java | 14 ---- .../main/java/org/apache/crunch/util/PTypes.java | 47 --------------- pom.xml | 6 -- 4 files changed, 0 insertions(+), 72 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/b645a55d/crunch/pom.xml ---------------------------------------------------------------------- diff --git a/crunch/pom.xml b/crunch/pom.xml index 375a740..0d2f111 100644 --- a/crunch/pom.xml +++ b/crunch/pom.xml @@ -66,11 +66,6 @@ under the License. <artifactId>jackson-mapper-asl</artifactId> </dependency> - <dependency> - <groupId>org.codehaus.jackson</groupId> - <artifactId>jackson-smile</artifactId> - </dependency> - <!-- Both Protobufs and Thrift are supported as derived serialization types, and you can use (almost) any version of them you like, Crunch http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/b645a55d/crunch/src/it/java/org/apache/crunch/PageRankIT.java ---------------------------------------------------------------------- diff --git a/crunch/src/it/java/org/apache/crunch/PageRankIT.java b/crunch/src/it/java/org/apache/crunch/PageRankIT.java index 98b6c25..36f1c35 100644 --- a/crunch/src/it/java/org/apache/crunch/PageRankIT.java +++ b/crunch/src/it/java/org/apache/crunch/PageRankIT.java @@ -89,26 +89,12 @@ public class PageRankIT { } @Test - public void testAvroBSON() throws Exception { - PTypeFamily tf = AvroTypeFamily.getInstance(); - PType<PageRankData> prType = PTypes.smile(PageRankData.class, tf); - run(new MRPipeline(PageRankIT.class), prType, tf); - } - - @Test public void testWritablesJSON() throws Exception { PTypeFamily tf = WritableTypeFamily.getInstance(); PType<PageRankData> prType = PTypes.jsonString(PageRankData.class, tf); run(new MRPipeline(PageRankIT.class), prType, tf); } - @Test - public void testWritablesBSON() throws Exception { - PTypeFamily tf = WritableTypeFamily.getInstance(); - PType<PageRankData> prType = PTypes.smile(PageRankData.class, tf); - run(new MRPipeline(PageRankIT.class), prType, tf); - } - public static PTable<String, PageRankData> pageRank(PTable<String, PageRankData> input, final float d) { PTypeFamily ptf = input.getTypeFamily(); PTable<String, Float> outbound = input.parallelDo(new DoFn<Pair<String, PageRankData>, Pair<String, Float>>() { http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/b645a55d/crunch/src/main/java/org/apache/crunch/util/PTypes.java ---------------------------------------------------------------------- diff --git a/crunch/src/main/java/org/apache/crunch/util/PTypes.java b/crunch/src/main/java/org/apache/crunch/util/PTypes.java index bf46636..e31dad3 100644 --- a/crunch/src/main/java/org/apache/crunch/util/PTypes.java +++ b/crunch/src/main/java/org/apache/crunch/util/PTypes.java @@ -31,7 +31,6 @@ import org.apache.thrift.TException; import org.apache.thrift.TSerializer; import org.apache.thrift.protocol.TBinaryProtocol; import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.smile.SmileFactory; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Message; @@ -52,10 +51,6 @@ public class PTypes { .derived(clazz, new JacksonInputMapFn<T>(clazz), new JacksonOutputMapFn<T>(), typeFamily.strings()); } - public static <T> PType<T> smile(Class<T> clazz, PTypeFamily typeFamily) { - return typeFamily.derived(clazz, new SmileInputMapFn<T>(clazz), new SmileOutputMapFn<T>(), typeFamily.bytes()); - } - public static <T extends Message> PType<T> protos(Class<T> clazz, PTypeFamily typeFamily) { return typeFamily.derived(clazz, new ProtoInputMapFn<T>(clazz), new ProtoOutputMapFn<T>(), typeFamily.bytes()); } @@ -76,48 +71,6 @@ public class PTypes { } }; - public static class SmileInputMapFn<T> extends MapFn<ByteBuffer, T> { - - private final Class<T> clazz; - private transient ObjectMapper mapper; - - public SmileInputMapFn(Class<T> clazz) { - this.clazz = clazz; - } - - @Override - public void initialize() { - this.mapper = new ObjectMapper(new SmileFactory()); - } - - @Override - public T map(ByteBuffer input) { - try { - return mapper.readValue(input.array(), input.position(), input.limit(), clazz); - } catch (Exception e) { - throw new CrunchRuntimeException(e); - } - } - } - - public static class SmileOutputMapFn<T> extends MapFn<T, ByteBuffer> { - private transient ObjectMapper mapper; - - @Override - public void initialize() { - this.mapper = new ObjectMapper(new SmileFactory()); - } - - @Override - public ByteBuffer map(T input) { - try { - return ByteBuffer.wrap(mapper.writeValueAsBytes(input)); - } catch (Exception e) { - throw new CrunchRuntimeException(e); - } - } - } - public static class JacksonInputMapFn<T> extends MapFn<String, T> { private final Class<T> clazz; http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/b645a55d/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index ad9525d..c106f55 100644 --- a/pom.xml +++ b/pom.xml @@ -148,12 +148,6 @@ under the License. </dependency> <dependency> - <groupId>org.codehaus.jackson</groupId> - <artifactId>jackson-smile</artifactId> - <version>1.8.6</version> - </dependency> - - <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>2.4.1</version>
