Project

General

Profile

Persistent data » History » Revision 13

Revision 12 (Greg Burri, 09/07/2009 05:36 PM) → Revision 13/18 (Greg Burri, 09/07/2009 07:54 PM)

h1. Persistent data 

 h2. Files cache 

 This file contains all the shared files and theirs SHA-1 hashes. This file is saved in user space after an update of the file list, it is completely loaded at the start of Aybabtu. If some paths of some files doesn't match the shared directory they are discarded. 

 This file is saved as a binary file serialized by protocol buffer. 

 You can see the proto file here : source:/application/Protos/files_cache.proto 

 h3. Size 

 Here is 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 directory : 50 
 Average filename and dirname length : 50 char 
 Size of a hash : 20B 
 </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. Queued files and directories 

 A file containing the queued files and directories is saved in user space. An item from the list may contains a remote peer id and/or the hashes which identify a file.  

 As the file cache file (see above), this file is saved as a binary file serialized by protocol buffer. 

 For more details see the file : source:/application/Protos/queue.proto 


 h2. Configuration file 

 h3. Core side 

 here are the persisted data : 

 * The nick 
 * The shared folders in read-only  
 * The shared folders in read-write 
 * Core address and password for remote core 

 As the other There is two ways to persist theses data described above these data are saved as : 

 # Using of _QSettings_ : http://doc.trolltech.com/4.5/qsettings.html 
 # Using a custom file containing data serialized by with _Protocol Buffer_ but in a human readable form. 

 For more details see as the message _Settings_ in file : source:/application/Protos/common.proto cache 

 h3. Client Side 

 here are Pros for the persisted data : first method (_QSettings_) 

 * Core address Easier to create, not necessary to create a file definition. 
 * Password Standard to Qt. 

 h3. Pros for remote core the second method (_Protocol Buffer_) 

 These * Same method as the two other files. 
 * All the persisted data are save using _QSettings_ : http://doc.trolltech.com/4.5/qsettings.html. 

 is in the same place.