ThinkerLei commented on code in PR #6653:
URL: https://github.com/apache/hadoop/pull/6653#discussion_r1537675718


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java:
##########
@@ -681,14 +703,46 @@ private static class RenameOperation {
         this.srcIIP = INodesInPath.replace(srcIIP, srcIIP.length() - 1,
             srcChild);
         // get the counts before rename
-        oldSrcCounts.add(withCount.getReferredINode().computeQuotaUsage(bsps));
+        
oldSrcCountsInSnapshot.add(withCount.getReferredINode().computeQuotaUsage(bsps));
       } else if (srcChildIsReference) {
         // srcChild is reference but srcChild is not in latest snapshot
         withCount = (INodeReference.WithCount) srcChild.asReference()
             .getReferredINode();
       } else {
         withCount = null;
       }
+      // set quota for src and dst, ignore src is in Snapshot or is Reference
+      this.srcSubTreeCountOp = withCount == null ?
+          quotaPair.getLeft() : Optional.empty();
+      this.dstSubTreeCountOp = quotaPair.getRight();
+    }
+
+    boolean isSameStoragePolicy() {

Review Comment:
   > Not sure to get what this method purpose. Another side, the first feeling 
is to calculate if `src` and `dst` has the same StoragePolicy, but it is not 
actually same implement as `function name`, right?
   
   @Hexiaoqiao Thankf for your comment. The purpose of this method is to 
calculate whether the source directory and the target directory have the same 
storage policy. I don't quite understand why the logic doesn't seem to match 
what the method name suggests?



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