Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kvdb
rocksdb
提交
c44a2927
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,发现更多精彩内容 >>
提交
c44a2927
编写于
11月 13, 2014
作者:
L
Lukáš Lalinský
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add cuckoo table options to the C interface
上级
136b8583
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
68 addition
and
0 deletion
+68
-0
db/c.cc
db/c.cc
+47
-0
include/rocksdb/c.h
include/rocksdb/c.h
+21
-0
未找到文件。
db/c.cc
浏览文件 @
c44a2927
...
...
@@ -56,6 +56,7 @@ using rocksdb::NewBloomFilterPolicy;
using
rocksdb
::
NewLRUCache
;
using
rocksdb
::
Options
;
using
rocksdb
::
BlockBasedTableOptions
;
using
rocksdb
::
CuckooTableOptions
;
using
rocksdb
::
RandomAccessFile
;
using
rocksdb
::
Range
;
using
rocksdb
::
ReadOptions
;
...
...
@@ -83,6 +84,7 @@ struct rocksdb_readoptions_t { ReadOptions rep; };
struct
rocksdb_writeoptions_t
{
WriteOptions
rep
;
};
struct
rocksdb_options_t
{
Options
rep
;
};
struct
rocksdb_block_based_table_options_t
{
BlockBasedTableOptions
rep
;
};
struct
rocksdb_cuckoo_table_options_t
{
CuckooTableOptions
rep
;
};
struct
rocksdb_seqfile_t
{
SequentialFile
*
rep
;
};
struct
rocksdb_randomfile_t
{
RandomAccessFile
*
rep
;
};
struct
rocksdb_writablefile_t
{
WritableFile
*
rep
;
};
...
...
@@ -1121,6 +1123,51 @@ void rocksdb_options_set_block_based_table_factory(
}
rocksdb_cuckoo_table_options_t
*
rocksdb_cuckoo_options_create
()
{
return
new
rocksdb_cuckoo_table_options_t
;
}
void
rocksdb_cuckoo_options_destroy
(
rocksdb_cuckoo_table_options_t
*
options
)
{
delete
options
;
}
void
rocksdb_cuckoo_options_set_hash_ratio
(
rocksdb_cuckoo_table_options_t
*
options
,
double
v
)
{
options
->
rep
.
hash_table_ratio
=
v
;
}
void
rocksdb_cuckoo_options_set_max_search_depth
(
rocksdb_cuckoo_table_options_t
*
options
,
uint32_t
v
)
{
options
->
rep
.
max_search_depth
=
v
;
}
void
rocksdb_cuckoo_options_set_cuckoo_block_size
(
rocksdb_cuckoo_table_options_t
*
options
,
uint32_t
v
)
{
options
->
rep
.
cuckoo_block_size
=
v
;
}
void
rocksdb_cuckoo_options_set_identity_as_first_hash
(
rocksdb_cuckoo_table_options_t
*
options
,
unsigned
char
v
)
{
options
->
rep
.
identity_as_first_hash
=
v
;
}
void
rocksdb_cuckoo_options_set_use_module_hash
(
rocksdb_cuckoo_table_options_t
*
options
,
unsigned
char
v
)
{
options
->
rep
.
use_module_hash
=
v
;
}
void
rocksdb_options_set_cuckoo_table_factory
(
rocksdb_options_t
*
opt
,
rocksdb_cuckoo_table_options_t
*
table_options
)
{
if
(
table_options
)
{
opt
->
rep
.
table_factory
.
reset
(
rocksdb
::
NewCuckooTableFactory
(
table_options
->
rep
));
}
}
rocksdb_options_t
*
rocksdb_options_create
()
{
return
new
rocksdb_options_t
;
}
...
...
include/rocksdb/c.h
浏览文件 @
c44a2927
...
...
@@ -77,6 +77,8 @@ typedef struct rocksdb_mergeoperator_t rocksdb_mergeoperator_t;
typedef
struct
rocksdb_options_t
rocksdb_options_t
;
typedef
struct
rocksdb_block_based_table_options_t
rocksdb_block_based_table_options_t
;
typedef
struct
rocksdb_cuckoo_table_options_t
rocksdb_cuckoo_table_options_t
;
typedef
struct
rocksdb_randomfile_t
rocksdb_randomfile_t
;
typedef
struct
rocksdb_readoptions_t
rocksdb_readoptions_t
;
typedef
struct
rocksdb_seqfile_t
rocksdb_seqfile_t
;
...
...
@@ -376,6 +378,25 @@ extern void rocksdb_block_based_options_set_whole_key_filtering(
extern
void
rocksdb_options_set_block_based_table_factory
(
rocksdb_options_t
*
opt
,
rocksdb_block_based_table_options_t
*
table_options
);
/* Cuckoo table options */
extern
rocksdb_cuckoo_table_options_t
*
rocksdb_cuckoo_options_create
();
extern
void
rocksdb_cuckoo_options_destroy
(
rocksdb_cuckoo_table_options_t
*
options
);
extern
void
rocksdb_cuckoo_options_set_hash_ratio
(
rocksdb_cuckoo_table_options_t
*
options
,
double
v
);
extern
void
rocksdb_cuckoo_options_set_max_search_depth
(
rocksdb_cuckoo_table_options_t
*
options
,
uint32_t
v
);
extern
void
rocksdb_cuckoo_options_set_cuckoo_block_size
(
rocksdb_cuckoo_table_options_t
*
options
,
uint32_t
v
);
extern
void
rocksdb_cuckoo_options_set_identity_as_first_hash
(
rocksdb_cuckoo_table_options_t
*
options
,
unsigned
char
v
);
extern
void
rocksdb_cuckoo_options_set_use_module_hash
(
rocksdb_cuckoo_table_options_t
*
options
,
unsigned
char
v
);
extern
void
rocksdb_options_set_cuckoo_table_factory
(
rocksdb_options_t
*
opt
,
rocksdb_cuckoo_table_options_t
*
table_options
);
/* Options */
extern
rocksdb_options_t
*
rocksdb_options_create
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录