Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fd16a6b3
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看板
提交
fd16a6b3
编写于
4月 06, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
c6d9a3a4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
84 addition
and
48 deletion
+84
-48
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
+57
-47
source/dnode/vnode/src/tsdb/dev/tsdbFS.h
source/dnode/vnode/src/tsdb/dev/tsdbFS.h
+3
-0
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.c
+15
-1
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.h
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.h
+9
-0
未找到文件。
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
浏览文件 @
fd16a6b3
...
@@ -262,6 +262,11 @@ static int32_t open_committer(STsdb *pTsdb, SCommitInfo *pInfo, SCommitter *pCom
...
@@ -262,6 +262,11 @@ static int32_t open_committer(STsdb *pTsdb, SCommitInfo *pInfo, SCommitter *pCom
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
}
pCommitter
->
aFileOp
=
taosArrayInit
(
10
,
sizeof
(
struct
SFileOp
));
if
(
pCommitter
->
aFileOp
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
// start loop
// start loop
pCommitter
->
nextKey
=
pTsdb
->
imem
->
minKey
;
// TODO
pCommitter
->
nextKey
=
pTsdb
->
imem
->
minKey
;
// TODO
...
@@ -277,7 +282,12 @@ _exit:
...
@@ -277,7 +282,12 @@ _exit:
static
int32_t
close_committer
(
SCommitter
*
pCommiter
,
int32_t
eno
)
{
static
int32_t
close_committer
(
SCommitter
*
pCommiter
,
int32_t
eno
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
// TODO
int32_t
lino
;
// code = tsdbFSBegin(pCommiter->pTsdb, pCommiter->aFileOp);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
_exit:
return
code
;
return
code
;
}
}
...
@@ -327,49 +337,49 @@ _exit:
...
@@ -327,49 +337,49 @@ _exit:
return
code
;
return
code
;
}
}
int32_t
tsdbCommitCommit
(
STsdb
*
pTsdb
)
{
// int32_t tsdbCommitCommit(STsdb *pTsdb) {
int32_t
code
=
0
;
// int32_t code = 0;
int32_t
lino
=
0
;
// int32_t lino = 0;
SMemTable
*
pMemTable
=
pTsdb
->
imem
;
// SMemTable *pMemTable = pTsdb->imem;
// lock
// // lock
taosThreadRwlockWrlock
(
&
pTsdb
->
rwLock
);
// taosThreadRwlockWrlock(&pTsdb->rwLock);
code
=
tsdbFSCommit
(
pTsdb
);
// code = tsdbFSCommit(pTsdb);
if
(
code
)
{
// if (code) {
taosThreadRwlockUnlock
(
&
pTsdb
->
rwLock
);
// taosThreadRwlockUnlock(&pTsdb->rwLock);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
// TSDB_CHECK_CODE(code, lino, _exit);
}
// }
pTsdb
->
imem
=
NULL
;
// pTsdb->imem = NULL;
// unlock
// // unlock
taosThreadRwlockUnlock
(
&
pTsdb
->
rwLock
);
// taosThreadRwlockUnlock(&pTsdb->rwLock);
if
(
pMemTable
)
{
// if (pMemTable) {
tsdbUnrefMemTable
(
pMemTable
,
NULL
,
true
);
// tsdbUnrefMemTable(pMemTable, NULL, true);
}
// }
_exit:
// _exit:
if
(
code
)
{
// if (code) {
tsdbError
(
"vgId:%d, %s failed at line %d since %s"
,
TD_VID
(
pTsdb
->
pVnode
),
__func__
,
lino
,
tstrerror
(
code
));
// tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
}
else
{
// } else {
tsdbInfo
(
"vgId:%d, tsdb finish commit"
,
TD_VID
(
pTsdb
->
pVnode
));
// tsdbInfo("vgId:%d, tsdb finish commit", TD_VID(pTsdb->pVnode));
}
// }
return
code
;
// return code;
}
// }
int32_t
tsdbCommitAbort
(
STsdb
*
pTsdb
)
{
// int32_t tsdbCommitAbort(STsdb *pTsdb) {
int32_t
code
=
0
;
// int32_t code = 0;
int32_t
lino
=
0
;
// int32_t lino = 0;
code
=
tsdbFSRollback
(
pTsdb
);
// code = tsdbFSRollback(pTsdb);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
// TSDB_CHECK_CODE(code, lino, _exit);
_exit:
// _exit:
if
(
code
)
{
// if (code) {
tsdbError
(
"vgId:%d, %s failed at line %d since %s"
,
TD_VID
(
pTsdb
->
pVnode
),
__func__
,
lino
,
tstrerror
(
code
));
// tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
}
else
{
// } else {
tsdbInfo
(
"vgId:%d, tsdb rollback commit"
,
TD_VID
(
pTsdb
->
pVnode
));
// tsdbInfo("vgId:%d, tsdb rollback commit", TD_VID(pTsdb->pVnode));
}
// }
return
code
;
// return code;
}
// }
\ No newline at end of file
\ No newline at end of file
source/dnode/vnode/src/tsdb/dev/tsdbFS.h
浏览文件 @
fd16a6b3
...
@@ -26,8 +26,11 @@ extern "C" {
...
@@ -26,8 +26,11 @@ extern "C" {
struct
STFileSystem
;
struct
STFileSystem
;
/* Exposed APIs */
/* Exposed APIs */
// open/close
int32_t
tsdbOpenFileSystem
(
STsdb
*
pTsdb
,
struct
STFileSystem
**
ppFS
,
int8_t
rollback
);
int32_t
tsdbOpenFileSystem
(
STsdb
*
pTsdb
,
struct
STFileSystem
**
ppFS
,
int8_t
rollback
);
int32_t
tsdbCloseFileSystem
(
struct
STFileSystem
**
ppFS
);
int32_t
tsdbCloseFileSystem
(
struct
STFileSystem
**
ppFS
);
// txn
// int32_t tsdb
/* Exposed Structs */
/* Exposed Structs */
struct
STFileSystem
{
struct
STFileSystem
{
...
...
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.c
浏览文件 @
fd16a6b3
...
@@ -11,4 +11,18 @@
...
@@ -11,4 +11,18 @@
*
*
* You should have received a copy of the GNU Affero General Public License
* 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/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
\ No newline at end of file
#include "tsdbSttFReader.h"
int32_t
tsdbSttFReaderOpen
(
const
struct
SSttFReaderConf
*
pConf
,
struct
SSttFReader
**
ppReader
)
{
int32_t
code
=
0
;
// TODO
return
code
;
}
int32_t
tsdbSttFReaderClose
(
struct
SSttFReader
*
pReader
)
{
int32_t
code
=
0
;
// TODO
return
code
;
}
source/dnode/vnode/src/tsdb/dev/tsdbSttFReader.h
浏览文件 @
fd16a6b3
...
@@ -16,15 +16,24 @@
...
@@ -16,15 +16,24 @@
#ifndef _TD_TSDB_STT_FILE_READER_H
#ifndef _TD_TSDB_STT_FILE_READER_H
#define _TD_TSDB_STT_FILE_READER_H
#define _TD_TSDB_STT_FILE_READER_H
#include "tsdb.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
/* Exposed Handle */
/* Exposed Handle */
struct
SSttFReader
;
struct
SSttFReaderConf
;
/* Exposed APIs */
/* Exposed APIs */
int32_t
tsdbSttFReaderOpen
(
const
struct
SSttFReaderConf
*
pConf
,
struct
SSttFReader
**
ppReader
);
int32_t
tsdbSttFReaderClose
(
struct
SSttFReader
*
pReader
);
/* Exposed Structs */
/* Exposed Structs */
struct
SSttFReaderConf
{
// TODO
};
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录