jojochuang commented on a change in pull request #1670: HDFS-14925. Rename 
operation should check nest snapshot
URL: https://github.com/apache/hadoop/pull/1670#discussion_r339287816
 
 

 ##########
 File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotManager.java
 ##########
 @@ -288,6 +292,19 @@ public INodeDirectory getSnapshottableAncestorDir(final 
INodesInPath iip)
     }
   }
 
+  public boolean isDescendantOfSnapshotRoot(INodeDirectory dir) {
+    if (dir.isSnapshottable()) {
+      return true;
+    } else {
+      for (INodeDirectory p = dir; p != null; p = p.getParent()) {
 
 Review comment:
   use INode#isAncestorDirectory() instead?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to