Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
89a9e013
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看板
提交
89a9e013
编写于
6月 06, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
96d29bc9
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
354 addition
and
176 deletion
+354
-176
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
+2
-0
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
+338
-168
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
+4
-8
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
+10
-0
未找到文件。
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
浏览文件 @
89a9e013
...
@@ -64,6 +64,8 @@ int32_t tTombBlockFree(STombBlock *delBlock);
...
@@ -64,6 +64,8 @@ int32_t tTombBlockFree(STombBlock *delBlock);
int32_t
tTombBlockClear
(
STombBlock
*
delBlock
);
int32_t
tTombBlockClear
(
STombBlock
*
delBlock
);
int32_t
tTombBlockPut
(
STombBlock
*
delBlock
,
const
STombRecord
*
delRecord
);
int32_t
tTombBlockPut
(
STombBlock
*
delBlock
,
const
STombRecord
*
delRecord
);
int32_t
tTombRecordCmpr
(
const
STombRecord
*
r1
,
const
STombRecord
*
r2
);
// STbStatisBlock ----------
// STbStatisBlock ----------
#define STATIS_RECORD_NUM_ELEM 9
#define STATIS_RECORD_NUM_ELEM 9
typedef
union
{
typedef
union
{
...
...
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
浏览文件 @
89a9e013
此差异已折叠。
点击以展开。
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
浏览文件 @
89a9e013
...
@@ -50,7 +50,6 @@ static int32_t tsdbSttSegReaderOpen(SSttFileReader *reader, int64_t offset, SStt
...
@@ -50,7 +50,6 @@ static int32_t tsdbSttSegReaderOpen(SSttFileReader *reader, int64_t offset, SStt
int32_t
code
=
0
;
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
reader
->
config
->
tsdb
->
pVnode
);
segReader
[
0
]
=
taosMemoryCalloc
(
1
,
sizeof
(
*
segReader
[
0
]));
segReader
[
0
]
=
taosMemoryCalloc
(
1
,
sizeof
(
*
segReader
[
0
]));
if
(
!
segReader
[
0
])
return
TSDB_CODE_OUT_OF_MEMORY
;
if
(
!
segReader
[
0
])
return
TSDB_CODE_OUT_OF_MEMORY
;
...
@@ -61,7 +60,7 @@ static int32_t tsdbSttSegReaderOpen(SSttFileReader *reader, int64_t offset, SStt
...
@@ -61,7 +60,7 @@ static int32_t tsdbSttSegReaderOpen(SSttFileReader *reader, int64_t offset, SStt
_exit:
_exit:
if
(
code
)
{
if
(
code
)
{
TSDB_ERROR_LOG
(
vid
,
lino
,
code
);
TSDB_ERROR_LOG
(
TD_VID
(
reader
->
config
->
tsdb
->
pVnode
)
,
lino
,
code
);
taosMemoryFree
(
segReader
[
0
]);
taosMemoryFree
(
segReader
[
0
]);
segReader
[
0
]
=
NULL
;
segReader
[
0
]
=
NULL
;
}
}
...
@@ -82,7 +81,6 @@ static int32_t tsdbSttSegReaderClose(SSttSegReader **reader) {
...
@@ -82,7 +81,6 @@ static int32_t tsdbSttSegReaderClose(SSttSegReader **reader) {
int32_t
tsdbSttFileReaderOpen
(
const
char
*
fname
,
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
)
{
int32_t
tsdbSttFileReaderOpen
(
const
char
*
fname
,
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
config
->
tsdb
->
pVnode
);
reader
[
0
]
=
taosMemoryCalloc
(
1
,
sizeof
(
*
reader
[
0
]));
reader
[
0
]
=
taosMemoryCalloc
(
1
,
sizeof
(
*
reader
[
0
]));
if
(
reader
[
0
]
==
NULL
)
return
TSDB_CODE_OUT_OF_MEMORY
;
if
(
reader
[
0
]
==
NULL
)
return
TSDB_CODE_OUT_OF_MEMORY
;
...
@@ -112,7 +110,7 @@ int32_t tsdbSttFileReaderOpen(const char *fname, const SSttFileReaderConfig *con
...
@@ -112,7 +110,7 @@ int32_t tsdbSttFileReaderOpen(const char *fname, const SSttFileReaderConfig *con
_exit:
_exit:
if
(
code
)
{
if
(
code
)
{
TSDB_ERROR_LOG
(
vid
,
lino
,
code
);
TSDB_ERROR_LOG
(
TD_VID
(
config
->
tsdb
->
pVnode
)
,
lino
,
code
);
tsdbSttFileReaderClose
(
reader
);
tsdbSttFileReaderClose
(
reader
);
}
}
return
code
;
return
code
;
...
@@ -720,7 +718,6 @@ int32_t tsdbSttFileWriterOpen(const SSttFileWriterConfig *config, SSttFileWriter
...
@@ -720,7 +718,6 @@ int32_t tsdbSttFileWriterOpen(const SSttFileWriterConfig *config, SSttFileWriter
int32_t
tsdbSttFileWriterClose
(
SSttFileWriter
**
writer
,
int8_t
abort
,
TFileOpArray
*
opArray
)
{
int32_t
tsdbSttFileWriterClose
(
SSttFileWriter
**
writer
,
int8_t
abort
,
TFileOpArray
*
opArray
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
writer
[
0
]
->
config
->
tsdb
->
pVnode
);
if
(
writer
[
0
]
->
ctx
->
opened
)
{
if
(
writer
[
0
]
->
ctx
->
opened
)
{
if
(
abort
)
{
if
(
abort
)
{
...
@@ -737,7 +734,7 @@ int32_t tsdbSttFileWriterClose(SSttFileWriter **writer, int8_t abort, TFileOpArr
...
@@ -737,7 +734,7 @@ int32_t tsdbSttFileWriterClose(SSttFileWriter **writer, int8_t abort, TFileOpArr
_exit:
_exit:
if
(
code
)
{
if
(
code
)
{
TSDB_ERROR_LOG
(
vid
,
lino
,
code
);
TSDB_ERROR_LOG
(
TD_VID
(
writer
[
0
]
->
config
->
tsdb
->
pVnode
)
,
lino
,
code
);
}
}
return
code
;
return
code
;
}
}
...
@@ -745,7 +742,6 @@ _exit:
...
@@ -745,7 +742,6 @@ _exit:
int32_t
tsdbSttFileWriteTSData
(
SSttFileWriter
*
writer
,
SRowInfo
*
row
)
{
int32_t
tsdbSttFileWriteTSData
(
SSttFileWriter
*
writer
,
SRowInfo
*
row
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
writer
->
config
->
tsdb
->
pVnode
);
if
(
!
writer
->
ctx
->
opened
)
{
if
(
!
writer
->
ctx
->
opened
)
{
code
=
tsdbSttFWriterDoOpen
(
writer
);
code
=
tsdbSttFWriterDoOpen
(
writer
);
...
@@ -833,7 +829,7 @@ int32_t tsdbSttFileWriteTSData(SSttFileWriter *writer, SRowInfo *row) {
...
@@ -833,7 +829,7 @@ int32_t tsdbSttFileWriteTSData(SSttFileWriter *writer, SRowInfo *row) {
_exit:
_exit:
if
(
code
)
{
if
(
code
)
{
TSDB_ERROR_LOG
(
vid
,
lino
,
code
);
TSDB_ERROR_LOG
(
TD_VID
(
writer
->
config
->
tsdb
->
pVnode
)
,
lino
,
code
);
}
}
return
code
;
return
code
;
}
}
...
...
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
浏览文件 @
89a9e013
...
@@ -45,6 +45,16 @@ int32_t tTombBlockPut(STombBlock *delBlock, const STombRecord *delRecord) {
...
@@ -45,6 +45,16 @@ int32_t tTombBlockPut(STombBlock *delBlock, const STombRecord *delRecord) {
return
0
;
return
0
;
}
}
int32_t
tTombRecordCmpr
(
const
STombRecord
*
r1
,
const
STombRecord
*
r2
)
{
if
(
r1
->
suid
<
r2
->
suid
)
return
-
1
;
if
(
r1
->
suid
>
r2
->
suid
)
return
1
;
if
(
r1
->
uid
<
r2
->
uid
)
return
-
1
;
if
(
r1
->
uid
>
r2
->
uid
)
return
1
;
if
(
r1
->
version
<
r2
->
version
)
return
-
1
;
if
(
r1
->
version
>
r2
->
version
)
return
1
;
return
0
;
}
// STbStatisBlock ----------
// STbStatisBlock ----------
int32_t
tStatisBlockInit
(
STbStatisBlock
*
statisBlock
)
{
int32_t
tStatisBlockInit
(
STbStatisBlock
*
statisBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
);
++
i
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录