Support Questions
Find answers, ask questions, and share your expertise

Can we get file metadata using org.apache.hadoop.fs.FileSystem?

Rising Star

We can use the org.apache.hadoop.fs.FileStatus class to get the file metadata like Block size, File permissions & Ownership, replication factor.

Can we get the same metadata using org.apache.hadoop.fs.FileSystem class. If yes whats the difference between FileSystem and FileSatus class?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

An instance of FileSystem represents a Hadoop-compatible file system. It provides APIs that map to operations on that underlying file system. A FileStatus represents metadata for one particular file or directory in a file system. You can call the method FileSystem#getFileStatus to obtain a FileStatus instance for any file or directory stored in that file system.

View solution in original post

2 REPLIES 2

An instance of FileSystem represents a Hadoop-compatible file system. It provides APIs that map to operations on that underlying file system. A FileStatus represents metadata for one particular file or directory in a file system. You can call the method FileSystem#getFileStatus to obtain a FileStatus instance for any file or directory stored in that file system.

View solution in original post

Rising Star

Thanks Chris!!