Skip to content

Instantly share code, notes, and snippets.

@lelayf
Created April 26, 2012 15:41
Show Gist options
  • Save lelayf/2500461 to your computer and use it in GitHub Desktop.
Save lelayf/2500461 to your computer and use it in GitHub Desktop.
Pail test
(ns cloudwh.pail-test
(:import [backtype.hadoop.pail Pail PailSpec SequenceFileFormat]))
(def pail3 (Pail/create "/tmp/data3"
(PailSpec. "SequenceFile"
{SequenceFileFormat/TYPE_ARG SequenceFileFormat/TYPE_ARG_BLOCK
SequenceFileFormat/CODEC_ARG SequenceFileFormat/CODEC_ARG_GZIP})))
(def tos (.openWrite pail3))
(.writeObject tos (byte-array [(byte 1) (byte 2) (byte 3)]))
;; IllegalArgumentException SequenceFile doesn't work with GzipCodec without native-hadoop code! org.apache.hadoop.io.SequenceFile.createWriter (SequenceFile.java:386)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment