Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将使用 map/reduce 合并一些在同一目录下的小文件。我看到有人说使用流式传输将非常简单,但现在我只能使用 JAVA map/reduce。现在我的解决方案是逐条读取文件并将它们写入同一个输出文件。但我认为它效率低下。我可以使用整个文件的内容作为映射器的值,这样我就可以提高 I/O 效率?感谢您的回复!
这样做的“低效”方法是只对文件进行分类并将其写回:
hadoop fs -cat /path/to/files/*.txt | hadoop fs -put - /output/path/blobbed.txt
您可能会发现这适用于更大的数据集。