2

I see that webhdfs does not support directory size. In HDFS, I can use

hdfs dfs -du -s -h /my/directory

Is there a way to derive this from webHDFS? I need to do this programmatically, not by viewing the page.

Brian Dolan
  • 3,086
  • 2
  • 24
  • 35

1 Answers1

4

I think WebHDFS's GETCONTENTSUMMARY can provide you the information. More information here: http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Get_Content_Summary_of_a_Directory

Here is the schema for GETCONTENTSUMMARY: http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#ContentSummary_JSON_Schema

You'll see that it has the filed "spaceConsumed" which is the disk space consumed.