hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mingliang Liu <m...@hortonworks.com>
Subject Re: cp and mv
Date Fri, 20 May 2016 21:44:29 GMT

I think you need to be ware of the difference between client and server side logic. Perhaps
you’re more interested in the client side in this case. The commands are generally running
in the shell, and org.apache.hadoop.fs.shell package is a good place to start. Specially,
have a look at CommandWithDestination.java.



On May 20, 2016, at 12:05 PM, Kun Ren <ren.hdfs@gmail.com<mailto:ren.hdfs@gmail.com>>

Hi Genius,

Currently I debugged the cp and mv operations, for example:
(1) ./bin/hdfs dfs -cp input/a.xml input/b.xml
(2)./bin/hdfs dfs -mv input/a.xml input/b.xml

My understanding is that for operation cp, it will create a new file b.xml,
and will copy the content of a.xml to b.xml; For mv operations, it will
create b.xml and copy the content of a.xml to b.xml, and delete the a.xml.

However, when I debug the code, i found that both operations will finally
go through the create() method in NameNodeRpcServer.java, but I didn't see
any calls to copy and delete function,  could you please point out to me
where I can debug and see the full logic of the cp and mv operations.
Thanks a lot.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message