Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9f9efe9a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9f9efe9a
编写于
7月 18, 2023
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tsdb/cache reader: remove dataf & dataf last readers
上级
998fbe57
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
44 deletion
+28
-44
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+0
-2
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+27
-37
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+1
-5
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
9f9efe9a
...
...
@@ -871,8 +871,6 @@ typedef struct SCacheRowsReader {
int32_t
numOfTables
;
SArray
*
pLDataIterArray
;
STsdbReadSnap
*
pReadSnap
;
SDataFReader
*
pDataFReader
;
SDataFReader
*
pDataFReaderLast
;
char
*
idstr
;
int64_t
lastTs
;
}
SCacheRowsReader
;
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
9f9efe9a
...
...
@@ -1691,37 +1691,27 @@ _err:
}
return
code
;
}
/*
static int32_t getTableDelIdx(SDelFReader *pDelFReader, tb_uid_t suid, tb_uid_t uid, SDelIdx *pDelIdx) {
int32_t code = 0;
SArray *pDelIdxArray = NULL;
// SMapData delIdxMap;
pDelIdxArray = taosArrayInit(32, sizeof(SDelIdx));
SDelIdx idx = {.suid = suid, .uid = uid};
// tMapDataReset(&delIdxMap);
code = tsdbReadDelIdx(pDelFReader, pDelIdxArray);
if (code) goto _err;
static
int32_t
loadTombFromBlk
(
const
TTombBlkArray
*
pTombBlkArray
,
SCacheRowsReader
*
pReader
,
void
*
pFileReader
,
bool
isFile
)
{
int32_t
code
=
0
;
// code = tMapDataSearch(&delIdxMap, &idx, tGetDelIdx, tCmprDelIdx, pDelIdx)
;
SDelIdx *pIdx = taosArraySearch(pDelIdxArray, &idx, tCmprDelIdx, TD_EQ);
return
TSDB_CODE_SUCCESS
;
}
*pDelIdx = *pIdx;
static
int32_t
loadDataTomb
(
SCacheRowsReader
*
pReader
,
SDataFileReader
*
pFileReader
)
{
int32_t
code
=
0
;
_err:
if (pDelIdxArray) {
taosArrayDestroy(pDelIdxArray);
const
TTombBlkArray
*
pBlkArray
=
NULL
;
code
=
tsdbDataFileReadTombBlk
(
pFileReader
,
&
pBlkArray
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
return code;
return
loadTombFromBlk
(
pBlkArray
,
pReader
,
pFileReader
,
true
);
}
*/
typedef
struct
{
SMergeTree
mergeTree
;
SMergeTree
*
pMergeTree
;
}
SFSLastIter
;
static
int32_t
loadSttTomb
Data
(
STsdbReader
*
pTsdbReader
,
SSttFileReader
*
pSttFileReader
,
SSttBlockLoadInfo
*
pLoadInfo
)
{
static
int32_t
loadSttTomb
(
STsdbReader
*
pTsdbReader
,
SSttFileReader
*
pSttFileReader
,
SSttBlockLoadInfo
*
pLoadInfo
)
{
int32_t
code
=
0
;
SCacheRowsReader
*
pReader
=
(
SCacheRowsReader
*
)
pTsdbReader
;
...
...
@@ -1736,12 +1726,14 @@ static int32_t loadSttTombData(STsdbReader *pTsdbReader, SSttFileReader *pSttFil
return
code
;
}
/*
return doLoadTombDataFromTombBlk(pBlkArray, pReader, pSttFileReader, false);
*/
return
code
;
return
loadTombFromBlk
(
pBlkArray
,
pReader
,
pSttFileReader
,
false
);
}
typedef
struct
{
SMergeTree
mergeTree
;
SMergeTree
*
pMergeTree
;
}
SFSLastIter
;
static
int32_t
lastIterOpen
(
SFSLastIter
*
iter
,
STFileSet
*
pFileSet
,
STsdb
*
pTsdb
,
STSchema
*
pTSchema
,
tb_uid_t
suid
,
tb_uid_t
uid
,
SCacheRowsReader
*
pr
,
int64_t
lastTs
,
int16_t
*
aCols
,
int
nCols
)
{
int32_t
code
=
0
;
...
...
@@ -1764,7 +1756,7 @@ static int32_t lastIterOpen(SFSLastIter *iter, STFileSet *pFileSet, STsdb *pTsdb
.
pSttFileBlockIterArray
=
pr
->
pLDataIterArray
,
.
pCols
=
aCols
,
.
numOfCols
=
nCols
,
.
loadTombFn
=
loadSttTomb
Data
,
.
loadTombFn
=
loadSttTomb
,
.
pReader
=
pr
,
.
idstr
=
pr
->
idstr
,
};
...
...
@@ -2545,8 +2537,8 @@ typedef struct CacheNextRowIter {
}
CacheNextRowIter
;
static
int32_t
nextRowIterOpen
(
CacheNextRowIter
*
pIter
,
tb_uid_t
uid
,
STsdb
*
pTsdb
,
STSchema
*
pTSchema
,
tb_uid_t
suid
,
SArray
*
pLDataIterArray
,
STsdbReadSnap
*
pReadSnap
,
SDataFReader
**
pDataFReader
,
S
DataFReader
**
pDataFReaderLast
,
int64_t
lastTs
,
S
CacheRowsReader
*
pr
)
{
SArray
*
pLDataIterArray
,
STsdbReadSnap
*
pReadSnap
,
int64_t
lastTs
,
SCacheRowsReader
*
pr
)
{
int
code
=
0
;
STbData
*
pMem
=
NULL
;
...
...
@@ -2630,7 +2622,7 @@ static int32_t nextRowIterOpen(CacheNextRowIter *pIter, tb_uid_t uid, STsdb *pTs
pIter->input[2] = (TsdbNextRowState){
&pIter->fsLastRow, false, true, false, &pIter->fsLastState, getNextRowFromFSLast, clearNextRowFromFSLast};
*/
pIter
->
input
[
3
]
=
pIter
->
input
[
2
]
=
(
TsdbNextRowState
){
&
pIter
->
fsRow
,
false
,
true
,
false
,
&
pIter
->
fsState
,
getNextRowFromFS
,
clearNextRowFromFS
};
if
(
pMem
)
{
...
...
@@ -2680,7 +2672,7 @@ static int32_t nextRowIterGet(CacheNextRowIter *pIter, TSDBROW **ppRow, bool *pI
int16_t
*
aCols
,
int
nCols
)
{
int
code
=
0
;
for
(;;)
{
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
if
(
pIter
->
input
[
i
].
next
&&
!
pIter
->
input
[
i
].
stop
)
{
code
=
pIter
->
input
[
i
].
nextRowFn
(
pIter
->
input
[
i
].
iter
,
&
pIter
->
input
[
i
].
pRow
,
&
pIter
->
input
[
i
].
ignoreEarlierTs
,
isLast
,
aCols
,
nCols
);
...
...
@@ -2835,8 +2827,7 @@ static int32_t mergeLastCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SC
TSKEY
lastRowTs
=
TSKEY_MAX
;
CacheNextRowIter
iter
=
{
0
};
nextRowIterOpen
(
&
iter
,
uid
,
pTsdb
,
pTSchema
,
pr
->
info
.
suid
,
pr
->
pLDataIterArray
,
pr
->
pReadSnap
,
&
pr
->
pDataFReader
,
&
pr
->
pDataFReaderLast
,
pr
->
lastTs
,
pr
);
nextRowIterOpen
(
&
iter
,
uid
,
pTsdb
,
pTSchema
,
pr
->
info
.
suid
,
pr
->
pLDataIterArray
,
pr
->
pReadSnap
,
pr
->
lastTs
,
pr
);
do
{
TSDBROW
*
pRow
=
NULL
;
...
...
@@ -3005,8 +2996,7 @@ static int32_t mergeLastRowCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray,
TSKEY
lastRowTs
=
TSKEY_MAX
;
CacheNextRowIter
iter
=
{
0
};
nextRowIterOpen
(
&
iter
,
uid
,
pTsdb
,
pTSchema
,
pr
->
info
.
suid
,
pr
->
pLDataIterArray
,
pr
->
pReadSnap
,
&
pr
->
pDataFReader
,
&
pr
->
pDataFReaderLast
,
pr
->
lastTs
,
pr
);
nextRowIterOpen
(
&
iter
,
uid
,
pTsdb
,
pTSchema
,
pr
->
info
.
suid
,
pr
->
pLDataIterArray
,
pr
->
pReadSnap
,
pr
->
lastTs
,
pr
);
do
{
TSDBROW
*
pRow
=
NULL
;
...
...
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
9f9efe9a
...
...
@@ -300,8 +300,6 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_end
;
}
pr
->
pDataFReader
=
NULL
;
pr
->
pDataFReaderLast
=
NULL
;
int8_t
ltype
=
(
pr
->
type
&
CACHESCAN_RETRIEVE_LAST
)
>>
3
;
...
...
@@ -422,15 +420,13 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
}
_end:
tsdbDataFReaderClose
(
&
pr
->
pDataFReaderLast
);
tsdbDataFReaderClose
(
&
pr
->
pDataFReader
);
tsdbUntakeReadSnap2
((
STsdbReader
*
)
pr
,
pr
->
pReadSnap
,
true
);
int64_t
loadBlocks
=
0
;
double
elapse
=
0
;
pr
->
pLDataIterArray
=
destroySttBlockReader
(
pr
->
pLDataIterArray
,
&
loadBlocks
,
&
elapse
);
pr
->
pLDataIterArray
=
taosArrayInit
(
4
,
POINTER_BYTES
);
tsdbUntakeReadSnap2
((
STsdbReader
*
)
pr
,
pr
->
pReadSnap
,
true
);
taosThreadMutexUnlock
(
&
pr
->
readerMutex
);
if
(
pRes
!=
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录