Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Incubator Pegasus
提交
221ac43e
Incubator Pegasus
项目概览
apache
/
Incubator Pegasus
通知
9
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Incubator Pegasus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
221ac43e
编写于
4月 26, 2020
作者:
Y
Yingchun Lai
提交者:
GitHub
4月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(rocksdb): Support more configurable items for bloom filter (#522)
上级
4b1f5ebe
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
55 addition
and
2 deletion
+55
-2
src/server/config.ini
src/server/config.ini
+17
-0
src/server/pegasus_server_impl.cpp
src/server/pegasus_server_impl.cpp
+37
-1
src/shell/commands/table_management.cpp
src/shell/commands/table_management.cpp
+1
-1
未找到文件。
src/server/config.ini
浏览文件 @
221ac43e
...
...
@@ -279,6 +279,23 @@
rocksdb_disable_bloom_filter
=
false
# Bloom filter type, should be either 'common' or 'prefix'
rocksdb_filter_type
=
prefix
# rocksdb_bloom_filter_bits_per_key | false positive rate
# | rocksdb_format_version < 5 | rocksdb_format_version = 5
# 6 5.70953 5.69888
# 8 2.45766 2.29709
# 10 1.13977 0.959254
# 12 0.662498 0.411593
# 16 0.353023 0.0873754
# 24 0.261552 0.0060971
# 50 0.225453 ~0.00003
rocksdb_bloom_filter_bits_per_key
=
10
# SST file format version, should be either 2 or 5
# COMPATIBILITY ATTENTION:
# Although old releases would see the new structure as corrupt filter data and read the
# table as if there's no filter, we've decided only to enable the new Bloom filter with new
# format_version=5. This provides a smooth path for automatic adoption over time, with an
# option for early opt-in.
rocksdb_format_version
=
2
# 3000, 30MB, 1000, 30s
rocksdb_multi_get_max_iteration_count
=
3000
...
...
src/server/pegasus_server_impl.cpp
浏览文件 @
221ac43e
...
...
@@ -293,7 +293,43 @@ pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
bool
disable_bloom_filter
=
dsn_config_get_value_bool
(
"pegasus.server"
,
"rocksdb_disable_bloom_filter"
,
false
,
"Whether to disable bloom filter"
);
if
(
!
disable_bloom_filter
)
{
tbl_opts
.
filter_policy
.
reset
(
rocksdb
::
NewBloomFilterPolicy
(
10
,
false
));
// average bits allocated per key in bloom filter.
// bits_per_key | false positive rate
// | format_version < 5 | format_version = 5
// 6 5.70953 5.69888
// 8 2.45766 2.29709
// 10 1.13977 0.959254
// 12 0.662498 0.411593
// 16 0.353023 0.0873754
// 24 0.261552 0.0060971
// 50 0.225453 ~0.00003
// Recommend using no more than three decimal digits after the decimal point, as in 6.667.
// More details: https://github.com/facebook/rocksdb/wiki/RocksDB-Bloom-Filter
double
bits_per_key
=
dsn_config_get_value_double
(
"pegasus.server"
,
"rocksdb_bloom_filter_bits_per_key"
,
10
,
"average bits allocated per key in bloom filter"
);
// COMPATIBILITY ATTENTION:
// Although old releases would see the new structure as corrupt filter data and read the
// table as if there's no filter, we've decided only to enable the new Bloom filter with new
// format_version=5. This provides a smooth path for automatic adoption over time, with an
// option for early opt-in.
// Reference from rocksdb commit:
// https://github.com/facebook/rocksdb/commit/f059c7d9b96300091e07429a60f4ad55dac84859
int
format_version
=
(
int
)
dsn_config_get_value_int64
(
"pegasus.server"
,
"rocksdb_format_version"
,
2
,
"block based table data format version, "
"only 2 and 5 is supported in Pegasus. "
"2 is the old version, 5 is the new "
"version supported since rocksdb "
"v6.6.4"
);
dassert
(
format_version
==
2
||
format_version
==
5
,
"[pegasus.server]rocksdb_format_version should be either '2' or '5'."
);
tbl_opts
.
format_version
=
format_version
;
tbl_opts
.
filter_policy
.
reset
(
rocksdb
::
NewBloomFilterPolicy
(
bits_per_key
,
false
));
std
::
string
filter_type
=
dsn_config_get_value_string
(
"pegasus.server"
,
...
...
src/shell/commands/table_management.cpp
浏览文件 @
221ac43e
...
...
@@ -516,7 +516,7 @@ bool app_stat(command_executor *e, shell_context *sc, arguments args)
}
std
::
ostream
out
(
buf
);
::
dsn
::
utils
::
table_printer
tp
(
"app_stat"
);
::
dsn
::
utils
::
table_printer
tp
(
"app_stat"
,
2
/* tabular_width */
,
3
/* precision */
);
tp
.
add_title
(
app_name
.
empty
()
?
"app_name"
:
"pidx"
);
if
(
app_name
.
empty
())
{
tp
.
add_column
(
"app_id"
,
tp_alignment
::
kRight
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录