Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
92feb89a
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看板
提交
92feb89a
编写于
5月 17, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
ffee5ebc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
18 deletion
+14
-18
source/dnode/vnode/src/tq/tqRestore.c
source/dnode/vnode/src/tq/tqRestore.c
+0
-2
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+14
-16
未找到文件。
source/dnode/vnode/src/tq/tqRestore.c
浏览文件 @
92feb89a
...
...
@@ -137,8 +137,6 @@ int32_t createStreamRunReq(SStreamMeta* pStreamMeta, bool* pScanIdle) {
}
// append the data for the stream
// tqDebug("vgId:%d s-task:%s wal reader seek to ver:%" PRId64, vgId, pTask->id.idStr, pTask->chkInfo.currentVer);
SStreamQueueItem
*
pItem
=
NULL
;
int32_t
code
=
extractMsgFromWal
(
pTask
->
exec
.
pWalReader
,
(
void
**
)
&
pItem
,
pTask
->
id
.
idStr
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// failed, continue
...
...
source/libs/stream/src/stream.c
浏览文件 @
92feb89a
...
...
@@ -16,8 +16,10 @@
#include "streamInc.h"
#include "ttimer.h"
#define STREAM_TASK_INPUT_QUEUEU_CAPACITY 20480
#define STREAM_TASK_INPUT_QUEUEU_CAPACITY_IN_SIZE (100)
#define STREAM_TASK_INPUT_QUEUEU_CAPACITY 20480
#define STREAM_TASK_INPUT_QUEUEU_CAPACITY_IN_SIZE (50)
#define ONE_MB_F (1048576.0)
#define QUEUE_MEM_SIZE_IN_MB(_q) (taosQueueMemorySize(_q)/ONE_MB_F)
int32_t
streamInit
()
{
int8_t
old
;
...
...
@@ -281,27 +283,25 @@ int32_t streamProcessRetrieveReq(SStreamTask* pTask, SStreamRetrieveReq* pReq, S
}
bool
tInputQueueIsFull
(
const
SStreamTask
*
pTask
)
{
return
taosQueueItemSize
((
pTask
->
inputQueue
->
queue
))
>=
STREAM_TASK_INPUT_QUEUEU_CAPACITY
;
bool
isFull
=
taosQueueItemSize
((
pTask
->
inputQueue
->
queue
))
>=
STREAM_TASK_INPUT_QUEUEU_CAPACITY
;
double
size
=
QUEUE_MEM_SIZE_IN_MB
(
pTask
->
inputQueue
->
queue
);
return
(
isFull
||
size
>=
STREAM_TASK_INPUT_QUEUEU_CAPACITY_IN_SIZE
);
}
int32_t
tAppendDataToInputQueue
(
SStreamTask
*
pTask
,
SStreamQueueItem
*
pItem
)
{
int8_t
type
=
pItem
->
type
;
int8_t
type
=
pItem
->
type
;
int32_t
total
=
taosQueueItemSize
(
pTask
->
inputQueue
->
queue
)
+
1
;
double
size
=
QUEUE_MEM_SIZE_IN_MB
(
pTask
->
inputQueue
->
queue
);
if
(
type
==
STREAM_INPUT__DATA_SUBMIT
)
{
SStreamDataSubmit2
*
pSubmitBlock
=
(
SStreamDataSubmit2
*
)
pItem
;
int32_t
total
=
taosQueueItemSize
(
pTask
->
inputQueue
->
queue
)
+
1
;
qDebug
(
"s-task:%s submit enqueue %p %p msgLen:%d ver:%"
PRId64
", total in queue:%d"
,
pTask
->
id
.
idStr
,
pItem
,
pSubmitBlock
->
submit
.
msgStr
,
pSubmitBlock
->
submit
.
msgLen
,
pSubmitBlock
->
submit
.
ver
,
total
);
qDebug
(
"s-task:%s submit enqueue msgLen:%d ver:%"
PRId64
", total in queue:%d, size:%.2fMiB"
,
pTask
->
id
.
idStr
,
pSubmitBlock
->
submit
.
msgLen
,
pSubmitBlock
->
submit
.
ver
,
numOfBlocks
,
size
);
pSubmitBlock
->
submit
.
msgLen
,
pSubmitBlock
->
submit
.
ver
,
total
,
size
);
if
((
pTask
->
taskLevel
==
TASK_LEVEL__SOURCE
)
&&
(
numOfBlocks
>
STREAM_TASK_INPUT_QUEUEU_CAPACITY
||
(
size
>=
STREAM_TASK_INPUT_QUEUEU_CAPACITY_IN_SIZE
)))
{
if
((
pTask
->
taskLevel
==
TASK_LEVEL__SOURCE
)
&&
(
tInputQueueIsFull
(
pTask
)))
{
qError
(
"s-task:%s input queue is full, capacity(size:%d num:%dMiB), current(blocks:%d, size:%.2fMiB) abort"
,
pTask
->
id
.
idStr
,
STREAM_TASK_INPUT_QUEUEU_CAPACITY
,
STREAM_TASK_INPUT_QUEUEU_CAPACITY_IN_SIZE
,
numOfBlocks
,
size
);
total
,
size
);
streamDataSubmitDestroy
(
pSubmitBlock
);
return
-
1
;
}
...
...
@@ -310,10 +310,8 @@ int32_t tAppendDataToInputQueue(SStreamTask* pTask, SStreamQueueItem* pItem) {
}
else
if
(
type
==
STREAM_INPUT__DATA_BLOCK
||
type
==
STREAM_INPUT__DATA_RETRIEVE
||
type
==
STREAM_INPUT__REF_DATA_BLOCK
)
{
int32_t
numOfBlocks
=
taosQueueItemSize
(
pTask
->
inputQueue
->
queue
)
+
1
;
double
size
=
taosQueueMemorySize
(
pTask
->
inputQueue
->
queue
)
/
1048576
.
0
;
if
((
pTask
->
taskLevel
==
TASK_LEVEL__SOURCE
)
&&
(
numOfBlocks
>
STREAM_TASK_INPUT_QUEUEU_CAPACITY
||
(
size
>=
STREAM_TASK_INPUT_QUEUEU_CAPACITY_IN_SIZE
)))
{
if
((
pTask
->
taskLevel
==
TASK_LEVEL__SOURCE
)
&&
(
tInputQueueIsFull
(
pTask
)))
{
qError
(
"s-task:%s input queue is full, capacity:%d size:%d MiB, current(blocks:%d, size:%.2fMiB) abort"
,
pTask
->
id
.
idStr
,
STREAM_TASK_INPUT_QUEUEU_CAPACITY
,
STREAM_TASK_INPUT_QUEUEU_CAPACITY_IN_SIZE
,
numOfBlocks
,
size
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录