의 파일을 HDFS에서 S3까지 얻으려고합니다. DistCp를 사용하고 싶지만 폴더 전체를 복사 만하고 폴더의 일부 파일 만 복사하고 싶습니다.HDFS에서 S3로 파일을 가져 오는 방법
그래서 내가 원하는 파일을 자신의 폴더로 옮겨서 DistCp로 폴더를 업로드해야합니다. 나는 이것을하기 위해서 FileSystem.rename(path1,path2)
을 사용해야한다는 것을 이해합니다.
Path itemsTable = new Path("hdfs://localhost/process-changes/itemstable-*");
itemsTable.getFileSystem(getConf()).mkdirs(new Path("hdfs://localhost/output"));
//Simple test moving just 1 file around HDFS via java API
boolean success = itemsTable.getFileSystem(getConf()).rename(new Path("hdfs://localhost/process-changes/itemtable-r-00001"), new Path("hdfs://localhost/output/itemtable-r-00001"));
을하지만 난 항상 다시 이름 바꾸기 (...) 메소드로부터 false를 얻을 :
그래서 나는 자바에서 한 파일의이 작은 테스트를 시도하고있다.
이 작업을 수행하는 것이 올바른 방법입니까? 그렇다면 내가 뭘 잘못하고 있는지 추측 할 수 있습니까?