资源描述:
《北航云计算公开课03 Google File System.pdf》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、By邓侃Ph.D,朱小杰,李小吉SmartClouder.com2/30LocationMetadata:FileName,Size,Type,Timestamp,etc.Tree-structuredFunctionality:DirectoryCreate,Truncate,Delete,Read,Write,Seek,List,Open,Close3/30DirectoryIDSubdirIDs&FileIDs121,22,2131,32,33,…2234,35,…NodeIDMetadataStorageChunkIDs22theNameOf
2、ADir
3、20120306
4、24(Numberofsubdirsandfiles)NIL32theNameOfAFile
5、20120306
6、1024(FileSize)3A28C329,…Howtoallocatestoragespace•Systemarchitect’s3routines:fordirectoryandfile?Definethedatastructurefirst,Decidetheworkflow,Designthemodulesandwheretodeploy.•Filesystem’sfundamentaldatastru
7、cture:Treestructureofdirectoriesandfiles,Metadata,physicalstorageaddress.AhomebrewdatastructureofFileSystem4/30•Slab:fixed-sizestoragespace.•SlabClass:Agroupofslabsofthesamesize.•Chunk:Eachslabsplitsintomanychunks,thechunksareofthesamesize.•Slots:Anaddresslistpointingtothere-us
8、ablechunks.LearnfromMemCached•Whysplitthestorageintofixed-sizeslabsandchunks?Easytore-use,butmaywastestoragespace.•Beforestoringadata,findtheslabwiththeappropriatesize,equaloralittlebiggerthanthedata.5/30DirectoryIDSubdirIDs&FileIDsNodeStorageMetadataIDChunkID121,22,theNameOfAD
9、ir
10、20120306
11、24(Numberof2131,32,33,…22NILsubdirsandfiles)2234,35,…theNameOfAFile
12、20120306
13、1024(File323A28C329,…Size)%fappend/home/user/test.txtWorkflow“contentaddedtothetail…”6/30•Whenappendingnewdata,thestoragelocationischosenbythesize.Noguaranteetoallocatethedataofthesamefile,
14、incontinuousblocks.•Frequentlymodifyingfile,inducefragmentation.•FragmentationdecreasediskIOefficiency,becausediskIOinvolvesinmechanicalmovement.•Fromtimetotime,dodefragmentation.•Flashstoragemaynotcareaboutfragmentation.7/30LinuxExt2LayersExt2PhysicalLayerExt2DirectoryLinuxExt
15、2structuresaresimilartoourhomebrewstructure.Ext2iNodeDirectoryIDSubdirIDs&FileIDs121,22,2131,32,33,…2234,35,…NodeIDMetadataStorageChunkIDtheNameOfADir
16、20120306
17、24(Numberof22NILsubdirsandfiles)32theNameOfAFile
18、20120306
19、1024(FileSize)3A28C329,…8/30LinuxExt2SystemArchitectureDatas
20、toredinbuffercachefirst.VirtualFileSystemTransparentto