gpt4 book ai didi

java - hadoop hdfs java-将文件列表从hdfs复制到hdfs的最佳方法是什么

转载 作者:行者123 更新时间:2023-12-02 21:50:06 26 4
gpt4 key购买 nike

我有一个包含两列的文件,第一列是源文件的hdfs路径,第二列是目标文件的hdfs路径:

s1,t1
s2,t2
..,..


我将源路径复制到各自目标路径的最快方法是什么?有这样的Hadoop工具吗?

该列表可能长100-200行,每个文件只有几兆字节。

最佳答案

The list is probably 100-200 lines long each file is a few megabytes.



如果是一次性的情况,那么这还不足以担心。笨拙的shell循环会很好:
cat pairs-file | while read pair; do hdfs dfs -cp $pair; done

关于java - hadoop hdfs java-将文件列表从hdfs复制到hdfs的最佳方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21768376/

26 4 0
文章推荐: hadoop - 在Hadoop中使用CombineFileInputFormat
文章推荐: css - 显示:inline-block in

and

Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com