Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
eba557ef
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
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看板
提交
eba557ef
编写于
4月 23, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
7cf2911c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
42 addition
and
19 deletion
+42
-19
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
+1
-1
source/dnode/vnode/src/tsdb/dev/tsdbFSet.h
source/dnode/vnode/src/tsdb/dev/tsdbFSet.h
+2
-2
source/dnode/vnode/src/tsdb/dev/tsdbFile.c
source/dnode/vnode/src/tsdb/dev/tsdbFile.c
+10
-10
source/dnode/vnode/src/tsdb/dev/tsdbFile.h
source/dnode/vnode/src/tsdb/dev/tsdbFile.h
+29
-6
未找到文件。
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
浏览文件 @
eba557ef
...
@@ -59,7 +59,7 @@ static int32_t open_committer_writer(SCommitter *pCommitter) {
...
@@ -59,7 +59,7 @@ static int32_t open_committer_writer(SCommitter *pCommitter) {
}
else
{
}
else
{
conf
.
file
.
type
=
TSDB_FTYPE_STT
;
conf
.
file
.
type
=
TSDB_FTYPE_STT
;
if
(
tfsAllocDisk
(
pTsdb
->
pVnode
->
pTfs
,
pCommitter
->
expLevel
,
&
conf
.
file
.
di
skI
d
)
<
0
)
{
if
(
tfsAllocDisk
(
pTsdb
->
pVnode
->
pTfs
,
pCommitter
->
expLevel
,
&
conf
.
file
.
did
)
<
0
)
{
code
=
TSDB_CODE_FS_NO_VALID_DISK
;
code
=
TSDB_CODE_FS_NO_VALID_DISK
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
}
...
...
source/dnode/vnode/src/tsdb/dev/tsdbFSet.h
浏览文件 @
eba557ef
...
@@ -49,8 +49,8 @@ struct SSttLvl {
...
@@ -49,8 +49,8 @@ struct SSttLvl {
struct
SFileSet
{
struct
SFileSet
{
int32_t
fid
;
int32_t
fid
;
int64_t
nextid
;
int64_t
nextid
;
struct
STFile
*
farr
[
TSDB_FTYPE_MAX
];
struct
STFile
*
farr
[
TSDB_FTYPE_MAX
];
// file array
SSttLvl
lvl0
;
// level 0 of .stt
SSttLvl
lvl0
;
// level 0 of .stt
};
};
int32_t
tsdbFileSetCreate
(
int32_t
fid
,
struct
SFileSet
**
ppSet
);
int32_t
tsdbFileSetCreate
(
int32_t
fid
,
struct
SFileSet
**
ppSet
);
...
...
source/dnode/vnode/src/tsdb/dev/tsdbFile.c
浏览文件 @
eba557ef
...
@@ -51,16 +51,16 @@ int32_t tsdbTFileInit(STsdb *pTsdb, struct STFile *pFile) {
...
@@ -51,16 +51,16 @@ int32_t tsdbTFileInit(STsdb *pTsdb, struct STFile *pFile) {
STfs
*
pTfs
=
pVnode
->
pTfs
;
STfs
*
pTfs
=
pVnode
->
pTfs
;
if
(
pTfs
)
{
if
(
pTfs
)
{
snprintf
(
pFile
->
fname
,
//
snprintf
(
pFile
->
fname
,
//
TSDB_FILENAME_LEN
,
//
TSDB_FILENAME_LEN
,
//
"%s%s%s%sv%df%dver%"
PRId64
"%s"
,
//
"%s%s%s%sv%df%dver%"
PRId64
"%s"
,
//
tfsGetDiskPath
(
pTfs
,
pFile
->
di
skI
d
),
//
tfsGetDiskPath
(
pTfs
,
pFile
->
did
),
//
TD_DIRSEP
,
//
TD_DIRSEP
,
//
pTsdb
->
path
,
//
pTsdb
->
path
,
//
TD_DIRSEP
,
//
TD_DIRSEP
,
//
TD_VID
(
pVnode
),
//
TD_VID
(
pVnode
),
//
pFile
->
fid
,
//
pFile
->
fid
,
//
pFile
->
cid
,
//
pFile
->
cid
,
//
tsdb_ftype_suffix
[
pFile
->
type
]);
tsdb_ftype_suffix
[
pFile
->
type
]);
}
else
{
}
else
{
snprintf
(
pFile
->
fname
,
//
snprintf
(
pFile
->
fname
,
//
...
...
source/dnode/vnode/src/tsdb/dev/tsdbFile.h
浏览文件 @
eba557ef
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
typedef
struct
STFile
STFile
;
typedef
enum
{
typedef
enum
{
TSDB_FTYPE_HEAD
=
0
,
// .head
TSDB_FTYPE_HEAD
=
0
,
// .head
TSDB_FTYPE_DATA
,
// .data
TSDB_FTYPE_DATA
,
// .data
...
@@ -31,20 +33,41 @@ typedef enum {
...
@@ -31,20 +33,41 @@ typedef enum {
TSDB_FTYPE_STT
,
// .stt
TSDB_FTYPE_STT
,
// .stt
}
tsdb_ftype_t
;
}
tsdb_ftype_t
;
int32_t
tsdbTFileCreate
(
const
struct
STFile
*
config
,
struct
STFile
**
ppFile
);
int32_t
tsdbTFileDestroy
(
struct
STFile
*
pFile
);
int32_t
tsdbTFileInit
(
STsdb
*
pTsdb
,
struct
STFile
*
pFile
);
int32_t
tsdbTFileClear
(
struct
STFile
*
pFile
);
struct
STFile
{
struct
STFile
{
char
fname
[
TSDB_FILENAME_LEN
];
char
fname
[
TSDB_FILENAME_LEN
];
int32_t
ref
;
int32_t
ref
;
int32_t
state
;
tsdb_ftype_t
type
;
tsdb_ftype_t
type
;
SDiskID
di
skI
d
;
SDiskID
did
;
int64_t
size
;
int64_t
size
;
int64_t
cid
;
int64_t
cid
;
int32_t
fid
;
int32_t
fid
;
};
union
{
struct
{
int32_t
level
;
// level of .stt
int32_t
nSeg
;
// number of segments in .stt
}
stt
;
struct
{
// TODO
}
head
;
struct
{
// TODO
}
data
;
struct
{
// TODO
}
sma
;
struct
{
// TODO
}
tomb
;
};
int32_t
tsdbTFileCreate
(
const
struct
STFile
*
config
,
struct
STFile
**
ppFile
);
LISTD
(
struct
STFile
)
listNode
;
int32_t
tsdbTFileDestroy
(
struct
STFile
*
pFile
);
};
int32_t
tsdbTFileInit
(
STsdb
*
pTsdb
,
struct
STFile
*
pFile
);
int32_t
tsdbTFileClear
(
struct
STFile
*
pFile
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录