Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
23e78dd9
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看板
提交
23e78dd9
编写于
3月 27, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
8f84e886
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
79 addition
and
8 deletion
+79
-8
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
+14
-3
source/dnode/vnode/src/tsdb/dev/tsdbFS.c
source/dnode/vnode/src/tsdb/dev/tsdbFS.c
+3
-3
source/dnode/vnode/src/tsdb/dev/tsdbFS.h
source/dnode/vnode/src/tsdb/dev/tsdbFS.h
+1
-1
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.c
+14
-0
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.h
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.h
+33
-0
source/dnode/vnode/src/tsdb/tsdbOpen.c
source/dnode/vnode/src/tsdb/tsdbOpen.c
+14
-1
未找到文件。
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
浏览文件 @
23e78dd9
...
...
@@ -40,9 +40,20 @@ static int32_t tsdbCommitOpenWriter(SCommitter *pCommitter) {
int32_t
code
;
int32_t
lino
;
SSttFile
sttFile
=
{
0
};
// TODO
code
=
tsdbSttFWriterOpen
(
NULL
/*TODO*/
,
&
pCommitter
->
pWriter
);
struct
SSttFWriterConf
conf
=
{
.
pTsdb
=
pCommitter
->
pTsdb
,
.
file
=
{
0
},
.
pSkmTb
=
NULL
,
.
pSkmRow
=
NULL
,
.
maxRow
=
pCommitter
->
maxRow
,
.
szPage
=
pCommitter
->
pTsdb
->
pVnode
->
config
.
tsdbPageSize
,
.
cmprAlg
=
pCommitter
->
cmprAlg
,
.
aBuf
=
NULL
,
};
// taosArraySearch(pCommitter->pTsdb);
code
=
tsdbSttFWriterOpen
(
&
conf
,
&
pCommitter
->
pWriter
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
_exit:
...
...
source/dnode/vnode/src/tsdb/dev/tsdbFS.c
浏览文件 @
23e78dd9
...
...
@@ -37,7 +37,7 @@ static int32_t destroy_file_system(struct STFileSystem **ppFS) {
return
0
;
}
static
int32_t
open_file_system
(
struct
STFileSystem
*
pFS
)
{
static
int32_t
open_file_system
(
struct
STFileSystem
*
pFS
,
int8_t
rollback
)
{
// TODO
return
0
;
}
...
...
@@ -47,14 +47,14 @@ static int32_t close_file_system(struct STFileSystem *pFS) {
return
0
;
}
int32_t
tsdbOpenFileSystem
(
STsdb
*
pTsdb
,
struct
STFileSystem
**
ppFS
)
{
int32_t
tsdbOpenFileSystem
(
STsdb
*
pTsdb
,
struct
STFileSystem
**
ppFS
,
int8_t
rollback
)
{
int32_t
code
;
int32_t
lino
;
code
=
create_file_system
(
pTsdb
,
ppFS
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
open_file_system
(
ppFS
[
0
]);
code
=
open_file_system
(
ppFS
[
0
]
,
rollback
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
_exit:
...
...
source/dnode/vnode/src/tsdb/dev/tsdbFS.h
浏览文件 @
23e78dd9
...
...
@@ -26,7 +26,7 @@ extern "C" {
struct
STFileSystem
;
/* Exposed APIs */
int32_t
tsdbOpenFileSystem
(
STsdb
*
pTsdb
,
struct
STFileSystem
**
ppFS
);
int32_t
tsdbOpenFileSystem
(
STsdb
*
pTsdb
,
struct
STFileSystem
**
ppFS
,
int8_t
rollback
);
int32_t
tsdbCloseFileSystem
(
struct
STFileSystem
**
ppFS
);
/* Exposed Structs */
...
...
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.c
0 → 100644
浏览文件 @
23e78dd9
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
\ No newline at end of file
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.h
0 → 100644
浏览文件 @
23e78dd9
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_TSDB_STT_FILE_READER_H
#define _TD_TSDB_STT_FILE_READER_H
#ifdef __cplusplus
extern
"C"
{
#endif
/* Exposed Handle */
/* Exposed APIs */
/* Exposed Structs */
#ifdef __cplusplus
}
#endif
#endif
/*_TD_TSDB_STT_FILE_READER_H*/
\ No newline at end of file
source/dnode/vnode/src/tsdb/tsdbOpen.c
浏览文件 @
23e78dd9
...
...
@@ -14,6 +14,9 @@
*/
#include "tsdb.h"
#ifdef USE_DEV_CODE
#include "dev/dev.h"
#endif
int32_t
tsdbSetKeepCfg
(
STsdb
*
pTsdb
,
STsdbCfg
*
pCfg
)
{
STsdbKeepCfg
*
pKeepCfg
=
&
pTsdb
->
keepCfg
;
...
...
@@ -65,10 +68,16 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee
taosMkDir
(
pTsdb
->
path
);
}
// open tsdb
// open tsdb
#ifdef USE_DEV_CODE
if
(
tsdbOpenFileSystem
(
pTsdb
,
&
pTsdb
->
pFS
,
rollback
)
<
0
)
{
goto
_err
;
}
#else
if
(
tsdbFSOpen
(
pTsdb
,
rollback
)
<
0
)
{
goto
_err
;
}
#endif
if
(
tsdbOpenCache
(
pTsdb
)
<
0
)
{
goto
_err
;
...
...
@@ -94,7 +103,11 @@ int tsdbClose(STsdb **pTsdb) {
taosThreadRwlockDestroy
(
&
(
*
pTsdb
)
->
rwLock
);
#ifndef USE_DEV_CODE
tsdbFSClose
(
*
pTsdb
);
#else
tsdbCloseFileSystem
(
&
(
*
pTsdb
)
->
pFS
);
#endif
tsdbCloseCache
(
*
pTsdb
);
taosMemoryFreeClear
(
*
pTsdb
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录