Create a gist now

Instantly share code, notes, and snippets.

Pail test with LZO block compression
; Depends on my fork of dfs-datastores to include CODEC_ARG_LZO
(def pail4 (Pail/create "/tmp/data4" (PailSpec. "SequenceFile" {SequenceFileFormat/TYPE_ARG SequenceFileFormat/TYPE_ARG_BLOCK SequenceFileFormat/CODEC_ARG SequenceFileFormat/CODEC_ARG_LZO})))
; #'cloudwh.split-pail/pail4
(def tos (.openWrite pail4))
; #'cloudwh.split-pail/tos
; write this a couple times
(.writeObject tos (byte-array [(byte 3) (byte 4) (byte 5) (byte 122) (byte 12)]))
; nil
(.close tos)
; nil
(for [record pail4] (println record))
;(#<byte[] [B@7eab48a7>
;#<byte[] [B@1f2f0ce9>
;nil #<byte[] [B@49f8a4fd>
;nil #<byte[] [B@631803fb>
;nil #<byte[] [B@3dad8690>
;nil #<byte[] [B@4b5d7792>
;nil #<byte[] [B@655538e5>
;nil nil)
(.consolidate pail4)
; nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment