Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
81efe36d
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看板
提交
81efe36d
编写于
4月 23, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
172eeee6
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
69 addition
and
47 deletion
+69
-47
source/dnode/vnode/src/tsdb/dev/inc/tsdbDef.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbDef.h
+11
-8
source/dnode/vnode/src/tsdb/dev/inc/tsdbFS.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbFS.h
+1
-1
source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h
+5
-5
source/dnode/vnode/src/tsdb/dev/inc/tsdbFile.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbFile.h
+1
-1
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFReaderWriter.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFReaderWriter.h
+34
-15
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
+1
-1
source/dnode/vnode/src/tsdb/dev/tsdbDataFReaderWriter.c
source/dnode/vnode/src/tsdb/dev/tsdbDataFReaderWriter.c
+7
-7
source/dnode/vnode/src/tsdb/dev/tsdbSttFReaderWriter.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFReaderWriter.c
+9
-9
未找到文件。
source/dnode/vnode/src/tsdb/dev/inc/tsdbDef.h
浏览文件 @
81efe36d
...
...
@@ -21,16 +21,19 @@
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
SFDataPtr
{
typedef
struct
SFDataPtr
SFDataPtr
;
extern
int32_t
tsdbOpenFile
(
const
char
*
path
,
int32_t
szPage
,
int32_t
flag
,
STsdbFD
**
ppFD
);
extern
void
tsdbCloseFile
(
STsdbFD
**
ppFD
);
extern
int32_t
tsdbWriteFile
(
STsdbFD
*
pFD
,
int64_t
offset
,
const
uint8_t
*
pBuf
,
int64_t
size
);
extern
int32_t
tsdbReadFile
(
STsdbFD
*
pFD
,
int64_t
offset
,
uint8_t
*
pBuf
,
int64_t
size
);
extern
int32_t
tsdbFsyncFile
(
STsdbFD
*
pFD
);
struct
SFDataPtr
{
int64_t
offset
;
int64_t
size
;
}
SFDataPtr
;
typedef
struct
{
int64_t
prevFooter
;
SFDataPtr
dict
[
4
];
// 0:bloom filter, 1:SSttBlk, 2:STbStatisBlk, 3:SDelBlk
uint8_t
reserved
[
24
];
}
SFSttFooter
;
};
#ifdef __cplusplus
}
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbFS.h
浏览文件 @
81efe36d
...
...
@@ -16,7 +16,7 @@
#ifndef _TSDB_FILE_SYSTEM_H
#define _TSDB_FILE_SYSTEM_H
#include "tsdb
Def
.h"
#include "tsdb
FSet
.h"
#ifdef __cplusplus
extern
"C"
{
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h
浏览文件 @
81efe36d
...
...
@@ -16,7 +16,7 @@
#ifndef _TSDB_FILE_SET_H
#define _TSDB_FILE_SET_H
#include "tsdb
Def
.h"
#include "tsdb
File
.h"
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -33,10 +33,10 @@ typedef enum {
}
tsdb_fop_t
;
struct
SFileOp
{
tsdb_fop_t
op
;
int32_t
fid
;
struct
STFile
oState
;
// old file state
struct
STFile
nState
;
// new file state
tsdb_fop_t
op
;
int32_t
fid
;
STFile
oState
;
// old file state
STFile
nState
;
// new file state
};
struct
SSttLvl
{
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbFile.h
浏览文件 @
81efe36d
...
...
@@ -66,7 +66,7 @@ struct STFile {
}
tomb
;
};
LISTD
(
struct
STFile
)
listNode
;
LISTD
(
STFile
)
listNode
;
};
#ifdef __cplusplus
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFReaderWriter.h
浏览文件 @
81efe36d
...
...
@@ -16,28 +16,47 @@
#ifndef _TSDB_STT_FILE_WRITER_H
#define _TSDB_STT_FILE_WRITER_H
#include "tsdb
Def
.h"
#include "tsdb
FS
.h"
#ifdef __cplusplus
extern
"C"
{
#endif
struct
SSttFWriter
;
struct
SSttFWriterConf
{
STsdb
*
pTsdb
;
struct
STFile
file
;
int32_t
maxRow
;
int32_t
szPage
;
int8_t
cmprAlg
;
SSkmInfo
*
pSkmTb
;
SSkmInfo
*
pSkmRow
;
uint8_t
**
aBuf
;
// SSttFReader ==========================================
typedef
struct
SSttFReader
SSttFReader
;
typedef
struct
SSttFReaderConfig
SSttFReaderConfig
;
int32_t
tsdbSttFReaderOpen
(
const
SSttFReaderConfig
*
config
,
SSttFReader
**
ppReader
);
int32_t
tsdbSttFReaderClose
(
SSttFReader
**
ppReader
);
// SSttFWriter ==========================================
typedef
struct
SSttFWriter
SSttFWriter
;
typedef
struct
SSttFWriterConfig
SSttFWriterConfig
;
int32_t
tsdbSttFWriterOpen
(
const
SSttFWriterConfig
*
config
,
SSttFWriter
**
ppWriter
);
int32_t
tsdbSttFWriterClose
(
SSttFWriter
**
ppWriter
,
int8_t
abort
,
struct
SFileOp
*
op
);
int32_t
tsdbSttFWriteTSData
(
SSttFWriter
*
pWriter
,
TABLEID
*
tbid
,
TSDBROW
*
pRow
);
int32_t
tsdbSttFWriteDLData
(
SSttFWriter
*
pWriter
,
TABLEID
*
tbid
,
SDelData
*
pDelData
);
/* ------------------------------------------------- */
struct
SSttFWriterConfig
{
STsdb
*
pTsdb
;
STFile
file
;
int32_t
maxRow
;
int32_t
szPage
;
int8_t
cmprAlg
;
SSkmInfo
*
pSkmTb
;
SSkmInfo
*
pSkmRow
;
uint8_t
**
aBuf
;
};
int32_t
tsdbSttFWriterOpen
(
const
struct
SSttFWriterConf
*
pConf
,
struct
SSttFWriter
**
ppWriter
);
int32_t
tsdbSttFWriterClose
(
struct
SSttFWriter
**
ppWriter
,
int8_t
abort
,
struct
SFileOp
*
op
);
int32_t
tsdbSttFWriteTSData
(
struct
SSttFWriter
*
pWriter
,
TABLEID
*
tbid
,
TSDBROW
*
pRow
);
int32_t
tsdbSttFWriteDLData
(
struct
SSttFWriter
*
pWriter
,
TABLEID
*
tbid
,
SDelData
*
pDelData
);
struct
SSttFReaderConfig
{
STsdb
*
pTsdb
;
SSkmInfo
*
pSkmTb
;
SSkmInfo
*
pSkmRow
;
uint8_t
**
aBuf
;
// TODO
};
#ifdef __cplusplus
}
...
...
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
浏览文件 @
81efe36d
...
...
@@ -44,7 +44,7 @@ static int32_t open_committer_writer(SCommitter *pCommitter) {
STsdb
*
pTsdb
=
pCommitter
->
pTsdb
;
struct
SSttFWriterConf
conf
=
{
struct
SSttFWriterConf
ig
conf
=
{
.
pTsdb
=
pCommitter
->
pTsdb
,
.
maxRow
=
pCommitter
->
maxRow
,
.
szPage
=
pCommitter
->
pTsdb
->
pVnode
->
config
.
tsdbPageSize
,
...
...
source/dnode/vnode/src/tsdb/dev/tsdbDataFReaderWriter.c
浏览文件 @
81efe36d
...
...
@@ -15,11 +15,11 @@
#include "dev.h"
struct
SDataFReader
{
STsdb
*
pTsdb
;
// TODO
};
//
struct SDataFReader {
//
STsdb *pTsdb;
//
// TODO
//
};
struct
SDataFWriter
{
STsdb
*
pTsdb
;
};
\ No newline at end of file
// struct SDataFWriter {
// STsdb *pTsdb;
// };
\ No newline at end of file
source/dnode/vnode/src/tsdb/dev/tsdbSttFReaderWriter.c
浏览文件 @
81efe36d
...
...
@@ -15,16 +15,16 @@
#include "dev.h"
extern
int32_t
tsdbOpenFile
(
const
char
*
path
,
int32_t
szPage
,
int32_t
flag
,
STsdbFD
**
ppFD
);
extern
void
tsdbCloseFile
(
STsdbFD
**
ppFD
)
;
extern
int32_t
tsdbWriteFile
(
STsdbFD
*
pFD
,
int64_t
offset
,
const
uint8_t
*
pBuf
,
int64_t
size
);
extern
int32_t
tsdbReadFile
(
STsdbFD
*
pFD
,
int64_t
offset
,
uint8_t
*
pBuf
,
int64_t
size
)
;
extern
int32_t
tsdbFsyncFile
(
STsdbFD
*
pFD
)
;
typedef
struct
{
int64_t
prevFooter
;
SFDataPtr
dict
[
4
];
// 0:bloom filter, 1:SSttBlk, 2:STbStatisBlk, 3:SDelBlk
uint8_t
reserved
[
24
]
;
}
SFSttFooter
;
struct
SSttFWriter
{
struct
SSttFWriterConf
config
;
SSttFWriterConfig
config
;
// file
struct
STFile
tFile
;
STFile
tFile
;
// data
SFSttFooter
footer
;
SBlockData
bData
;
...
...
@@ -325,7 +325,7 @@ static int32_t write_file_header(struct SSttFWriter *pWriter) {
return
0
;
}
static
int32_t
create_stt_fwriter
(
const
struct
SSttFWriterConf
*
pConf
,
struct
SSttFWriter
**
ppWriter
)
{
static
int32_t
create_stt_fwriter
(
const
SSttFWriterConfig
*
pConf
,
struct
SSttFWriter
**
ppWriter
)
{
int32_t
code
=
0
;
// alloc
...
...
@@ -449,7 +449,7 @@ static int32_t close_stt_fwriter(struct SSttFWriter *pWriter) {
return
0
;
}
int32_t
tsdbSttFWriterOpen
(
const
struct
SSttFWriterConf
*
pConf
,
struct
SSttFWriter
**
ppWriter
)
{
int32_t
tsdbSttFWriterOpen
(
const
SSttFWriterConfig
*
pConf
,
struct
SSttFWriter
**
ppWriter
)
{
int32_t
code
=
0
;
int32_t
lino
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录