LevelDB Log

来源:互联网 发布:销售数据分析方法视频 编辑:程序博客网 时间:2024/06/08 03:00

flyfish 2015-9-28

Log格式

namespace leveldb {namespace log {enum RecordType {  // Zero is reserved for preallocated files  kZeroType = 0,  kFullType = 1,  // For fragments  kFirstType = 2,  kMiddleType = 3,  kLastType = 4};static const int kMaxRecordType = kLastType;static const int kBlockSize = 32768;// Header is checksum (4 bytes), length (2 bytes), type (1 byte).static const int kHeaderSize = 4 + 2 + 1;}  // namespace log}  // namespace leveldb

The log file contents are a sequence of 32KB blocks
log文件的内容是32K 大小的block组成的一个序列
一个Key:Value键值对是一个record
这里写图片描述

这里写图片描述

0 0
原创粉丝点击