ayushtkn commented on code in PR #5744:
URL: https://github.com/apache/hadoop/pull/5744#discussion_r1263885805


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/TrashPolicyDefault.java:
##########
@@ -374,8 +382,14 @@ private void deleteCheckpoint(Path trashRoot, boolean 
deleteImmediately)
       try {
         time = getTimeFromCheckpoint(name);
       } catch (ParseException e) {
-        LOG.warn("Unexpected item in trash: "+dir+". Ignoring.");
-        continue;
+        if (cleanNonCheckpointUnderTrashRoot) {
+          fs.delete(path, true);
+          LOG.warn("Unexpected item in trash: " + dir + ". Force to delete 
it.");

Review Comment:
   can we change to
   ```
    LOG.warn("Unexpected item in trash: " + dir + ". Deleting.");
   ```



##########
hadoop-common-project/hadoop-common/src/main/resources/core-default.xml:
##########
@@ -974,6 +974,14 @@
   </description>
 </property>
 
+<property>
+  <name>fs.trash.clean.trashroot.enable</name>
+  <value>false</value>
+  <description>Whether clean some directories or files
+    at home of Trash which are not under checkpoint directory or not.
+  </description>

Review Comment:
   some error in language, can we change it something like
   ```
   Whether to delete directories and files in Trash home which are not under 
checkpoint directory
   ```



##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestTrash.java:
##########
@@ -786,6 +787,55 @@ public void testTrashEmptier() throws Exception {
     emptierThread.join();
   }
 
+  /**
+   * Test trash emptier can whether delete non-checkpoint dir or not.

Review Comment:
   typo: can & whether don't go together
   ```
   Test trash emptier can delete non-checkpoint dir or not.
   ```



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to