File format
===========
<beginning_of_file>
[data block 1]
[data block 2]
...
[data block N]
[meta block 1]
...
[meta block K]
[metaindex block]
[index block]
[Footer] (fixed size; starts at file_size - sizeof(Footer))
<end_of_file>
The file contains internal pointers. Each such pointer is called
a BlockHandle and contains the following information:
offset: varint64
size: varint64
See https://developers.google.com/protocol-buffers/docs/encoding#varints
for an explanation of varint64 format.
(1) The sequence of key/value pairs in the file are stored in sorted
order and partitioned into a sequence of data blocks. These blocks
come one after another at the beginning of the file. Each data block
is formatted according to the code in block_builder.cc, and then
optionally compressed.
(2) After the data blocks we store a bunch of meta blocks. The
supported meta block types are described below. More meta block types
may be added in the future. Each meta block is again formatted using
block_builder.cc and then optionally compressed.
(3) A "metaindex" block. It contains one entry for every other meta
block where the key is the name of the meta block and the value is a
BlockHandle pointing to that meta block.
(4) An "index" block. This block contains one entry per data block,
where the key is a string >= last key in that data block and before
the first key in the successive data block. The value is the
BlockHandle for the data block.
(6) At the very end of the file is a fixed length footer that contains
the BlockHandle of the metaindex and index blocks as well as a magic number.
metaindex_handle: char[p]; // Block handle for metaindex
index_handle: char[q]; // Block handle for index
padding: char[40-p-q]; // zeroed bytes to make fixed length
// (40==2*BlockHandle::kMaxEncodedLength)
magic: fixed64; // == 0xdb4775248b80fb57 (little-endian)
"filter" Meta Block
-------------------
If a "FilterPolicy" was specified when the database was opened, a
filter block is stored in each table. The "metaindex" block contains
an entry that maps from "filter.<N>" to the BlockHandle for the filter
block where "<N>" is the string returned by the filter policy's
"Name()" method.
The filter block stores a sequence of filters, where filter i contains
the output of FilterPolicy::CreateFilter() on all keys that are stored
in a block whose file offset falls within the range
[ i*base ... (i+1)*base-1 ]
Currently, "base" is 2KB. So for example, if blocks X and Y start in
the range [ 0KB .. 2KB-1 ], all of the keys in X and Y will be
converted to a filter by calling FilterPolicy::CreateFilter(), and the
resulting filter will be stored as the first filter in the filter
block.
The filter block is formatted as follows:
[filter 0]
[filter 1]
[filter 2]
...
[filter N-1]
[offset of filter 0] : 4 bytes
[offset of filter 1] : 4 bytes
[offset of filter 2] : 4 bytes
...
[offset of filter N-1] : 4 bytes
[offset of beginning of offset array] : 4 bytes
lg(base) : 1 byte
The offset array at the end of the filter block allows efficient
mapping from a data block offset to the corresponding filter.
"stats" Meta Block
------------------
This meta block contains a bunch of stats. The key is the name
of the statistic. The value contains the statistic.
TODO(postrelease): record following stats.
data size
index size
key size (uncompressed)
value size (uncompressed)
number of entries
number of data blocks
没有合适的资源?快使用搜索试试~ 我知道了~
C++ leveldb
共185个文件
cc:68个
h:54个
o:40个
5星 · 超过95%的资源 需积分: 50 33 下载量 129 浏览量
2017-09-03
11:27:39
上传
评论
收藏 1.09MB RAR 举报
温馨提示
windows 下Qt5.9.1 配合Mingw(gcc)编译leveldb。如果要重新编译,删除libleveldb.a,libleveldb.so,libleveldb.so.1,libleveldb.so.1.17,libmemenv.a文件,再重新make即可
资源推荐
资源详情
资源评论
收起资源包目录
C++ leveldb (185个子文件)
libleveldb.so.1 489KB
libleveldb.so.1.17 489KB
libleveldb.a 621KB
libmemenv.a 33KB
AUTHORS 293B
build_detect_platform 7KB
c_test.c 11KB
db_test.cc 61KB
version_set.cc 46KB
db_impl.cc 45KB
db_bench.cc 28KB
env_win.cc 25KB
table_test.cc 24KB
db_bench_sqlite3.cc 22KB
c.cc 16KB
db_bench_tree_db.cc 16KB
env_posix.cc 15KB
crc32c.cc 15KB
log_test.cc 14KB
repair.cc 13KB
corruption_test.cc 10KB
skiplist_test.cc 10KB
memenv.cc 9KB
cache.cc 8KB
db_iter.cc 8KB
log_reader.cc 8KB
table.cc 8KB
table_builder.cc 8KB
block.cc 8KB
version_edit.cc 7KB
memenv_test.cc 7KB
leveldb_main.cc 6KB
coding_test.cc 5KB
version_set_test.cc 5KB
coding.cc 5KB
merger.cc 5KB
memtable.cc 5KB
histogram.cc 5KB
two_level_iterator.cc 5KB
cache_test.cc 5KB
format.cc 4KB
dbformat.cc 4KB
filename.cc 4KB
write_batch.cc 4KB
port_win.cc 4KB
dbformat_test.cc 4KB
bloom_test.cc 4KB
filter_block_test.cc 4KB
block_builder.cc 4KB
table_cache.cc 4KB
write_batch_test.cc 3KB
filename_test.cc 3KB
filter_block.cc 3KB
autocompact_test.cc 3KB
bloom.cc 3KB
log_writer.cc 3KB
issue178_test.cc 3KB
env_test.cc 2KB
comparator.cc 2KB
builder.cc 2KB
env.cc 2KB
arena.cc 2KB
status.cc 2KB
logging.cc 2KB
crc32c_test.cc 2KB
iterator.cc 2KB
issue200_test.cc 2KB
arena_test.cc 2KB
testharness.cc 2KB
testutil.cc 1KB
port_posix.cc 1KB
version_edit_test.cc 1KB
hash.cc 1KB
options.cc 764B
filter_policy.cc 333B
doc.css 1KB
.gitignore 106B
version_set.h 14KB
env.h 12KB
skiplist.h 11KB
c.h 10KB
dbformat.h 8KB
db_impl.h 7KB
options.h 7KB
atomic_pointer.h 7KB
db.h 6KB
port_win.h 5KB
testharness.h 5KB
port_example.h 5KB
port_posix.h 4KB
coding.h 4KB
log_reader.h 3KB
cache.h 3KB
iterator.h 3KB
table_builder.h 3KB
status.h 3KB
format.h 3KB
slice.h 3KB
filename.h 3KB
version_edit.h 3KB
共 185 条
- 1
- 2
资源评论
- 霏凡网络科技2018-11-15能正常使用
- Jonix2018-03-20qt5.10.1 下可以直接使用编译好的,但是重新编译就不行了,能把重新编译的方法说详细点吗?
- 昕光xg2018-02-12不错的资源
- tianlanxiaoyao2017-09-27可以用,但是编译的时候还是报错,没搞明白为什么qq762118222017-12-11需要使用Qt5.9.1 Mingw版本
qq76211822
- 粉丝: 310
- 资源: 48
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功