Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
52d8f7bd
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
52d8f7bd
编写于
10月 27, 2022
作者:
L
Liu Jicong
提交者:
GitHub
10月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17701 from taosdata/feature/stream
fix(query): set block capacity
上级
e550cf70
6cd8361a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
80 addition
and
7 deletion
+80
-7
include/libs/executor/executor.h
include/libs/executor/executor.h
+10
-0
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+7
-7
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+61
-0
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+2
-0
未找到文件。
include/libs/executor/executor.h
浏览文件 @
52d8f7bd
...
...
@@ -89,6 +89,16 @@ qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* readers, int32_t* n
*/
int32_t
qSetMultiStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
);
/**
* Set block for sma
* @param tinfo
* @param pBlocks
* @param numOfInputBlock
* @param type
* @return
*/
int32_t
qSetSMAInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
);
/**
* Update the table id list, add or remove.
*
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
52d8f7bd
...
...
@@ -15,11 +15,11 @@
#include "sma.h"
#define RSMA_QTASKEXEC_SMOOTH_SIZE (100)
// cnt
#define RSMA_SUBMIT_BATCH_SIZE (1024)
// cnt
#define RSMA_FETCH_DELAY_MAX (120000)
// ms
#define RSMA_FETCH_ACTIVE_MAX (1000)
// ms
#define RSMA_FETCH_INTERVAL (5000)
// ms
#define RSMA_QTASKEXEC_SMOOTH_SIZE (100) // cnt
#define RSMA_SUBMIT_BATCH_SIZE (1024) // cnt
#define RSMA_FETCH_DELAY_MAX (120000) // ms
#define RSMA_FETCH_ACTIVE_MAX (1000) // ms
#define RSMA_FETCH_INTERVAL (5000) // ms
SSmaMgmt
smaMgmt
=
{
.
inited
=
0
,
...
...
@@ -839,7 +839,7 @@ static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t msgSize,
tdRsmaPrintSubmitReq(pSma, pReq);
}
#endif
if
(
qSet
MultiStream
Input
(
qTaskInfo
,
pMsg
,
msgSize
,
inputType
)
<
0
)
{
if
(
qSet
SMA
Input
(
qTaskInfo
,
pMsg
,
msgSize
,
inputType
)
<
0
)
{
smaError
(
"vgId:%d, rsma %"
PRIi8
" qSetStreamInput failed since %s"
,
SMA_VID
(
pSma
),
level
,
tstrerror
(
terrno
));
return
TSDB_CODE_FAILED
;
}
...
...
@@ -1404,7 +1404,7 @@ static int32_t tdRSmaFetchAllResult(SSma *pSma, SRSmaInfo *pInfo) {
pItem
->
nScanned
=
0
;
if
((
terrno
=
qSet
MultiStream
Input
(
taskInfo
,
&
dataBlock
,
1
,
STREAM_INPUT__DATA_BLOCK
))
<
0
)
{
if
((
terrno
=
qSet
SMA
Input
(
taskInfo
,
&
dataBlock
,
1
,
STREAM_INPUT__DATA_BLOCK
))
<
0
)
{
goto
_err
;
}
if
(
tdRSmaExecAndSubmitResult
(
pSma
,
taskInfo
,
pItem
,
pInfo
->
pTSchema
,
pInfo
->
suid
)
<
0
)
{
...
...
source/libs/executor/src/executor.c
浏览文件 @
52d8f7bd
...
...
@@ -30,6 +30,46 @@ static void cleanupRefPool() {
taosCloseRef
(
ref
);
}
static
int32_t
doSetSMABlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
size_t
numOfBlocks
,
int32_t
type
,
char
*
id
)
{
ASSERT
(
pOperator
!=
NULL
);
if
(
pOperator
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
if
(
pOperator
->
numOfDownstream
==
0
)
{
qError
(
"failed to find stream scan operator to set the input data block, %s"
PRIx64
,
id
);
return
TSDB_CODE_QRY_APP_ERROR
;
}
if
(
pOperator
->
numOfDownstream
>
1
)
{
// not handle this in join query
qError
(
"join not supported for stream block scan, %s"
PRIx64
,
id
);
return
TSDB_CODE_QRY_APP_ERROR
;
}
pOperator
->
status
=
OP_NOT_OPENED
;
return
doSetSMABlock
(
pOperator
->
pDownstream
[
0
],
input
,
numOfBlocks
,
type
,
id
);
}
else
{
pOperator
->
status
=
OP_NOT_OPENED
;
SStreamScanInfo
*
pInfo
=
pOperator
->
info
;
if
(
type
==
STREAM_INPUT__MERGED_SUBMIT
)
{
for
(
int32_t
i
=
0
;
i
<
numOfBlocks
;
i
++
)
{
SSubmitReq
*
pReq
=
*
(
void
**
)
POINTER_SHIFT
(
input
,
i
*
sizeof
(
void
*
));
taosArrayPush
(
pInfo
->
pBlockLists
,
&
pReq
);
}
pInfo
->
blockType
=
STREAM_INPUT__DATA_SUBMIT
;
}
else
if
(
type
==
STREAM_INPUT__DATA_SUBMIT
)
{
taosArrayPush
(
pInfo
->
pBlockLists
,
&
input
);
pInfo
->
blockType
=
STREAM_INPUT__DATA_SUBMIT
;
}
else
if
(
type
==
STREAM_INPUT__DATA_BLOCK
)
{
for
(
int32_t
i
=
0
;
i
<
numOfBlocks
;
++
i
)
{
SSDataBlock
*
pDataBlock
=
&
((
SSDataBlock
*
)
input
)[
i
];
taosArrayPush
(
pInfo
->
pBlockLists
,
&
pDataBlock
);
}
pInfo
->
blockType
=
STREAM_INPUT__DATA_BLOCK
;
}
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
doSetStreamBlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
size_t
numOfBlocks
,
int32_t
type
,
char
*
id
)
{
ASSERT
(
pOperator
!=
NULL
);
if
(
pOperator
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
...
...
@@ -100,6 +140,27 @@ int32_t qSetMultiStreamInput(qTaskInfo_t tinfo, const void* pBlocks, size_t numO
return
code
;
}
int32_t
qSetSMAInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
)
{
if
(
tinfo
==
NULL
)
{
return
TSDB_CODE_QRY_APP_ERROR
;
}
if
(
pBlocks
==
NULL
||
numOfBlocks
==
0
)
{
return
TSDB_CODE_SUCCESS
;
}
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
int32_t
code
=
doSetSMABlock
(
pTaskInfo
->
pRoot
,
(
void
*
)
pBlocks
,
numOfBlocks
,
type
,
GET_TASKID
(
pTaskInfo
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"%s failed to set the sma block data"
,
GET_TASKID
(
pTaskInfo
));
}
else
{
qDebug
(
"%s set the sma block successfully"
,
GET_TASKID
(
pTaskInfo
));
}
return
code
;
}
qTaskInfo_t
qCreateQueueExecTaskInfo
(
void
*
msg
,
SReadHandle
*
readers
,
int32_t
*
numOfCols
,
SSchemaWrapper
**
pSchema
)
{
if
(
msg
==
NULL
)
{
// create raw scan
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
52d8f7bd
...
...
@@ -1738,8 +1738,10 @@ static int32_t filterDelBlockByUid(SSDataBlock* pDst, const SSDataBlock* pSrc, S
j
++
;
}
}
uint32_t
cap
=
pDst
->
info
.
capacity
;
pDst
->
info
=
pSrc
->
info
;
pDst
->
info
.
rows
=
j
;
pDst
->
info
.
capacity
=
cap
;
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录