Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cfd08b16
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
cfd08b16
编写于
3月 16, 2022
作者:
L
Liu Jicong
提交者:
GitHub
3月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10781 from taosdata/feature/tq
task deploy and task exec
上级
d3564f3d
7f4c88b7
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
61 addition
and
11 deletion
+61
-11
include/common/tmsg.h
include/common/tmsg.h
+4
-0
include/common/tmsgdef.h
include/common/tmsgdef.h
+1
-0
include/util/tencode.h
include/util/tencode.h
+24
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+4
-4
source/dnode/mnode/impl/src/mndDef.c
source/dnode/mnode/impl/src/mndDef.c
+3
-3
source/dnode/snode/inc/sndInt.h
source/dnode/snode/inc/sndInt.h
+3
-2
source/dnode/snode/src/snode.c
source/dnode/snode/src/snode.c
+22
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
cfd08b16
...
...
@@ -2291,6 +2291,10 @@ typedef struct {
// TODO: other info needed by task
}
SStreamTaskExecReq
;
typedef
struct
{
int32_t
reserved
;
}
SStreamTaskExecRsp
;
#pragma pack(pop)
#ifdef __cplusplus
...
...
include/common/tmsgdef.h
浏览文件 @
cfd08b16
...
...
@@ -200,6 +200,7 @@ enum {
// Requests handled by SNODE
TD_NEW_MSG_SEG
(
TDMT_SND_MSG
)
TD_DEF_MSG_TYPE
(
TDMT_SND_TASK_DEPLOY
,
"snode-task-deploy"
,
SStreamTaskDeployReq
,
SStreamTaskDeployRsp
)
TD_DEF_MSG_TYPE
(
TDMT_SND_TASK_EXEC
,
"snode-task-exec"
,
SStreamTaskExecReq
,
SStreamTaskExecRsp
)
#if defined(TD_MSG_NUMBER_)
TDMT_MAX
...
...
include/util/tencode.h
浏览文件 @
cfd08b16
...
...
@@ -402,6 +402,29 @@ static int32_t tDecodeCStrTo(SCoder* pDecoder, char* val) {
return
0
;
}
static
FORCE_INLINE
int32_t
tDecodeBinaryAlloc
(
SCoder
*
pDecoder
,
void
**
val
,
uint64_t
*
len
)
{
if
(
tDecodeU64v
(
pDecoder
,
len
)
<
0
)
return
-
1
;
if
(
TD_CODER_CHECK_CAPACITY_FAILED
(
pDecoder
,
*
len
))
return
-
1
;
*
val
=
malloc
(
*
len
);
if
(
*
val
==
NULL
)
return
-
1
;
memcpy
(
*
val
,
TD_CODER_CURRENT
(
pDecoder
),
*
len
);
TD_CODER_MOVE_POS
(
pDecoder
,
*
len
);
return
0
;
}
static
FORCE_INLINE
int32_t
tDecodeCStrAndLenAlloc
(
SCoder
*
pDecoder
,
char
**
val
,
uint64_t
*
len
)
{
if
(
tDecodeBinaryAlloc
(
pDecoder
,
(
void
**
)
val
,
len
)
<
0
)
return
-
1
;
(
*
len
)
-=
1
;
return
0
;
}
static
FORCE_INLINE
int32_t
tDecodeCStrAlloc
(
SCoder
*
pDecoder
,
char
**
val
)
{
uint64_t
len
;
return
tDecodeCStrAndLenAlloc
(
pDecoder
,
val
,
&
len
);
}
static
FORCE_INLINE
bool
tDecodeIsEnd
(
SCoder
*
pCoder
)
{
return
(
pCoder
->
size
==
pCoder
->
pos
);
}
#ifdef __cplusplus
...
...
source/common/src/tmsg.c
浏览文件 @
cfd08b16
...
...
@@ -2674,9 +2674,9 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
name
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
igExists
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
(
&
decoder
,
(
const
char
**
)
&
pReq
->
sql
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
(
&
decoder
,
(
const
char
**
)
&
pReq
->
physicalPlan
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
(
&
decoder
,
(
const
char
**
)
&
pReq
->
logicalPlan
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
Alloc
(
&
decoder
,
&
pReq
->
sql
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
Alloc
(
&
decoder
,
&
pReq
->
physicalPlan
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
Alloc
(
&
decoder
,
&
pReq
->
logicalPlan
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
...
...
@@ -2706,7 +2706,7 @@ int32_t tDecodeSStreamTask(SCoder *pDecoder, SStreamTask *pTask) {
if
(
tDecodeI32
(
pDecoder
,
&
pTask
->
taskId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pTask
->
level
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pTask
->
status
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
(
pDecoder
,
(
const
char
**
)
&
pTask
->
qmsg
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
Alloc
(
pDecoder
,
&
pTask
->
qmsg
)
<
0
)
return
-
1
;
tEndDecode
(
pDecoder
);
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndDef.c
浏览文件 @
cfd08b16
...
...
@@ -39,8 +39,8 @@ int32_t tDecodeSStreamObj(SCoder *pDecoder, SStreamObj *pObj) {
if
(
tDecodeI64
(
pDecoder
,
&
pObj
->
dbUid
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pObj
->
version
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pObj
->
status
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
(
pDecoder
,
(
const
char
**
)
&
pObj
->
sql
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
(
pDecoder
,
(
const
char
**
)
&
pObj
->
logicalPlan
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
(
pDecoder
,
(
const
char
**
)
&
pObj
->
physicalPlan
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
Alloc
(
pDecoder
,
&
pObj
->
sql
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
Alloc
(
pDecoder
,
&
pObj
->
logicalPlan
)
<
0
)
return
-
1
;
if
(
tDecodeCStr
Alloc
(
pDecoder
,
&
pObj
->
physicalPlan
)
<
0
)
return
-
1
;
return
0
;
}
source/dnode/snode/inc/sndInt.h
浏览文件 @
cfd08b16
...
...
@@ -51,6 +51,7 @@ SStreamMeta* sndMetaNew();
void
sndMetaDelete
(
SStreamMeta
*
pMeta
);
int32_t
sndMetaDeployTask
(
SStreamMeta
*
pMeta
,
SStreamTask
*
pTask
);
SStreamTask
*
sndMetaGetTask
(
SStreamMeta
*
pMeta
,
int32_t
taskId
);
int32_t
sndMetaRemoveTask
(
SStreamMeta
*
pMeta
,
int32_t
taskId
);
int32_t
sndDropTaskOfStream
(
SStreamMeta
*
pMeta
,
int64_t
streamId
);
...
...
source/dnode/snode/src/snode.c
浏览文件 @
cfd08b16
...
...
@@ -68,6 +68,10 @@ int32_t sndMetaDeployTask(SStreamMeta *pMeta, SStreamTask *pTask) {
return
taosHashPut
(
pMeta
->
pHash
,
&
pTask
->
taskId
,
sizeof
(
int32_t
),
pTask
,
sizeof
(
void
*
));
}
SStreamTask
*
sndMetaGetTask
(
SStreamMeta
*
pMeta
,
int32_t
taskId
)
{
return
taosHashGet
(
pMeta
->
pHash
,
&
taskId
,
sizeof
(
int32_t
));
}
int32_t
sndMetaRemoveTask
(
SStreamMeta
*
pMeta
,
int32_t
taskId
)
{
SStreamTask
*
pTask
=
taosHashGet
(
pMeta
->
pHash
,
&
taskId
,
sizeof
(
int32_t
));
if
(
pTask
==
NULL
)
{
...
...
@@ -79,6 +83,16 @@ int32_t sndMetaRemoveTask(SStreamMeta *pMeta, int32_t taskId) {
return
taosHashRemove
(
pMeta
->
pHash
,
&
taskId
,
sizeof
(
int32_t
));
}
static
int32_t
sndProcessTaskExecReq
(
SSnode
*
pSnode
,
SRpcMsg
*
pMsg
)
{
SMsgHead
*
pHead
=
pMsg
->
pCont
;
int32_t
taskId
=
pHead
->
streamTaskId
;
SStreamTask
*
pTask
=
sndMetaGetTask
(
pSnode
->
pMeta
,
taskId
);
if
(
pTask
==
NULL
)
{
return
-
1
;
}
return
0
;
}
int32_t
sndProcessUMsg
(
SSnode
*
pSnode
,
SRpcMsg
*
pMsg
)
{
// stream deploy
// stream stop/resume
...
...
@@ -95,13 +109,20 @@ int32_t sndProcessUMsg(SSnode *pSnode, SRpcMsg *pMsg) {
tCoderClear
(
&
decoder
);
sndMetaDeployTask
(
pSnode
->
pMeta
,
pTask
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SND_TASK_EXEC
)
{
sndProcessTaskExecReq
(
pSnode
,
pMsg
);
}
else
{
//
ASSERT
(
0
);
}
return
0
;
}
int32_t
sndProcessSMsg
(
SSnode
*
pSnode
,
SRpcMsg
*
pMsg
)
{
// operator exec
if
(
pMsg
->
msgType
==
TDMT_SND_TASK_EXEC
)
{
sndProcessTaskExecReq
(
pSnode
,
pMsg
);
}
else
{
ASSERT
(
0
);
}
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录