public
Created

Pail test with LZO block compression

  • Download Gist
gistfile1.clj
Clojure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
; 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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.