Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d38e3835
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d38e3835
编写于
6月 09, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opt batch write
上级
06b65ce5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
7 deletion
+10
-7
source/libs/stream/src/streamBackendRocksdb.c
source/libs/stream/src/streamBackendRocksdb.c
+10
-7
未找到文件。
source/libs/stream/src/streamBackendRocksdb.c
浏览文件 @
d38e3835
...
@@ -81,6 +81,8 @@ const char* compareParKeyName(void* name);
...
@@ -81,6 +81,8 @@ const char* compareParKeyName(void* name);
const
char
*
comparePartagKeyName
(
void
*
name
);
const
char
*
comparePartagKeyName
(
void
*
name
);
void
*
streamBackendInit
(
const
char
*
path
)
{
void
*
streamBackendInit
(
const
char
*
path
)
{
uint32_t
dbMemLimit
=
nextPow2
(
tsMaxStreamBackendCache
)
<<
20
;
qDebug
(
"start to init stream backend at %s"
,
path
);
qDebug
(
"start to init stream backend at %s"
,
path
);
SBackendHandle
*
pHandle
=
taosMemoryCalloc
(
1
,
sizeof
(
SBackendHandle
));
SBackendHandle
*
pHandle
=
taosMemoryCalloc
(
1
,
sizeof
(
SBackendHandle
));
pHandle
->
list
=
tdListNew
(
sizeof
(
SCfComparator
));
pHandle
->
list
=
tdListNew
(
sizeof
(
SCfComparator
));
...
@@ -89,22 +91,23 @@ void* streamBackendInit(const char* path) {
...
@@ -89,22 +91,23 @@ void* streamBackendInit(const char* path) {
pHandle
->
cfInst
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_NO_LOCK
);
pHandle
->
cfInst
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_NO_LOCK
);
rocksdb_env_t
*
env
=
rocksdb_create_default_env
();
// rocksdb_envoptions_create();
rocksdb_env_t
*
env
=
rocksdb_create_default_env
();
// rocksdb_envoptions_create();
rocksdb_env_set_low_priority_background_threads
(
env
,
tsNumOfSnodeStreamThreads
);
rocksdb_env_set_high_priority_background_threads
(
env
,
tsNumOfSnodeStreamThreads
);
rocksdb_cache_t
*
cache
=
rocksdb_cache_create_lru
(
64
<<
20
);
int32_t
nBGThread
=
tsNumOfSnodeStreamThreads
<=
2
?
1
:
tsNumOfSnodeStreamThreads
/
2
;
rocksdb_env_set_low_priority_background_threads
(
env
,
nBGThread
);
rocksdb_env_set_high_priority_background_threads
(
env
,
nBGThread
);
rocksdb_cache_t
*
cache
=
rocksdb_cache_create_lru
(
dbMemLimit
/
2
);
rocksdb_options_t
*
opts
=
rocksdb_options_create
();
rocksdb_options_t
*
opts
=
rocksdb_options_create
();
rocksdb_options_set_env
(
opts
,
env
);
rocksdb_options_set_env
(
opts
,
env
);
rocksdb_options_set_create_if_missing
(
opts
,
1
);
rocksdb_options_set_create_if_missing
(
opts
,
1
);
rocksdb_options_set_create_missing_column_families
(
opts
,
1
);
rocksdb_options_set_create_missing_column_families
(
opts
,
1
);
rocksdb_options_set_max_total_wal_size
(
opts
,
128
<<
20
);
rocksdb_options_set_max_total_wal_size
(
opts
,
dbMemLimit
);
rocksdb_options_set_recycle_log_file_num
(
opts
,
6
);
rocksdb_options_set_recycle_log_file_num
(
opts
,
6
);
rocksdb_options_set_max_write_buffer_number
(
opts
,
3
);
rocksdb_options_set_max_write_buffer_number
(
opts
,
3
);
rocksdb_options_set_info_log_level
(
opts
,
0
);
rocksdb_options_set_info_log_level
(
opts
,
0
);
uint32_t
dbLimit
=
nextPow2
(
tsMaxStreamBackendCache
);
rocksdb_options_set_db_write_buffer_size
(
opts
,
dbMemLimit
);
rocksdb_options_set_db_write_buffer_size
(
opts
,
dbLimit
<<
20
);
rocksdb_options_set_write_buffer_size
(
opts
,
dbMemLimit
/
2
);
rocksdb_options_set_write_buffer_size
(
opts
,
(
dbLimit
<<
20
)
/
2
);
pHandle
->
env
=
env
;
pHandle
->
env
=
env
;
pHandle
->
dbOpt
=
opts
;
pHandle
->
dbOpt
=
opts
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录