[ 
https://issues.apache.org/jira/browse/HDFS-17168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17760725#comment-17760725
 ] 

ASF GitHub Bot commented on HDFS-17168:
---------------------------------------

slfan1989 commented on code in PR #5992:
URL: https://github.com/apache/hadoop/pull/5992#discussion_r1311139036


##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java:
##########
@@ -1956,6 +1956,27 @@ String decodeResponse(Map<?, ?> json) throws IOException 
{
     }
   }
 
+  public Collection<FileStatus> getTrashRoots(boolean allUsers) {
+    statistics.incrementReadOps(1);
+    storageStatistics.incrementOpCounter(OpType.GET_TRASH_ROOTS);
+
+    final HttpOpParam.Op op = GetOpParam.Op.GETTRASHROOTS;
+    try {
+      Collection<FileStatus> trashRoots =
+          new FsPathResponseRunner<Collection<FileStatus>>(op, null,
+              new AllUsersParam(allUsers)) {
+            @Override
+            Collection<FileStatus> decodeResponse(Map<?, ?> json) throws 
IOException {
+              return JsonUtilClient.getTrashRoots(json);
+            }
+          }.run();
+      return trashRoots;
+    } catch (IOException e) {
+      LOG.warn("Cannot get all trash roots", e);

Review Comment:
   warn ?





> Support getTrashRoots API in WebHDFS
> ------------------------------------
>
>                 Key: HDFS-17168
>                 URL: https://issues.apache.org/jira/browse/HDFS-17168
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: webhdfs
>    Affects Versions: 3.4.0
>            Reporter: Hualong Zhang
>            Assignee: Hualong Zhang
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2023-08-26-23-13-42-426.png
>
>
> WebHDFS should support getTrashRoots:
> !image-2023-08-26-23-13-42-426.png|width=686,height=204!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to