You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/06/18 08:17:38 UTC

[GitHub] [hadoop] ehiggs commented on a change in pull request #743: HADOOP-11452 make rename/3 public

ehiggs commented on a change in pull request #743: HADOOP-11452 make rename/3 public
URL: https://github.com/apache/hadoop/pull/743#discussion_r294664660
 
 

 ##########
 File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFileSystem.java
 ##########
 @@ -670,6 +670,27 @@ public boolean rename(Path src, Path dst) throws IOException {
     }
   }
 
+  /**
+   * Rename files/dirs.
+   */
+  @Override
+  @SuppressWarnings("deprecation")
+  public void rename(final Path src,
+      Path dst,
+      final Options.Rename... options)
+      throws IOException {
+      fs.rename(src, dst, options);
+
+      Path srcCheckFile = getChecksumFile(src);
+      Path dstCheckFile = getChecksumFile(dst);
+      if (fs.exists(srcCheckFile)) { //try to rename checksum
+        fs.rename(srcCheckFile, dstCheckFile, Options.Rename.OVERWRITE);
 
 Review comment:
   Should this be the concatenation of `options` and `Options.Rename.OVERWRITE`?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org