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


##########
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:
   I am confused by the following segment, when src set StoragePolicy then 
return true directly, which is not same as the name `isSameStoragePolicy` when 
glance.
   ```
         if (src.isSetStoragePolicy()) {
           return true;
         }
   ```



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