Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kvdb
rocksdb
提交
a10e8a05
R
rocksdb
项目概览
kvdb
/
rocksdb
12 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rocksdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a10e8a05
编写于
9月 12, 2016
作者:
A
Adam Faulkner
提交者:
Islam AbdelRahman
9月 12, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix C api memtable rep bugs. (#1328)
上级
eb1d4d53
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
25 deletion
+33
-25
db/c.cc
db/c.cc
+11
-25
db/c_test.c
db/c_test.c
+22
-0
未找到文件。
db/c.cc
浏览文件 @
a10e8a05
...
...
@@ -1783,11 +1783,7 @@ void rocksdb_options_prepare_for_bulk_load(rocksdb_options_t* opt) {
}
void
rocksdb_options_set_memtable_vector_rep
(
rocksdb_options_t
*
opt
)
{
static
rocksdb
::
VectorRepFactory
*
factory
=
0
;
if
(
!
factory
)
{
factory
=
new
rocksdb
::
VectorRepFactory
;
}
opt
->
rep
.
memtable_factory
.
reset
(
factory
);
opt
->
rep
.
memtable_factory
.
reset
(
new
rocksdb
::
VectorRepFactory
);
}
void
rocksdb_options_set_memtable_prefix_bloom_size_ratio
(
...
...
@@ -1803,36 +1799,26 @@ void rocksdb_options_set_memtable_huge_page_size(rocksdb_options_t* opt,
void
rocksdb_options_set_hash_skip_list_rep
(
rocksdb_options_t
*
opt
,
size_t
bucket_count
,
int32_t
skiplist_height
,
int32_t
skiplist_branching_factor
)
{
static
rocksdb
::
MemTableRepFactory
*
factory
=
0
;
if
(
!
factory
)
{
factory
=
rocksdb
::
NewHashSkipListRepFactory
(
bucket_count
,
skiplist_height
,
skiplist_branching_factor
);
}
rocksdb
::
MemTableRepFactory
*
factory
=
rocksdb
::
NewHashSkipListRepFactory
(
bucket_count
,
skiplist_height
,
skiplist_branching_factor
);
opt
->
rep
.
memtable_factory
.
reset
(
factory
);
}
void
rocksdb_options_set_hash_link_list_rep
(
rocksdb_options_t
*
opt
,
size_t
bucket_count
)
{
static
rocksdb
::
MemTableRepFactory
*
factory
=
0
;
if
(
!
factory
)
{
factory
=
rocksdb
::
NewHashLinkListRepFactory
(
bucket_count
);
}
opt
->
rep
.
memtable_factory
.
reset
(
factory
);
opt
->
rep
.
memtable_factory
.
reset
(
rocksdb
::
NewHashLinkListRepFactory
(
bucket_count
));
}
void
rocksdb_options_set_plain_table_factory
(
rocksdb_options_t
*
opt
,
uint32_t
user_key_len
,
int
bloom_bits_per_key
,
double
hash_table_ratio
,
size_t
index_sparseness
)
{
static
rocksdb
::
TableFactory
*
factory
=
0
;
if
(
!
factory
)
{
rocksdb
::
PlainTableOptions
options
;
options
.
user_key_len
=
user_key_len
;
options
.
bloom_bits_per_key
=
bloom_bits_per_key
;
options
.
hash_table_ratio
=
hash_table_ratio
;
options
.
index_sparseness
=
index_sparseness
;
factory
=
rocksdb
::
NewPlainTableFactory
(
options
);
}
rocksdb
::
PlainTableOptions
options
;
options
.
user_key_len
=
user_key_len
;
options
.
bloom_bits_per_key
=
bloom_bits_per_key
;
options
.
hash_table_ratio
=
hash_table_ratio
;
options
.
index_sparseness
=
index_sparseness
;
rocksdb
::
TableFactory
*
factory
=
rocksdb
::
NewPlainTableFactory
(
options
);
opt
->
rep
.
table_factory
.
reset
(
factory
);
}
...
...
db/c_test.c
浏览文件 @
a10e8a05
...
...
@@ -944,6 +944,28 @@ int main(int argc, char** argv) {
}
}
// Simple sanity check that setting memtable rep works.
StartPhase
(
"memtable_reps"
);
{
// Create database with vector memtable.
rocksdb_close
(
db
);
rocksdb_destroy_db
(
options
,
dbname
,
&
err
);
CheckNoError
(
err
);
rocksdb_options_set_memtable_vector_rep
(
options
);
db
=
rocksdb_open
(
options
,
dbname
,
&
err
);
CheckNoError
(
err
);
// Create database with hash skiplist memtable.
rocksdb_close
(
db
);
rocksdb_destroy_db
(
options
,
dbname
,
&
err
);
CheckNoError
(
err
);
rocksdb_options_set_hash_skip_list_rep
(
options
,
5000
,
4
,
4
);
db
=
rocksdb_open
(
options
,
dbname
,
&
err
);
CheckNoError
(
err
);
}
StartPhase
(
"cleanup"
);
rocksdb_close
(
db
);
rocksdb_options_destroy
(
options
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录