How to get file size

前端 未结 2 636
醉梦人生
醉梦人生 2021-01-17 11:42

I am running a hadoop job, I have FileSystem object and Path object and I want to know what is the file (Path) size.

any idea?

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-17 11:45

    long length = FileSystem#getFileStatus(PATH)#getLen();
    

    Here is a link to the relevant documentation of Hadoop 2.2.0

提交回复
热议问题