Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the quota of a directory for HDFS

Tags:

hadoop

hdfs

I see that there's a command to set quota but could not find a command for getting the quota.

Could anyone help this ? Thanks

like image 852
zjffdu Avatar asked Mar 19 '13 00:03

zjffdu


Video Answer


2 Answers

hadoop fs -count -q /path/to/directory
QUOTA  REMAINING_QUOTA SPACE_QUOTA    REMAINING_SPACE_QUOTA DIR_COUNT  FILE_COUNT CONTENT_SIZE   FILE_NAME
none   inf             54975581388800 5277747062870         3922       418464     16565944775310 hdfs://master:54310/path/to/directory

The third column will give you the space quota.

NOTE: The column titles have just been added there for ease of reading, if you want to read more about the different ways of gettings the filesize of hdfs there's a comprehensive blog post here:

Understanding HDFS Quotas and Hadoop Fs and Fsck Tools

like image 173
siame Avatar answered Oct 13 '22 03:10

siame


hadoop fs -count -q -h -v /path/to/directory

I would add -h and -v options for easy to read the output. With the -q option, also report the name quota value set for each directory, the available name quota remaining, the space quota value set, and the available space quota remaining. If the directory does not have a quota set, the reported values are none and inf. The -h option shows sizes in human readable format. The -v option displays a header line.

like image 36
user2125117 Avatar answered Oct 13 '22 02:10

user2125117