Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Very basic question about Hadoop and compressed input files

I have started to look into Hadoop. If my understanding is right i could process a very big file and it would get split over different nodes, however if the file is compressed then the file could not be split and wold need to be processed by a single node (effectively destroying the advantage of running a mapreduce ver a cluster of parallel machines).

My question is, assuming the above is correct, is it possible to split a large file manually in fixed-size chunks, or daily chunks, compress them and then pass a list of compressed input files to perform a mapreduce?

like image 797
Luis Sisamon Avatar asked Jan 16 '10 20:01

Luis Sisamon


People also ask

Which of the following is key value Textinputformat?

Key Value Text Input Format-It is similar to Text Input Format. Hence, it treats each line of input as a separate record. But the main difference is that Text Input Format treats entire line as the value. While the Key Value Text Input Format breaks the line itself into key and value by the tab character ('/t').


1 Answers

BZIP2 is splittable in hadoop - it provides very good compression ratio but from CPU time and performances is not providing optimal results, as compression is very CPU consuming.

LZO is splittable in hadoop - leveraging hadoop-lzo you have splittable compressed LZO files. You need to have external .lzo.index files to be able to process in parallel. The library provides all means of generating these indexes in local or distributed manner.

LZ4 is splittable in hadoop - leveraging hadoop-4mc you have splittable compressed 4mc files. You don't need any external indexing, and you can generate archives with provided command line tool or by Java/C code, inside/outside hadoop. 4mc makes available on hadoop LZ4 at any level of speed/compression-ratio: from fast mode reaching 500 MB/s compression speed up to high/ultra modes providing increased compression ratio, almost comparable with GZIP one.

like image 78
Carlo Medas Avatar answered Oct 14 '22 20:10

Carlo Medas