I am trying to see how what the total size of all the files within a
directory in HDFS is. I try
Configuration conf = new Configuration();
Path inFile = new Path(
"/MyDir");
FileSystem fs = inFile.getFileSystem(conf);
FileStatus status = fs.getFileStatus(inFile);
System.out.println(status.isDir());
System.out.println(status.getLen());
But since it's a directory, i get a 0. Anyone have any idea on how I can get
this info? I am using apache hadoop 20.2.
Secondly, I assume FileSystem.getUsed and FileStatus.getLen is in bytes,
correct?
Ananth T Sarathy
|