Kun, 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.
Ciao, L On May 20, 2016, at 12:05 PM, Kun Ren <ren.h...@gmail.com<mailto:ren.h...@gmail.com>> wrote: 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.