yuangu002 opened a new pull request #2565:
URL: https://github.com/apache/ozone/pull/2565


   ## What changes were proposed in this pull request?
   
   Add the ozone admin shell command ozone admin namespace summary
   
   From the design doc:
   
   $ ozone admin namespace summary --all /vol1/bucket1/MyDir
   
   Entity Type : Directory
   Directories : 1
   Keys : 10
   
   DU
     Size  DiskUsage   Path
     21G     63G          /volume1/bucket1
     5G      15G          /volume1/bucket2
   
   File Size Distribution
     1KB - 2KB - 50% (5)
     2KB - 4KB - 50% (5)
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5368
   
   ## How was this patch tested?
   
   Configs:
   ```
   ozone sh volume create /vol1
   ozone sh volume create /vol2
   ozone sh bucket create /vol1/bucket11
   ozone sh bucket create /vol1/bucket12
   ozone sh bucket create /vol2/bucket21
   ozone sh bucket create /vol2/bucket22
   ozone sh key put --replication=THREE /vol1/bucket11/key1 README.md
   ozone sh key put --replication=THREE /vol1/bucket11/key2s README.md
   ozone sh key put --replication=THREE /vol1/bucket11/dir1/key3 README.md
   ozone sh key put /vol2/bucket21/key4 CONTRIBUTING.md
   ozone sh key put /vol2/bucket21/key5 CONTRIBUTING.md
   ozone sh key put /vol2/bucket22/key6 README.md
   ozone sh key put --replication=THREE /vol2/bucket22/dir22/key7 LICENSE.txt
   ozone sh key put /vol1/bucket12/dir1-1/key8 README.md
   ozone sh key put /vol1/bucket12/dir1-2/key9 CONTRIBUTING.md
   ozone sh key put --replication=THREE /vol1/bucket12/directKey README.md
   ```
   Usage:
   `ozone admin namespace [summary | du | quota | dist] [-options] <path>`
   
   Example: `ozone admin namespace summary /`
   ![Screen Shot 2021-08-23 at 3 12 10 
PM](https://user-images.githubusercontent.com/53324985/130504249-fd3592f2-fe18-45b6-9c7d-ebb0ffa28c3b.png)
   
   (du with replica)
   `ozone admin namespace du --replica /`
   ![Screen Shot 2021-08-23 at 3 14 28 
PM](https://user-images.githubusercontent.com/53324985/130504531-b06bf23c-9eb7-4d1b-bcb0-942ab8a681d6.png)
   
   (du with listing direct keys)
   ozone admin namespace du --replica --file /vol1/bucket12
   ![Screen Shot 2021-08-23 at 3 17 30 
PM](https://user-images.githubusercontent.com/53324985/130504859-5b89a128-97ff-447d-9224-d95b90bb7d40.png)
   
   Other option usage for `du`:
   ![Screen Shot 2021-08-23 at 3 13 08 
PM](https://user-images.githubusercontent.com/53324985/130504353-733f8412-742d-491f-a09f-99655db95188.png)
   
   `ozone admin namespace quota /`
   ![Screen Shot 2021-08-23 at 3 15 15 
PM](https://user-images.githubusercontent.com/53324985/130504629-a0ae7f3e-92e1-4090-8398-78547b2f2206.png)
   
   `ozone admin namespace dist /`
   ![Screen Shot 2021-08-23 at 3 16 14 
PM](https://user-images.githubusercontent.com/53324985/130504718-706aa08b-a4b3-4045-a732-de540c6c1fb4.png)
   
   cc @smengcl @avijayanhwx for reviews.


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