sunithabeeram commented on a change in pull request #3834: Unify move method in 
PinotFS
URL: https://github.com/apache/incubator-pinot/pull/3834#discussion_r260429957
 
 

 ##########
 File path: 
pinot-filesystem/src/main/java/org/apache/pinot/filesystem/PinotFS.java
 ##########
 @@ -58,31 +63,53 @@ public abstract boolean delete(URI segmentUri, boolean 
forceDelete)
   /**
    * Moves the file or directory from the src to dst. Does not keep the 
original file. If the dst has parent directories
    * that haven't been created, this method will create all the necessary 
parent directories.
-   * If both src and dst are files, dst will be overwritten.
-   * If src is a file and dst is a directory, src file will get moved under 
dst directory.
-   * If both src and dst are directories, src directory will get moved under 
dst directory.
-   * If src is a directory and dst is a file, operation will fail.
+   * Note: In Pinot we recommend the full paths of both src and dst be 
specified.
    * For example, if a file /a/b/c is moved to a file /x/y/z, in the case of 
overwrite, the directory /a/b still exists,
    * but will not contain the file 'c'. Instead, /x/y/z will contain the 
contents of 'c'.
-   * If a file /a is moved to a directory /x/y, all the original files under 
/x/y will be kept.
+   * If a directory /a/b/ is renamed to another directory /x/y/, the directory 
/x/y/ will contains the content of /a/b/.
 
 Review comment:
   Lets not mix terminology here: Give examples in terms of move API so its 
clear to readers. i.e., if srcUri = /a/b; an the contents of /a/b are: /a/b/c, 
/a/b/d; and dstUri=/x/y, the result will be /a (directory b removed), and dst 
will be /x/y/c, /x/y/d.
   
   And then provide the exception case: if you would like to move b under /x/y, 
invoke move with srcUri=/a/b and dstUri=/x/y/b.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to