Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b4de0892
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
b4de0892
编写于
7月 15, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add checkpoint
上级
7b4185dc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
21 deletion
+21
-21
source/libs/stream/src/streamBackendRocksdb.c
source/libs/stream/src/streamBackendRocksdb.c
+13
-13
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+8
-8
未找到文件。
source/libs/stream/src/streamBackendRocksdb.c
浏览文件 @
b4de0892
...
...
@@ -212,13 +212,13 @@ int32_t rebuildDirFromCheckpoint(const char* path, int64_t chkpId, char** dst) {
return
0
;
}
void
*
streamBackendInit
(
const
char
*
path
,
int64_t
chkpId
)
{
uint32_t
dbMemLimit
=
nextPow2
(
tsMaxStreamBackendCache
)
<<
20
;
void
*
streamBackendInit
(
const
char
*
streamPath
,
int64_t
chkpId
)
{
char
*
backendPath
=
NULL
;
int32_t
code
=
rebuildDirFromCheckpoint
(
streamPath
,
chkpId
,
&
backendPath
);
char
*
state
=
NULL
;
int32_t
code
=
rebuildDirFromCheckpoint
(
path
,
chkpId
,
&
state
);
qDebug
(
"start to init stream backend at %s"
,
backendPath
);
qDebug
(
"start to init stream backend at %s"
,
state
)
;
uint32_t
dbMemLimit
=
nextPow2
(
tsMaxStreamBackendCache
)
<<
20
;
SBackendWrapper
*
pHandle
=
taosMemoryCalloc
(
1
,
sizeof
(
SBackendWrapper
));
pHandle
->
list
=
tdListNew
(
sizeof
(
SCfComparator
));
taosThreadMutexInit
(
&
pHandle
->
mutex
,
NULL
);
...
...
@@ -254,12 +254,12 @@ void* streamBackendInit(const char* path, int64_t chkpId) {
char
*
err
=
NULL
;
size_t
nCf
=
0
;
char
**
cfs
=
rocksdb_list_column_families
(
opts
,
state
,
&
nCf
,
&
err
);
char
**
cfs
=
rocksdb_list_column_families
(
opts
,
backendPath
,
&
nCf
,
&
err
);
if
(
nCf
==
0
||
nCf
==
1
||
err
!=
NULL
)
{
taosMemoryFreeClear
(
err
);
pHandle
->
db
=
rocksdb_open
(
opts
,
p
ath
,
&
err
);
pHandle
->
db
=
rocksdb_open
(
opts
,
backendP
ath
,
&
err
);
if
(
err
!=
NULL
)
{
qError
(
"failed to open rocksdb, path:%s, reason:%s"
,
p
ath
,
err
);
qError
(
"failed to open rocksdb, path:%s, reason:%s"
,
backendP
ath
,
err
);
taosMemoryFreeClear
(
err
);
goto
_EXIT
;
}
...
...
@@ -267,13 +267,13 @@ void* streamBackendInit(const char* path, int64_t chkpId) {
/*
list all cf and get prefix
*/
streamStateOpenBackendCf
(
pHandle
,
(
char
*
)
state
,
cfs
,
nCf
);
streamStateOpenBackendCf
(
pHandle
,
(
char
*
)
backendPath
,
cfs
,
nCf
);
}
if
(
cfs
!=
NULL
)
{
rocksdb_list_column_families_destroy
(
cfs
,
nCf
);
}
qDebug
(
"succ to init stream backend at %s, backend:%p"
,
state
,
pHandle
);
taosMemoryFreeClear
(
state
);
qDebug
(
"succ to init stream backend at %s, backend:%p"
,
backendPath
,
pHandle
);
taosMemoryFreeClear
(
backendPath
);
return
(
void
*
)
pHandle
;
_EXIT:
...
...
@@ -285,9 +285,9 @@ _EXIT:
taosHashCleanup
(
pHandle
->
cfInst
);
rocksdb_compactionfilterfactory_destroy
(
pHandle
->
filterFactory
);
tdListFree
(
pHandle
->
list
);
taosMemoryFree
(
state
);
taosMemoryFree
(
backendPath
);
taosMemoryFree
(
pHandle
);
qDebug
(
"failed to init stream backend at %s"
,
p
ath
);
qDebug
(
"failed to init stream backend at %s"
,
backendP
ath
);
return
NULL
;
}
void
streamBackendCleanup
(
void
*
arg
)
{
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
b4de0892
...
...
@@ -51,8 +51,8 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
if
(
tdbOpen
(
pMeta
->
path
,
16
*
1024
,
1
,
&
pMeta
->
db
,
0
)
<
0
)
{
goto
_err
;
}
memset
(
streamPath
,
0
,
len
);
memset
(
streamPath
,
0
,
len
);
sprintf
(
streamPath
,
"%s/%s"
,
pMeta
->
path
,
"checkpoints"
);
code
=
taosMulModeMkDir
(
streamPath
,
0755
);
if
(
code
!=
0
)
{
...
...
@@ -90,13 +90,13 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
pMeta
->
ahandle
=
ahandle
;
pMeta
->
expandFunc
=
expandFunc
;
memset
(
streamPath
,
0
,
len
);
sprintf
(
streamPath
,
"%s/%s"
,
pMeta
->
path
,
"state"
);
code
=
taosMulModeMkDir
(
streamPath
,
0755
);
if
(
code
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
code
);
goto
_err
;
}
//
memset(streamPath, 0, len);
//
sprintf(streamPath, "%s/%s", pMeta->path, "state");
//
code = taosMulModeMkDir(streamPath, 0755);
//
if (code != 0) {
//
terrno = TAOS_SYSTEM_ERROR(code);
//
goto _err;
//
}
pMeta
->
pTaskBackendUnique
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_ENTRY_LOCK
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录