HBase 加载Hfile时的读取过程
Hfile分为4部分,其中loadOnOpen section 和trailer这2部分是open file时就会加载到内存的。 Step1: 读取文件末尾的4Bytes,得到Hfile format版本号,进而知道Trailer部分的大小, v2和v3都固定为4096Bytes; Step2: 读取文件末尾的4096Bytes,这部分整体作为一个block,包含一些重要的元数据信息,目前有15个,分为以下几类; 偏移量:loadOnOpenDataOffset、fileinfoOffset、firstDataBlockOffset、lastDataBlockOffset; 数量和大小:totalUncomressedBytes、entryCount、dataIndexCount、metaIndexCount、uncompressedDataIndexSize、numDataIndexLevels 算法:compressionCodec、comparatorClassName、encryptionKey 版本号:majorVersion、minorVersion 其中,fileinfo...
