Files are stored in S3 as blocks (represented by
Block), which have an ID and a length.
Block metadata is stored in S3 as a small record (represented by
INode) using the URL-encoded
path string as a key. Inodes record the file type (regular file or directory) and the list of blocks.
This design makes it easy to seek to any given position in a file by reading the inode data to compute
which block to access, then using S3's support for
HTTP Range headers
to start streaming from the correct position.
Renames are also efficient since only the inode is moved (by a DELETE followed by a PUT since
S3 does not support renames).
For a single file /dir1/file1 which takes two blocks of storage, the file structure in S3 would be something like this:
/ /dir1 /dir1/file1 block-6415776850131549260 block-3026438247347758425
Inodes start with a leading
/, while blocks are prefixed with
Copyright © 2019 Apache Software Foundation. All rights reserved.