-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathfilestore.README
More file actions
38 lines (28 loc) · 1.3 KB
/
Copy pathfilestore.README
File metadata and controls
38 lines (28 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Filestore is a basic Chord application that can store and retrieve
files from a Chord ring. It demonstrates how to use DHash to store
blocks, and how to program in the style needed by libasync.
technical details
The file storage format is fairly simple. Files are split up into
16,384-byte "data blocks." They are stored in DHash as content-hash
blocks. "Inode blocks" contain the file's name and length, and a list
of hashes for "indirect blocks." The indirect blocks contain a list of
hashes for the file's data blocks. The file is identified by the hash
of the inode block.
This simple, fixed, three-layer scheme permits files up to
10,815,307,776 bytes. For files smaller than 16,384 bytes, it has an
overhead of one inode block of 280 bytes, and one indirect block of 20
bytes. The users can view the filename and file length before
attempting to retrieve the file, so they can avoid retrieving files
that are larger than they want.
Examples of use:
storing a file:
> ./filestore ../lsd/csock -s some_file
e34cb4fa86a073f390b224f637b90db88f82db06
listing inode info:
> ./filestore ../lsd/csock -l e34cb4fa86a073f390b224f637b90db88f82db06
some_file: 19463682 bytes
fetching a file:
> ./filestore ../lsd/csock -f e34cb4fa86a073f390b224f637b90db88f82db06
todo:
better documentation
throttling of insert/retrieve requests?