tomscut commented on code in PR #5145:
URL: https://github.com/apache/hadoop/pull/5145#discussion_r1027090205
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/impl/StateStoreFileSystemImpl.java:
##########
@@ -82,17 +82,8 @@ protected boolean mkdir(String path) {
@Override
protected boolean rename(String src, String dst) {
try {
- if (fs instanceof DistributedFileSystem) {
- DistributedFileSystem dfs = (DistributedFileSystem)fs;
- dfs.rename(new Path(src), new Path(dst), Options.Rename.OVERWRITE);
- return true;
- } else {
- // Replace should be atomic but not available
- if (fs.exists(new Path(dst))) {
- fs.delete(new Path(dst), true);
- }
- return fs.rename(new Path(src), new Path(dst));
- }
+ FileUtil.rename(fs, new Path(src), new Path(dst),
Options.Rename.OVERWRITE);
Review Comment:
Hi @simbadzina , can you explain why we changed it here? Thanks.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]