SequenceFile & SequenceFileInputFormat<K,V>

  • org.apache.hadoop.mapred.SequenceFileInputFormat<K,V>
  1. 获得FileStatus{block size+group+lenth+accesstime+modificationtime+owner+path+permission+symlink+Acl+一些判断是否目录等+序列化到out+set函数}
  2. 通过input获得RecordReader。将byte转为record-oriented,为下一步的MR准备。processing record boundaries and presenting the tasks with keys and values.。可{关闭InputSplit+创建key+创建value+返回目前input位置+从input中读取下一个k-v对}
  • org.apache.hadoop.io.SequenceFile
  1. flat files 由01k-v对组成。Writer Reader和Sorter 三部分。
  2. 基于CompressionType有三种writers,并shared a common header。compress的block size, 使用的algorithm都configurable。
  3. 推荐使用static createWriter
  4. format: Header Record sync-marker.    Header:version+calss of k,v +compression+blockcompression+compression codec+metadata+sync

 

版权声明:本文为yumanman原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/yumanman/p/7616626.html