Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
73f8dc6a
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看板
提交
73f8dc6a
编写于
12月 01, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
915e9a8a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
33 addition
and
33 deletion
+33
-33
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+1
-1
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+3
-3
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+4
-4
source/dnode/vnode/src/tsdb/tsdbMemTable.c
source/dnode/vnode/src/tsdb/tsdbMemTable.c
+4
-4
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
+6
-6
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+2
-2
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
+11
-11
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+2
-2
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
73f8dc6a
...
...
@@ -156,7 +156,7 @@ int32_t tCmprBlockL(void const *lhs, void const *rhs);
#define tBlockDataLastKey(PBLOCKDATA) TSDBROW_KEY(&tBlockDataLastRow(PBLOCKDATA))
int32_t
tBlockDataCreate
(
SBlockData
*
pBlockData
);
void
tBlockDataDestroy
(
SBlockData
*
pBlockData
,
int8_t
deepClear
);
void
tBlockDataDestroy
(
SBlockData
*
pBlockData
);
int32_t
tBlockDataInit
(
SBlockData
*
pBlockData
,
TABLEID
*
pId
,
STSchema
*
pTSchema
,
int16_t
*
aCid
,
int32_t
nCid
);
void
tBlockDataReset
(
SBlockData
*
pBlockData
);
int32_t
tBlockDataAppendRow
(
SBlockData
*
pBlockData
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
,
int64_t
uid
);
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
73f8dc6a
...
...
@@ -672,7 +672,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow) {
}
else
{
// tBlockDataDestroy(&state->blockData, 1);
if
(
state
->
pBlockData
)
{
tBlockDataDestroy
(
state
->
pBlockData
,
1
);
tBlockDataDestroy
(
state
->
pBlockData
);
state
->
pBlockData
=
NULL
;
}
...
...
@@ -794,7 +794,7 @@ _err:
state
->
aBlockIdx
=
NULL
;
}
if
(
state
->
pBlockData
)
{
tBlockDataDestroy
(
state
->
pBlockData
,
1
);
tBlockDataDestroy
(
state
->
pBlockData
);
state
->
pBlockData
=
NULL
;
}
...
...
@@ -821,7 +821,7 @@ int32_t clearNextRowFromFS(void *iter) {
}
if
(
state
->
pBlockData
)
{
// tBlockDataDestroy(&state->blockData, 1);
tBlockDataDestroy
(
state
->
pBlockData
,
1
);
tBlockDataDestroy
(
state
->
pBlockData
);
state
->
pBlockData
=
NULL
;
}
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
73f8dc6a
...
...
@@ -903,24 +903,24 @@ static void tsdbCommitDataEnd(SCommitter *pCommitter) {
// reader
taosArrayDestroy
(
pCommitter
->
dReader
.
aBlockIdx
);
tMapDataClear
(
&
pCommitter
->
dReader
.
mBlock
);
tBlockDataDestroy
(
&
pCommitter
->
dReader
.
bData
,
1
);
tBlockDataDestroy
(
&
pCommitter
->
dReader
.
bData
);
// merger
for
(
int32_t
iStt
=
0
;
iStt
<
TSDB_MAX_STT_TRIGGER
;
iStt
++
)
{
SDataIter
*
pIter
=
&
pCommitter
->
aDataIter
[
iStt
];
taosArrayDestroy
(
pIter
->
aSttBlk
);
tBlockDataDestroy
(
&
pIter
->
bData
,
1
);
tBlockDataDestroy
(
&
pIter
->
bData
);
}
// writer
taosArrayDestroy
(
pCommitter
->
dWriter
.
aBlockIdx
);
taosArrayDestroy
(
pCommitter
->
dWriter
.
aSttBlk
);
tMapDataClear
(
&
pCommitter
->
dWriter
.
mBlock
);
tBlockDataDestroy
(
&
pCommitter
->
dWriter
.
bData
,
1
);
tBlockDataDestroy
(
&
pCommitter
->
dWriter
.
bData
);
#if USE_STREAM_COMPRESSION
tDiskDataBuilderDestroy
(
pCommitter
->
dWriter
.
pBuilder
);
#else
tBlockDataDestroy
(
&
pCommitter
->
dWriter
.
bDatal
,
1
);
tBlockDataDestroy
(
&
pCommitter
->
dWriter
.
bDatal
);
#endif
tDestroyTSchema
(
pCommitter
->
skmTable
.
pTSchema
);
tDestroyTSchema
(
pCommitter
->
skmRow
.
pTSchema
);
...
...
source/dnode/vnode/src/tsdb/tsdbMemTable.c
浏览文件 @
73f8dc6a
...
...
@@ -641,9 +641,9 @@ static int32_t tsdbInsertColDataToTable(SMemTable *pMemTable, STbData *pTbData,
if
(
key
.
ts
>=
pTbData
->
maxKey
)
{
pTbData
->
maxKey
=
key
.
ts
;
// if (TSDB_CACHE_LAST_ROW(pMemTable->pTsdb->pVnode->config) && pLastRow != NULL
) {
// tsdbCacheInsertLastrow(pMemTable->pTsdb->lruCache, pMemTable->pTsdb, pTbData->uid, pLastRow, true);
//
}
if
(
TSDB_CACHE_LAST_ROW
(
pMemTable
->
pTsdb
->
pVnode
->
config
)
)
{
// tsdbCacheInsertLastrow(pMemTable->pTsdb->lruCache, pMemTable->pTsdb, pTbData->uid, pLastRow, true);
}
}
if
(
TSDB_CACHE_LAST
(
pMemTable
->
pTsdb
->
pVnode
->
config
))
{
...
...
@@ -710,7 +710,7 @@ static int32_t tsdbInsertRowDataToTable(SMemTable *pMemTable, STbData *pTbData,
if
(
key
.
ts
>=
pTbData
->
maxKey
)
{
pTbData
->
maxKey
=
key
.
ts
;
if
(
TSDB_CACHE_LAST_ROW
(
pMemTable
->
pTsdb
->
pVnode
->
config
)
&&
pLastRow
!=
NULL
)
{
if
(
TSDB_CACHE_LAST_ROW
(
pMemTable
->
pTsdb
->
pVnode
->
config
))
{
tsdbCacheInsertLastrow
(
pMemTable
->
pTsdb
->
lruCache
,
pMemTable
->
pTsdb
,
pTbData
->
uid
,
pLastRow
,
true
);
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
浏览文件 @
73f8dc6a
...
...
@@ -89,8 +89,8 @@ void *destroyLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo) {
pLoadInfo
[
i
].
blockIndex
[
0
]
=
-
1
;
pLoadInfo
[
i
].
blockIndex
[
1
]
=
-
1
;
tBlockDataDestroy
(
&
pLoadInfo
[
i
].
blockData
[
0
]
,
true
);
tBlockDataDestroy
(
&
pLoadInfo
[
i
].
blockData
[
1
]
,
true
);
tBlockDataDestroy
(
&
pLoadInfo
[
i
].
blockData
[
0
]);
tBlockDataDestroy
(
&
pLoadInfo
[
i
].
blockData
[
1
]);
taosArrayDestroy
(
pLoadInfo
[
i
].
aSttBlk
);
}
...
...
@@ -154,8 +154,8 @@ static SBlockData *loadLastBlock(SLDataIter *pIter, const char *idStr) {
tsdbDebug
(
"read last block, total load:%d, trigger by uid:%"
PRIu64
", last file index:%d, last block index:%d, entry:%d, rows:%d, %p, elapsed time:%.2f ms, %s"
,
pInfo
->
loadBlocks
,
pIter
->
uid
,
pIter
->
iStt
,
pIter
->
iSttBlk
,
pInfo
->
currentLoadBlockIndex
,
pBlock
->
nRow
,
pBlock
,
el
,
idStr
);
pInfo
->
loadBlocks
,
pIter
->
uid
,
pIter
->
iStt
,
pIter
->
iSttBlk
,
pInfo
->
currentLoadBlockIndex
,
pBlock
->
nRow
,
pBlock
,
el
,
idStr
);
pInfo
->
blockIndex
[
pInfo
->
currentLoadBlockIndex
]
=
pIter
->
iSttBlk
;
tsdbDebug
(
"last block index list:%d, %d, %s"
,
pInfo
->
blockIndex
[
0
],
pInfo
->
blockIndex
[
1
],
idStr
);
...
...
@@ -552,9 +552,9 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFRead
}
pMTree
->
idStr
=
idStr
;
if
(
!
pMTree
->
backward
)
{
// asc
if
(
!
pMTree
->
backward
)
{
// asc
tRBTreeCreate
(
&
pMTree
->
rbt
,
tLDataIterCmprFn
);
}
else
{
// desc
}
else
{
// desc
tRBTreeCreate
(
&
pMTree
->
rbt
,
tLDataIterDescCmprFn
);
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
73f8dc6a
...
...
@@ -3883,7 +3883,7 @@ void tsdbReaderClose(STsdbReader* pReader) {
}
taosMemoryFree
(
pSupInfo
->
buildBuf
);
tBlockDataDestroy
(
&
pReader
->
status
.
fileBlockData
,
true
);
tBlockDataDestroy
(
&
pReader
->
status
.
fileBlockData
);
cleanupDataBlockIterator
(
&
pReader
->
status
.
blockIter
);
...
...
@@ -4171,7 +4171,7 @@ static SArray* doRetrieveDataBlock(STsdbReader* pReader) {
int32_t
code
=
doLoadFileBlockData
(
pReader
,
&
pStatus
->
blockIter
,
&
pStatus
->
fileBlockData
,
pBlockScanInfo
->
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tBlockDataDestroy
(
&
pStatus
->
fileBlockData
,
1
);
tBlockDataDestroy
(
&
pStatus
->
fileBlockData
);
terrno
=
code
;
return
NULL
;
}
...
...
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
浏览文件 @
73f8dc6a
...
...
@@ -524,7 +524,7 @@ _exit:
if
(
pReader
)
{
taosArrayDestroy
(
pReader
->
aDelData
);
taosArrayDestroy
(
pReader
->
aDelIdx
);
tBlockDataDestroy
(
&
pReader
->
bData
,
1
);
tBlockDataDestroy
(
&
pReader
->
bData
);
tsdbFSDestroy
(
&
pReader
->
fs
);
taosMemoryFree
(
pReader
);
}
...
...
@@ -551,10 +551,10 @@ int32_t tsdbSnapReaderClose(STsdbSnapReader** ppReader) {
taosArrayDestroy
(
pIter
->
aSttBlk
);
}
tBlockDataDestroy
(
&
pIter
->
bData
,
1
);
tBlockDataDestroy
(
&
pIter
->
bData
);
}
tBlockDataDestroy
(
&
pReader
->
bData
,
1
);
tBlockDataDestroy
(
&
pReader
->
bData
);
tDestroyTSchema
(
pReader
->
skmTable
.
pTSchema
);
// del
...
...
@@ -1345,13 +1345,13 @@ _exit:
if
(
pWriter
->
aDelIdxW
)
taosArrayDestroy
(
pWriter
->
aDelIdxW
);
if
(
pWriter
->
aDelData
)
taosArrayDestroy
(
pWriter
->
aDelData
);
if
(
pWriter
->
aDelIdxR
)
taosArrayDestroy
(
pWriter
->
aDelIdxR
);
tBlockDataDestroy
(
&
pWriter
->
dWriter
.
sData
,
1
);
tBlockDataDestroy
(
&
pWriter
->
dWriter
.
bData
,
1
);
tBlockDataDestroy
(
&
pWriter
->
dWriter
.
sData
);
tBlockDataDestroy
(
&
pWriter
->
dWriter
.
bData
);
if
(
pWriter
->
dWriter
.
aSttBlk
)
taosArrayDestroy
(
pWriter
->
dWriter
.
aSttBlk
);
if
(
pWriter
->
dWriter
.
aBlockIdx
)
taosArrayDestroy
(
pWriter
->
dWriter
.
aBlockIdx
);
tBlockDataDestroy
(
&
pWriter
->
dReader
.
bData
,
1
);
tBlockDataDestroy
(
&
pWriter
->
dReader
.
bData
);
if
(
pWriter
->
dReader
.
aBlockIdx
)
taosArrayDestroy
(
pWriter
->
dReader
.
aBlockIdx
);
tBlockDataDestroy
(
&
pWriter
->
bData
,
1
);
tBlockDataDestroy
(
&
pWriter
->
bData
);
tsdbFSDestroy
(
&
pWriter
->
fs
);
taosMemoryFree
(
pWriter
);
}
...
...
@@ -1404,18 +1404,18 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) {
// SNAP_DATA_TSDB
// Writer
tBlockDataDestroy
(
&
pWriter
->
dWriter
.
sData
,
1
);
tBlockDataDestroy
(
&
pWriter
->
dWriter
.
bData
,
1
);
tBlockDataDestroy
(
&
pWriter
->
dWriter
.
sData
);
tBlockDataDestroy
(
&
pWriter
->
dWriter
.
bData
);
taosArrayDestroy
(
pWriter
->
dWriter
.
aSttBlk
);
tMapDataClear
(
&
pWriter
->
dWriter
.
mDataBlk
);
taosArrayDestroy
(
pWriter
->
dWriter
.
aBlockIdx
);
// Reader
tBlockDataDestroy
(
&
pWriter
->
dReader
.
bData
,
1
);
tBlockDataDestroy
(
&
pWriter
->
dReader
.
bData
);
tMapDataClear
(
&
pWriter
->
dReader
.
mDataBlk
);
taosArrayDestroy
(
pWriter
->
dReader
.
aBlockIdx
);
tBlockDataDestroy
(
&
pWriter
->
bData
,
1
);
tBlockDataDestroy
(
&
pWriter
->
bData
);
tDestroyTSchema
(
pWriter
->
skmTable
.
pTSchema
);
for
(
int32_t
iBuf
=
0
;
iBuf
<
sizeof
(
pWriter
->
aBuf
)
/
sizeof
(
uint8_t
*
);
iBuf
++
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
73f8dc6a
...
...
@@ -938,11 +938,11 @@ _exit:
return
code
;
}
void
tBlockDataDestroy
(
SBlockData
*
pBlockData
,
int8_t
deepClear
)
{
void
tBlockDataDestroy
(
SBlockData
*
pBlockData
)
{
tFree
((
uint8_t
*
)
pBlockData
->
aUid
);
tFree
((
uint8_t
*
)
pBlockData
->
aVersion
);
tFree
((
uint8_t
*
)
pBlockData
->
aTSKEY
);
taosArrayDestroyEx
(
pBlockData
->
aColData
,
deepClear
?
tColDataDestroy
:
NULL
);
taosArrayDestroyEx
(
pBlockData
->
aColData
,
tColDataDestroy
);
pBlockData
->
aUid
=
NULL
;
pBlockData
->
aVersion
=
NULL
;
pBlockData
->
aTSKEY
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录