【发布时间】:2014-04-02 20:30:19
【问题描述】:
我们有一个关于 Amazon EMR Hadoop 作业压缩输入的具体问题。
根据 AWS:
"Hadoop 检查文件扩展名以检测压缩文件。Hadoop 支持的压缩类型有:gzip、bzip2 和 LZO。使用这些类型的压缩您不需要采取任何额外的操作来提取文件;Hadoop 会处理它给你。”
q.v.,http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/HowtoProcessGzippedFiles.html
这看起来不错——但是,在 BZip2 中,“分割”边界似乎是基于文件的:
.magic:16 = 'BZ' signature/magic number
.version:8 = 'h' for Bzip2 ('H'uffman coding), '0' for Bzip1 (deprecated)
.hundred_k_blocksize:8 = '1'..'9' block-size 100 kB-900 kB (uncompressed)
**-->.compressed_magic:48 = 0x314159265359 (BCD (pi))**
.crc:32 = checksum for this block
.randomised:1 = 0=>normal, 1=>randomised (deprecated)
.origPtr:24 = starting pointer into BWT for after untransform
.huffman_used_map:16 = bitmap, of ranges of 16 bytes, present/not present
.huffman_used_bitmaps:0..256 = bitmap, of symbols used, present/not present (multiples of 16)
.huffman_groups:3 = 2..6 number of different Huffman tables in use
.selectors_used:15 = number of times that the Huffman tables are swapped (each 50 bytes)
*.selector_list:1..6 = zero-terminated bit runs (0..62) of MTF'ed Huffman table (*selectors_used)
.start_huffman_length:5 = 0..20 starting bit length for Huffman deltas
*.delta_bit_length:1..40 = 0=>next symbol; 1=>alter length
.contents:2..8 = Huffman encoded data stream until end of block
**-->.eos_magic:48 = 0x177245385090 (BCD sqrt(pi))**
.crc:32 = checksum for whole stream
.padding:0..7 = align to whole byte
声明:“像 gzip 一样,bzip2 只是一个数据压缩器。它不是像 tar 或 ZIP 那样的存档器;程序本身没有用于多个文件、加密或存档分割的功能,但是,在 UNIX 传统中, 而这些任务依赖于单独的外部实用程序,例如 tar 和 GnuPG。”
q.v.,http://en.wikipedia.org/wiki/Bzip2
这两个语句的组合我解释为意味着 BZip2 是“可拆分的”,但在逐个文件的基础上这样做。 . . .
这是相关的,因为我们的工作将通过 S3 接收单个 ~800MiB 文件——这(如果我的解释是真的)意味着 EC2/Hadoop 将分配一个映射器给工作(对于一个文件),这至少可以说是次优的。
(既然如此,在应用 BZip2 作为解决方案之前,我们显然需要找到一种方法将输入划分为一组 400 个文件)。
有人确切知道这是否是 AWS/EMR Hadoop 作业在内部运作的方式吗?
干杯!
【问题讨论】:
标签: hadoop amazon-s3 elastic-map-reduce bzip2