goiri commented on code in PR #5483:
URL: https://github.com/apache/hadoop/pull/5483#discussion_r1139298964


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -641,6 +646,11 @@ public void rename2(final String src, final String dst,
         new Class<?>[] {String.class, String.class, options.getClass()},
         new RemoteParam(), dstParam, options);
     if (isMultiDestDirectory(src)) {
+      if (locs.size() == srcLocations.size()) {
+        throw new IOException(
+            "Rename of " + src + " to " + dst + " is not allowed," +
+                " The remote location should be exactly same.");

Review Comment:
   What's the assumption on why comparing sizes is equal to saying it is the 
same?



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAllResolver.java:
##########
@@ -205,6 +204,20 @@ private void testAll(final String path) throws Exception {
     assertDirsEverywhere(path, 9);
     assertFilesDistributed(path, 16);
 
+    // Test rename to not multi mount dir
+    routerFs.mkdirs(new Path(path+ "/dir2/dir23"));
+    routerFs.mkdirs(new Path(path+ "/dir2/dir23/dir_1"));
+    routerFs.mkdirs(new Path(path+ "/dir2/dir23/dir_2"));
+    try {

Review Comment:
   LambdaTestUtils#intercept



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAllResolver.java:
##########
@@ -52,6 +49,8 @@
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.*;

Review Comment:
   Avoid



-- 
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]

Reply via email to