Permalink
Browse files

Add LZO support.

  • Loading branch information...
1 parent 3c83f1f commit f447021c30b8dc77c1add6cb7b122c6ca1e33493 @lelayf committed Apr 27, 2012
Showing with 9 additions and 2 deletions.
  1. +2 −1 project.clj
  2. +7 −1 src/jvm/backtype/hadoop/pail/SequenceFileFormat.java
View
@@ -1,4 +1,4 @@
-(defproject backtype/dfs-datastores "1.1.3-SNAPSHOT"
+(defproject org.clojars.lelayf/dfs-datastores "1.1.3-SNAPSHOT"
:source-path "src/clj"
:test-path "test/clj"
:java-source-path "src/jvm"
@@ -16,3 +16,4 @@
[lein-javac "1.3.0"]
[lein-junit "1.0.0"]
[junit "4.7"]])
+
@@ -17,6 +17,8 @@
import org.apache.hadoop.io.compress.CompressionCodec;
import org.apache.hadoop.io.compress.DefaultCodec;
import org.apache.hadoop.io.compress.GzipCodec;
+import org.apache.hadoop.io.compress.LzoCodec ;
+//import org.apache.hadoop.io.compress.SnappyCodec ;
import org.apache.hadoop.mapred.*;
import org.apache.log4j.Logger;
@@ -38,6 +40,8 @@
public static final String CODEC_ARG_DEFAULT = "default";
public static final String CODEC_ARG_GZIP = "gzip";
public static final String CODEC_ARG_BZIP2 = "bzip2";
+ public static final String CODEC_ARG_LZO = "lzo";
+ // public static final String CODEC_ARG_SNAPPY = "snappy";
private static final Map<String, CompressionType> TYPES = new HashMap<String, CompressionType>() {{
put(TYPE_ARG_RECORD, CompressionType.RECORD);
@@ -48,6 +52,8 @@
put(CODEC_ARG_DEFAULT, new DefaultCodec());
put(CODEC_ARG_GZIP, new GzipCodec());
put(CODEC_ARG_BZIP2, new BZip2Codec());
+ put(CODEC_ARG_LZO, new LzoCodec());
+ // put(CODEC_ARG_LZO, new SnappyCodec());
}};
private String _typeArg;
@@ -56,7 +62,7 @@
public SequenceFileFormat(Map<String, Object> args) {
args = new KeywordArgParser()
.add(TYPE_ARG, null, true, TYPE_ARG_RECORD, TYPE_ARG_BLOCK)
- .add(CODEC_ARG, CODEC_ARG_DEFAULT, false, CODEC_ARG_DEFAULT, CODEC_ARG_GZIP, CODEC_ARG_BZIP2)
+ .add(CODEC_ARG, CODEC_ARG_DEFAULT, false, CODEC_ARG_DEFAULT, CODEC_ARG_GZIP, CODEC_ARG_BZIP2, CODEC_ARG_LZO)
.parse(args);
_typeArg = (String) args.get(TYPE_ARG);
_codecArg = (String) args.get(CODEC_ARG);

0 comments on commit f447021

Please sign in to comment.