Project

General

Profile

Persistent data » History » Revision 4

Revision 3 (Greg Burri, 06/26/2009 07:09 PM) → Revision 4/18 (Greg Burri, 07/21/2009 01:33 PM)

h1. Structures 

 h2. Files File cache 

 This file contains all the shared files and theirs SHA-1 hashes. This file is saved in user space after an update !Cache.png! 

 Complexity of the file list, it is completely loaded at the start of Aybabtu. 

 You can see the proto file here actions : source:/protos/files_cache.proto 

 h3. Size 

 Here is * Search a size approximation for 50'000 files stored in 1 TB. The overhead of the file format is not taken in account. 

 <pre> 
 Nb of files : 50'0000 
 Total size : 1 TB 
 Chunk Size : 32 MB 
 Average file per filename or directory name : 50 O(n) 
 Average filename and dirname length : 50 char 
 Size of * Search a hash code : 20B O(log n) 
 </pre> 

 <pre> 
 AverageFileSize = 1*1024^4 / 50'000 = 21MB 
 Sha1Size = floor(AverageFileSize / 32MB) * 20 * 50'000 = 1 * 20 * 50'000 = 977kB 
 FilenameSize = 50'000 * 50 * 2 = 4.8MB (2 bytes per char) 
 DirnameSize = (50'000 / 50) * 50 * 2 = 97kB 

 TotalSize = 977kB + 4.8MB + 97kB = 5.9MB 
 </pre> 


 h2. Configuration Get information about a file 

 TODO.. (with path) : ~ O(log n)