steveloughran commented on a change in pull request #1388: HADOOP-16255. Add 
ChecksumFs.rename(path, path, boolean) to rename crc file as well when 
FileContext.rename(path, path, options) is called.
URL: https://github.com/apache/hadoop/pull/1388#discussion_r320403035
 
 

 ##########
 File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFs.java
 ##########
 @@ -457,17 +458,35 @@ public boolean setReplication(Path src, short 
replication)
   @Override
   public void renameInternal(Path src, Path dst) 
     throws IOException, UnresolvedLinkException {
+    renameInternal(src, dst, (s, d) -> getMyFs().rename(s, d));
+  }
+
+  @Override
+  public void renameInternal(Path src, Path dst, boolean overwrite)
+      throws AccessControlException, FileAlreadyExistsException,
+      FileNotFoundException, ParentNotDirectoryException,
+      UnresolvedLinkException, IOException {
+    Options.Rename renameOpt = Options.Rename.NONE;
+    if (overwrite) {
+      renameOpt = Options.Rename.OVERWRITE;
+    }
+    final Options.Rename opt = renameOpt;
+    renameInternal(src, dst, (s, d) -> getMyFs().rename(s, d, opt));
 
 Review comment:
   Looking at this, its the more elegant functional API. Which is nice for 
hadoop 3+.  But I fear its probably going to lose all that elegance on branch-2 
(assuming you do want a backport). If you do, then simply copying the existing 
renameInternal to one with a new signature is going to be the simplest

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to