Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
48222f5d
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
48222f5d
编写于
7月 20, 2023
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tsdb/cache: move data file reader for fs iter to cache reader
上级
94d8286f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
30 deletion
+39
-30
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+25
-22
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+8
-8
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+6
-0
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
48222f5d
...
...
@@ -712,7 +712,7 @@ typedef struct SSttBlockLoadInfo {
SBlockData
blockData
[
2
];
void
*
pSttStatisBlkArray
;
SArray
*
aSttBlk
;
int32_t
blockIndex
[
2
];
// to denote the loaded block in the corresponding position.
int32_t
blockIndex
[
2
];
// to denote the loaded block in the corresponding position.
int32_t
currentLoadBlockIndex
;
int32_t
loadBlocks
;
double
elapsedTime
;
...
...
@@ -855,28 +855,31 @@ typedef struct {
SArray
*
pTombData
;
}
STableLoadInfo
;
struct
SDataFileReader
;
typedef
struct
SCacheRowsReader
{
STsdb
*
pTsdb
;
STsdbReaderInfo
info
;
TdThreadMutex
readerMutex
;
SVnode
*
pVnode
;
STSchema
*
pSchema
;
STSchema
*
pCurrSchema
;
uint64_t
uid
;
char
**
transferBuf
;
// todo remove it soon
int32_t
numOfCols
;
SArray
*
pCidList
;
int32_t
*
pSlotIds
;
int32_t
type
;
int32_t
tableIndex
;
// currently returned result tables
STableKeyInfo
*
pTableList
;
// table id list
int32_t
numOfTables
;
uint64_t
*
uidList
;
SSHashObj
*
pTableMap
;
SArray
*
pLDataIterArray
;
STsdbReadSnap
*
pReadSnap
;
char
*
idstr
;
int64_t
lastTs
;
STsdb
*
pTsdb
;
STsdbReaderInfo
info
;
TdThreadMutex
readerMutex
;
SVnode
*
pVnode
;
STSchema
*
pSchema
;
STSchema
*
pCurrSchema
;
uint64_t
uid
;
char
**
transferBuf
;
// todo remove it soon
int32_t
numOfCols
;
SArray
*
pCidList
;
int32_t
*
pSlotIds
;
int32_t
type
;
int32_t
tableIndex
;
// currently returned result tables
STableKeyInfo
*
pTableList
;
// table id list
int32_t
numOfTables
;
uint64_t
*
uidList
;
SSHashObj
*
pTableMap
;
SArray
*
pLDataIterArray
;
struct
SDataFileReader
*
pFileReader
;
STsdbReadSnap
*
pReadSnap
;
char
*
idstr
;
int64_t
lastTs
;
}
SCacheRowsReader
;
typedef
struct
{
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
48222f5d
...
...
@@ -1900,7 +1900,6 @@ typedef struct SFSNextRowIter {
int32_t
iFileSet
;
STFileSet
*
pFileSet
;
TFileSetArray
*
aDFileSet
;
SDataFileReader
*
pFileReader
;
SArray
*
pIndexList
;
int32_t
iBrinIndex
;
SBrinBlock
brinBlock
;
...
...
@@ -1970,7 +1969,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
filesName
[
3
]
=
pFileObj
[
3
]
->
fname
;
}
code
=
tsdbDataFileReaderOpen
(
filesName
,
&
conf
,
&
state
->
pFileReader
);
code
=
tsdbDataFileReaderOpen
(
filesName
,
&
conf
,
&
state
->
p
r
->
p
FileReader
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_err
;
}
...
...
@@ -1983,7 +1982,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
state
->
pLastIter
=
&
state
->
lastIter
;
loadDataTomb
(
state
->
pr
,
state
->
pFileReader
);
loadDataTomb
(
state
->
pr
,
state
->
p
r
->
p
FileReader
);
if
(
!
state
->
pIndexList
)
{
state
->
pIndexList
=
taosArrayInit
(
1
,
sizeof
(
SBrinBlk
));
...
...
@@ -1992,7 +1991,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
}
const
TBrinBlkArray
*
pBlkArray
=
NULL
;
int32_t
code
=
tsdbDataFileReadBrinBlk
(
state
->
pFileReader
,
&
pBlkArray
);
int32_t
code
=
tsdbDataFileReadBrinBlk
(
state
->
p
r
->
p
FileReader
,
&
pBlkArray
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_err
;
}
...
...
@@ -2034,7 +2033,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
pBrinBlk
=
taosArrayGet
(
state
->
pIndexList
,
state
->
iBrinIndex
);
}
code
=
tsdbDataFileReadBrinBlock
(
state
->
pFileReader
,
pBrinBlk
,
&
state
->
brinBlock
);
code
=
tsdbDataFileReadBrinBlock
(
state
->
p
r
->
p
FileReader
,
pBrinBlk
,
&
state
->
brinBlock
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_err
;
}
...
...
@@ -2079,7 +2078,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
--
nCols
;
++
aCols
;
}
code
=
tsdbDataFileReadBlockDataByColumn
(
state
->
pFileReader
,
pRecord
,
state
->
pBlockData
,
state
->
pTSchema
,
aCols
,
code
=
tsdbDataFileReadBlockDataByColumn
(
state
->
p
r
->
p
FileReader
,
pRecord
,
state
->
pBlockData
,
state
->
pTSchema
,
aCols
,
nCols
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_err
;
...
...
@@ -2315,8 +2314,9 @@ static void clearLastFileSet(SFSNextRowIter *state) {
state
->
pBlockData
=
NULL
;
}
if
(
state
->
pFileReader
)
{
tsdbDataFileReaderClose
(
&
state
->
pFileReader
);
if
(
state
->
pr
->
pFileReader
)
{
tsdbDataFileReaderClose
(
&
state
->
pr
->
pFileReader
);
state
->
pr
->
pFileReader
=
NULL
;
}
if
(
state
->
pTSRow
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
48222f5d
...
...
@@ -17,6 +17,7 @@
#include "tarray.h"
#include "tcommon.h"
#include "tsdb.h"
#include "tsdbDataFileRW.h"
#define HASTYPE(_type, _t) (((_type) & (_t)) == (_t))
...
...
@@ -253,6 +254,11 @@ void* tsdbCacherowsReaderClose(void* pReader) {
double
elapse
=
0
;
destroySttBlockReader
(
p
->
pLDataIterArray
,
&
loadBlocks
,
&
elapse
);
if
(
p
->
pFileReader
)
{
tsdbDataFileReaderClose
(
&
p
->
pFileReader
);
p
->
pFileReader
=
NULL
;
}
taosMemoryFree
((
void
*
)
p
->
idstr
);
taosThreadMutexDestroy
(
&
p
->
readerMutex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录