Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Hadoop, mail # user - FileSystem API - Moving files in HDFS


+
Jim Twensky 2011-05-13, 20:21
Copy link to this message
-
Re: FileSystem API - Moving files in HDFS
lohit 2011-05-13, 21:00
There is no FileSystem API to copy.
You could try
hadoop dfs -cp <src> <dest>

which basically reads the file and writes to new file.
The code for this is in FsShell.java
----- Original Message ----
From: Jim Twensky <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Fri, May 13, 2011 1:21:09 PM
Subject: FileSystem API - Moving files in HDFS

Hi,

I'd like to move and copy files from one directory in HDFS to another
one. I know there are methods in the Filesystem API that enable
copying files between the local disk and HDFS, but I couldn't figure
out how to do this between two paths both in HDFS. I think rename(Path
src, Path dest) can be used to move files, but copying still remains a
challenge to me. Any ideas?

Thanks,
Jim
+
Mahadev Konar 2011-05-14, 05:49
+
Robert Evans 2011-05-16, 17:06