linyiqun commented on a change in pull request #1557:
URL: https://github.com/apache/ozone/pull/1557#discussion_r519097194
##########
File path:
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java
##########
@@ -407,6 +414,29 @@ public boolean rename(Path src, Path dst) throws
IOException {
return result;
}
+ private boolean renameV1(Path src, Path dst) throws IOException {
+ incrementCounter(Statistic.INVOCATION_RENAME);
+ statistics.incrementWriteOps(1);
+ super.checkPath(src);
+ super.checkPath(dst);
+
+ String srcPath = src.toUri().getPath();
+ String dstPath = dst.toUri().getPath();
+ if (srcPath.equals(dstPath)) {
+ return true;
+ }
+
+ LOG.trace("rename() from:{} to:{}", src, dst);
+ if (src.isRoot()) {
+ // Cannot rename root of file system
+ LOG.trace("Cannot rename the root of a filesystem");
+ return false;
+ }
+
+ adapter.renameKey(srcPath, dstPath);
+ return true;
+ }
Review comment:
As we also do the refactor for the OzoneFileSystem rename change, can we
try to add corresponding unit test for this? Or we will add this later? I
didn't see this part of test.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]