I am trying to write a snappy block compressed sequence file from a map-reduce job. I am using hadoop 2.0.0-cdh4.5.0, and snappy-java 1.0.4.1
Here is my code:
My problem was that my JRE did not contain the appropriate native libraries. This may or may not be because I switched the JDK from cloudera's pre-built VM to JDK 1.7. The snappy .so files are in your hadoop/lib/native directory, the JRE needs to have them. Adding them to the classpath did not seem to resolve my issue. I resolved it like this:
$ cd /usr/lib/hadoop/lib/native
$ sudo cp *.so /usr/java/latest/jre/lib/amd64/
Then I was able to use the SnappyCodec class. Your paths may be different though.
That seemed to get me to the next problem:
Caused by: java.lang.RuntimeException: native snappy library not available: SnappyCompressor has not been loaded.
Still trying to resolve that.