Re: Cp command is not atomic

2016-05-25 Thread Kun Ren
Thanks a lot, Chris, this is helpful. On Wed, May 25, 2016 at 12:33 PM, Chris Nauroth wrote: > Hello Kun, > > You are correct that "hdfs dfs -cp" is not atomic, but the details of that > are a bit different from what you described. For the example you gave, > the sequence of events would be: >

Re: Cp command is not atomic

2016-05-25 Thread Chris Nauroth
Hello Kun, You are correct that "hdfs dfs -cp" is not atomic, but the details of that are a bit different from what you described. For the example you gave, the sequence of events would be: 1. Open a.xml. 2. Create file b.xml._COPYING_. 3. Copy the bytes from a.xml to b.xml._COPYING_. 4. Rename

Cp command is not atomic

2016-05-25 Thread Kun Ren
Hi Genius, If I understand correctly, the shell command "cp" for the HDFS is not atomic, is that correct? For example: ./bin/hdfs dfs -cp input/a.xml input/b.xml This command actually does 3 things, 1. read input/a.xml; 2. Create a new file input/b.xml; 3. Write the content of a.xml to b.xml;