Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ab52d28c
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看板
提交
ab52d28c
编写于
11月 11, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
6ae82b07
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
32 addition
and
21 deletion
+32
-21
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+4
-3
source/libs/executor/src/cachescanoperator.c
source/libs/executor/src/cachescanoperator.c
+1
-2
source/libs/executor/src/exchangeoperator.c
source/libs/executor/src/exchangeoperator.c
+27
-16
未找到文件。
source/libs/executor/inc/executorimpl.h
浏览文件 @
ab52d28c
...
...
@@ -254,17 +254,18 @@ typedef struct SExchangeInfo {
SArray
*
pSourceDataInfo
;
tsem_t
ready
;
void
*
pTransporter
;
// SArray<SSDataBlock*>, result block list, used to keep the multi-block that
// passed by downstream operator
SArray
*
pRe
sultBlockList
;
int32_t
rspBlockIndex
;
// indicate the return block index in pResultBlockList
SArray
*
pRe
adyBlocks
;
SArray
*
pRecycledBlocks
;
// build a pool for small data block to avoid to repeatly create and then destroy.
SSDataBlock
*
pDummyBlock
;
// dummy block, not keep data
bool
seqLoadData
;
// sequential load data or not, false by default
int32_t
current
;
SLoadRemoteDataInfo
loadInfo
;
uint64_t
self
;
SLimitInfo
limitInfo
;
int64_t
openedTs
;
// start exec time stamp
int64_t
openedTs
;
// start exec time stamp, todo: move to SLoadRemoteDataInfo
}
SExchangeInfo
;
typedef
struct
SScanInfo
{
...
...
source/libs/executor/src/cachescanoperator.c
浏览文件 @
ab52d28c
...
...
@@ -74,9 +74,8 @@ SOperatorInfo* createCacherowsScanOperator(SLastRowScanPhysiNode* pScanNode, SRe
STableKeyInfo
*
pList
=
tableListGetInfo
(
pTableList
,
0
);
size_t
num
=
tableListGetSize
(
pTableList
);
uint64_t
suid
=
tableListGetSuid
(
pTableList
);
code
=
tsdbCacherowsReaderOpen
(
pInfo
->
readHandle
.
vnode
,
pInfo
->
retrieveType
,
pList
,
num
,
code
=
tsdbCacherowsReaderOpen
(
pInfo
->
readHandle
.
vnode
,
pInfo
->
retrieveType
,
pList
,
totalTables
,
taosArrayGetSize
(
pInfo
->
matchInfo
.
pList
),
suid
,
&
pInfo
->
pLastrowReader
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
...
...
source/libs/executor/src/exchangeoperator.c
浏览文件 @
ab52d28c
...
...
@@ -100,14 +100,23 @@ static void concurrentlyLoadRemoteDataImpl(SOperatorInfo* pOperator, SExchangeIn
int32_t
index
=
0
;
char
*
pStart
=
pRetrieveRsp
->
data
;
while
(
index
++
<
pRetrieveRsp
->
numOfBlocks
)
{
SSDataBlock
*
pb
=
createOneDataBlock
(
pExchangeInfo
->
pDummyBlock
,
false
);
SSDataBlock
*
pb
=
NULL
;
void
*
p
=
taosArrayPop
(
pExchangeInfo
->
pRecycledBlocks
);
if
(
p
!=
NULL
)
{
pb
=
*
(
SSDataBlock
**
)
p
;
blockDataCleanup
(
pb
);
}
else
{
pb
=
createOneDataBlock
(
pExchangeInfo
->
pDummyBlock
,
false
);
}
code
=
extractDataBlockFromFetchRsp
(
pb
,
pStart
,
NULL
,
&
pStart
);
if
(
code
!=
0
)
{
taosMemoryFreeClear
(
pDataInfo
->
pRsp
);
goto
_error
;
}
taosArrayPush
(
pExchangeInfo
->
pRe
sultBlockList
,
&
pb
);
taosArrayPush
(
pExchangeInfo
->
pRe
adyBlocks
,
&
pb
);
}
updateLoadRemoteInfo
(
pLoadInfo
,
pRetrieveRsp
->
numOfRows
,
pRetrieveRsp
->
compLen
,
pExchangeInfo
->
openedTs
,
pOperator
);
...
...
@@ -170,23 +179,26 @@ static SSDataBlock* doLoadRemoteDataImpl(SOperatorInfo* pOperator) {
return
NULL
;
}
size_t
size
=
taosArrayGetSize
(
pExchangeInfo
->
pResultBlockList
);
if
(
size
==
0
||
pExchangeInfo
->
rspBlockIndex
>=
size
)
{
pExchangeInfo
->
rspBlockIndex
=
0
;
taosArrayClearEx
(
pExchangeInfo
->
pResultBlockList
,
freeBlock
);
// we have buffered retrieved datablock, return it directly
SSDataBlock
**
p
=
taosArrayPop
(
pExchangeInfo
->
pReadyBlocks
);
if
(
p
!=
NULL
)
{
taosArrayPush
(
pExchangeInfo
->
pRecycledBlocks
,
p
);
return
*
p
;
}
else
{
if
(
pExchangeInfo
->
seqLoadData
)
{
seqLoadRemoteData
(
pOperator
);
}
else
{
concurrentlyLoadRemoteDataImpl
(
pOperator
,
pExchangeInfo
,
pTaskInfo
);
}
if
(
taosArrayGetSize
(
pExchangeInfo
->
pRe
sultBlockList
)
==
0
)
{
if
(
taosArrayGetSize
(
pExchangeInfo
->
pRe
adyBlocks
)
==
0
)
{
return
NULL
;
}
else
{
p
=
taosArrayPop
(
pExchangeInfo
->
pReadyBlocks
);
taosArrayPush
(
pExchangeInfo
->
pRecycledBlocks
,
p
);
return
*
p
;
}
}
// we have buffered retrieved datablock, return it directly
return
taosArrayGetP
(
pExchangeInfo
->
pResultBlockList
,
pExchangeInfo
->
rspBlockIndex
++
);
}
static
SSDataBlock
*
doLoadRemoteData
(
SOperatorInfo
*
pOperator
)
{
...
...
@@ -284,7 +296,8 @@ SOperatorInfo* createExchangeOperatorInfo(void* pTransporter, SExchangePhysiNode
tsem_init
(
&
pInfo
->
ready
,
0
,
0
);
pInfo
->
pDummyBlock
=
createResDataBlock
(
pExNode
->
node
.
pOutputDataBlockDesc
);
pInfo
->
pResultBlockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
pInfo
->
pReadyBlocks
=
taosArrayInit
(
64
,
POINTER_BYTES
);
pInfo
->
pRecycledBlocks
=
taosArrayInit
(
64
,
POINTER_BYTES
);
pInfo
->
seqLoadData
=
false
;
pInfo
->
pTransporter
=
pTransporter
;
...
...
@@ -326,10 +339,8 @@ void doDestroyExchangeOperatorInfo(void* param) {
taosArrayDestroy
(
pExInfo
->
pSources
);
taosArrayDestroyEx
(
pExInfo
->
pSourceDataInfo
,
freeSourceDataInfo
);
if
(
pExInfo
->
pResultBlockList
!=
NULL
)
{
taosArrayDestroyEx
(
pExInfo
->
pResultBlockList
,
freeBlock
);
pExInfo
->
pResultBlockList
=
NULL
;
}
taosArrayDestroyEx
(
pExInfo
->
pReadyBlocks
,
freeBlock
);
taosArrayDestroyEx
(
pExInfo
->
pRecycledBlocks
,
freeBlock
);
blockDataDestroy
(
pExInfo
->
pDummyBlock
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录