Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7e24be74
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
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,发现更多精彩内容 >>
提交
7e24be74
编写于
5月 19, 2022
作者:
W
wenzhouwww@live.cn
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of github.com:taosdata/TDengine into 3.0
上级
d5ec75c9
eb48e8d9
变更
27
显示空白变更内容
内联
并排
Showing
27 changed file
with
143 addition
and
152 deletion
+143
-152
include/common/tmsg.h
include/common/tmsg.h
+9
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+29
-0
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
+3
-3
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
+5
-9
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
+8
-8
source/dnode/mgmt/mgmt_mnode/src/mmFile.c
source/dnode/mgmt/mgmt_mnode/src/mmFile.c
+4
-4
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+9
-15
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
+4
-4
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+1
-1
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
+1
-1
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
+5
-9
source/dnode/mgmt/mgmt_snode/inc/smInt.h
source/dnode/mgmt/mgmt_snode/inc/smInt.h
+1
-1
source/dnode/mgmt/mgmt_snode/src/smHandle.c
source/dnode/mgmt/mgmt_snode/src/smHandle.c
+5
-9
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
+4
-4
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+8
-10
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+10
-8
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+3
-5
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+5
-0
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+0
-5
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+0
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+6
-44
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+2
-2
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+7
-5
source/libs/function/src/functionMgt.c
source/libs/function/src/functionMgt.c
+3
-0
source/libs/function/test/udf2.c
source/libs/function/test/udf2.c
+5
-1
tests/script/tsim/tstream/basic1.sim
tests/script/tsim/tstream/basic1.sim
+5
-1
tests/system-test/7-tmq/subscribeDb1.py
tests/system-test/7-tmq/subscribeDb1.py
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
7e24be74
...
@@ -1648,6 +1648,15 @@ typedef struct {
...
@@ -1648,6 +1648,15 @@ typedef struct {
int32_t
tSerializeSMDropTopicReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropTopicReq
*
pReq
);
int32_t
tSerializeSMDropTopicReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropTopicReq
*
pReq
);
int32_t
tDeserializeSMDropTopicReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropTopicReq
*
pReq
);
int32_t
tDeserializeSMDropTopicReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropTopicReq
*
pReq
);
typedef
struct
{
char
topic
[
TSDB_TOPIC_FNAME_LEN
];
char
cgroup
[
TSDB_CGROUP_LEN
];
int8_t
igNotExists
;
}
SMDropCgroupReq
;
int32_t
tSerializeSMDropCgroupReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropCgroupReq
*
pReq
);
int32_t
tDeserializeSMDropCgroupReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropCgroupReq
*
pReq
);
typedef
struct
{
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
name
[
TSDB_TABLE_FNAME_LEN
];
int8_t
alterType
;
int8_t
alterType
;
...
...
source/common/src/tmsg.c
浏览文件 @
7e24be74
...
@@ -2627,6 +2627,35 @@ int32_t tDeserializeSMDropTopicReq(void *buf, int32_t bufLen, SMDropTopicReq *pR
...
@@ -2627,6 +2627,35 @@ int32_t tDeserializeSMDropTopicReq(void *buf, int32_t bufLen, SMDropTopicReq *pR
return
0
;
return
0
;
}
}
int32_t
tSerializeSMDropCgroupReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropCgroupReq
*
pReq
)
{
SEncoder
encoder
=
{
0
};
tEncoderInit
(
&
encoder
,
buf
,
bufLen
);
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
topic
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
cgroup
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
igNotExists
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
tEncoderClear
(
&
encoder
);
return
tlen
;
}
int32_t
tDeserializeSMDropCgroupReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropCgroupReq
*
pReq
)
{
SDecoder
decoder
=
{
0
};
tDecoderInit
(
&
decoder
,
buf
,
bufLen
);
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
topic
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
cgroup
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
igNotExists
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tDecoderClear
(
&
decoder
);
return
0
;
}
int32_t
tSerializeSCMCreateTopicReq
(
void
*
buf
,
int32_t
bufLen
,
const
SCMCreateTopicReq
*
pReq
)
{
int32_t
tSerializeSCMCreateTopicReq
(
void
*
buf
,
int32_t
bufLen
,
const
SCMCreateTopicReq
*
pReq
)
{
int32_t
sqlLen
=
0
;
int32_t
sqlLen
=
0
;
int32_t
astLen
=
0
;
int32_t
astLen
=
0
;
...
...
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
浏览文件 @
7e24be74
...
@@ -36,9 +36,9 @@ typedef struct SBnodeMgmt {
...
@@ -36,9 +36,9 @@ typedef struct SBnodeMgmt {
// bmHandle.c
// bmHandle.c
SArray
*
bmGetMsgHandles
();
SArray
*
bmGetMsgHandles
();
int32_t
bmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
p
Req
);
int32_t
bmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
p
Msg
);
int32_t
bmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
p
Req
);
int32_t
bmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
p
Msg
);
int32_t
bmProcessGetMonBmInfoReq
(
SBnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
bmProcessGetMonBmInfoReq
(
SBnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
// bmWorker.c
// bmWorker.c
int32_t
bmStartWorker
(
SBnodeMgmt
*
pMgmt
);
int32_t
bmStartWorker
(
SBnodeMgmt
*
pMgmt
);
...
...
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
浏览文件 @
7e24be74
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
void
bmGetMonitorInfo
(
SBnodeMgmt
*
pMgmt
,
SMonBmInfo
*
bmInfo
)
{}
void
bmGetMonitorInfo
(
SBnodeMgmt
*
pMgmt
,
SMonBmInfo
*
bmInfo
)
{}
int32_t
bmProcessGetMonBmInfoReq
(
SBnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
)
{
int32_t
bmProcessGetMonBmInfoReq
(
SBnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
SMonBmInfo
bmInfo
=
{
0
};
SMonBmInfo
bmInfo
=
{
0
};
bmGetMonitorInfo
(
pMgmt
,
&
bmInfo
);
bmGetMonitorInfo
(
pMgmt
,
&
bmInfo
);
dmGetMonitorSystemInfo
(
&
bmInfo
.
sys
);
dmGetMonitorSystemInfo
(
&
bmInfo
.
sys
);
...
@@ -37,17 +37,15 @@ int32_t bmProcessGetMonBmInfoReq(SBnodeMgmt *pMgmt, SRpcMsg *pReq) {
...
@@ -37,17 +37,15 @@ int32_t bmProcessGetMonBmInfoReq(SBnodeMgmt *pMgmt, SRpcMsg *pReq) {
}
}
tSerializeSMonBmInfo
(
pRsp
,
rspLen
,
&
bmInfo
);
tSerializeSMonBmInfo
(
pRsp
,
rspLen
,
&
bmInfo
);
p
Req
->
info
.
rsp
=
pRsp
;
p
Msg
->
info
.
rsp
=
pRsp
;
p
Req
->
info
.
rspLen
=
rspLen
;
p
Msg
->
info
.
rspLen
=
rspLen
;
tFreeSMonBmInfo
(
&
bmInfo
);
tFreeSMonBmInfo
(
&
bmInfo
);
return
0
;
return
0
;
}
}
int32_t
bmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
int32_t
bmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDCreateBnodeReq
createReq
=
{
0
};
SDCreateBnodeReq
createReq
=
{
0
};
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
@@ -68,10 +66,8 @@ int32_t bmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
...
@@ -68,10 +66,8 @@ int32_t bmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
}
}
int32_t
bmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
int32_t
bmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDDropBnodeReq
dropReq
=
{
0
};
SDDropBnodeReq
dropReq
=
{
0
};
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
...
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
浏览文件 @
7e24be74
...
@@ -41,18 +41,18 @@ typedef struct SMnodeMgmt {
...
@@ -41,18 +41,18 @@ typedef struct SMnodeMgmt {
// mmFile.c
// mmFile.c
int32_t
mmReadFile
(
SMnodeMgmt
*
pMgmt
,
bool
*
pDeployed
);
int32_t
mmReadFile
(
SMnodeMgmt
*
pMgmt
,
bool
*
pDeployed
);
int32_t
mmWriteFile
(
SMnodeMgmt
*
pMgmt
,
SDCreateMnodeReq
*
p
Req
,
bool
deployed
);
int32_t
mmWriteFile
(
SMnodeMgmt
*
pMgmt
,
SDCreateMnodeReq
*
p
Msg
,
bool
deployed
);
// mmInt.c
// mmInt.c
int32_t
mmAlter
(
SMnodeMgmt
*
pMgmt
,
SDAlterMnodeReq
*
p
Req
);
int32_t
mmAlter
(
SMnodeMgmt
*
pMgmt
,
SDAlterMnodeReq
*
p
Msg
);
// mmHandle.c
// mmHandle.c
SArray
*
mmGetMsgHandles
();
SArray
*
mmGetMsgHandles
();
int32_t
mmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessAlterReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessAlterReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessGetMonitorInfoReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
mmProcessGetMonitorInfoReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
int32_t
mmProcessGetLoadsReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
mmProcessGetLoadsReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
// mmWorker.c
// mmWorker.c
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
);
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
);
...
@@ -62,10 +62,10 @@ int32_t mmPutNodeMsgToSyncQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg);
...
@@ -62,10 +62,10 @@ int32_t mmPutNodeMsgToSyncQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t
mmPutNodeMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmPutNodeMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmPutNodeMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmPutNodeMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmPutNodeMsgToMonitorQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmPutNodeMsgToMonitorQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmPutRpcMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Rpc
);
int32_t
mmPutRpcMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
int32_t
mmPutRpcMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Rpc
);
int32_t
mmPutRpcMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
int32_t
mmPutRpcMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Rpc
);
int32_t
mmPutRpcMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
int32_t
mmPutRpcMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Rpc
);
int32_t
mmPutRpcMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/dnode/mgmt/mgmt_mnode/src/mmFile.c
浏览文件 @
7e24be74
...
@@ -104,7 +104,7 @@ _OVER:
...
@@ -104,7 +104,7 @@ _OVER:
return
code
;
return
code
;
}
}
int32_t
mmWriteFile
(
SMnodeMgmt
*
pMgmt
,
SDCreateMnodeReq
*
p
Req
,
bool
deployed
)
{
int32_t
mmWriteFile
(
SMnodeMgmt
*
pMgmt
,
SDCreateMnodeReq
*
p
Msg
,
bool
deployed
)
{
char
file
[
PATH_MAX
]
=
{
0
};
char
file
[
PATH_MAX
]
=
{
0
};
char
realfile
[
PATH_MAX
]
=
{
0
};
char
realfile
[
PATH_MAX
]
=
{
0
};
snprintf
(
file
,
sizeof
(
file
),
"%s%smnode.json.bak"
,
pMgmt
->
path
,
TD_DIRSEP
);
snprintf
(
file
,
sizeof
(
file
),
"%s%smnode.json.bak"
,
pMgmt
->
path
,
TD_DIRSEP
);
...
@@ -124,11 +124,11 @@ int32_t mmWriteFile(SMnodeMgmt *pMgmt, SDCreateMnodeReq *pReq, bool deployed) {
...
@@ -124,11 +124,11 @@ int32_t mmWriteFile(SMnodeMgmt *pMgmt, SDCreateMnodeReq *pReq, bool deployed) {
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"{
\n
"
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"{
\n
"
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
mnodes
\"
: [{
\n
"
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
mnodes
\"
: [{
\n
"
);
int8_t
replica
=
(
p
Req
!=
NULL
?
pReq
->
replica
:
pMgmt
->
replica
);
int8_t
replica
=
(
p
Msg
!=
NULL
?
pMsg
->
replica
:
pMgmt
->
replica
);
for
(
int32_t
i
=
0
;
i
<
replica
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
replica
;
++
i
)
{
SReplica
*
pReplica
=
&
pMgmt
->
replicas
[
i
];
SReplica
*
pReplica
=
&
pMgmt
->
replicas
[
i
];
if
(
p
Req
!=
NULL
)
{
if
(
p
Msg
!=
NULL
)
{
pReplica
=
&
p
Req
->
replicas
[
i
];
pReplica
=
&
p
Msg
->
replicas
[
i
];
}
}
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
id
\"
: %d,
\n
"
,
pReplica
->
id
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
id
\"
: %d,
\n
"
,
pReplica
->
id
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
fqdn
\"
:
\"
%s
\"
,
\n
"
,
pReplica
->
fqdn
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
fqdn
\"
:
\"
%s
\"
,
\n
"
,
pReplica
->
fqdn
);
...
...
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
浏览文件 @
7e24be74
...
@@ -25,7 +25,7 @@ void mmGetMnodeLoads(SMnodeMgmt *pMgmt, SMonMloadInfo *pInfo) {
...
@@ -25,7 +25,7 @@ void mmGetMnodeLoads(SMnodeMgmt *pMgmt, SMonMloadInfo *pInfo) {
mndGetLoad
(
pMgmt
->
pMnode
,
&
pInfo
->
load
);
mndGetLoad
(
pMgmt
->
pMnode
,
&
pInfo
->
load
);
}
}
int32_t
mmProcessGetMonitorInfoReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
)
{
int32_t
mmProcessGetMonitorInfoReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
SMonMmInfo
mmInfo
=
{
0
};
SMonMmInfo
mmInfo
=
{
0
};
mmGetMonitorInfo
(
pMgmt
,
&
mmInfo
);
mmGetMonitorInfo
(
pMgmt
,
&
mmInfo
);
dmGetMonitorSystemInfo
(
&
mmInfo
.
sys
);
dmGetMonitorSystemInfo
(
&
mmInfo
.
sys
);
...
@@ -44,13 +44,13 @@ int32_t mmProcessGetMonitorInfoReq(SMnodeMgmt *pMgmt, SRpcMsg *pReq) {
...
@@ -44,13 +44,13 @@ int32_t mmProcessGetMonitorInfoReq(SMnodeMgmt *pMgmt, SRpcMsg *pReq) {
}
}
tSerializeSMonMmInfo
(
pRsp
,
rspLen
,
&
mmInfo
);
tSerializeSMonMmInfo
(
pRsp
,
rspLen
,
&
mmInfo
);
p
Req
->
info
.
rsp
=
pRsp
;
p
Msg
->
info
.
rsp
=
pRsp
;
p
Req
->
info
.
rspLen
=
rspLen
;
p
Msg
->
info
.
rspLen
=
rspLen
;
tFreeSMonMmInfo
(
&
mmInfo
);
tFreeSMonMmInfo
(
&
mmInfo
);
return
0
;
return
0
;
}
}
int32_t
mmProcessGetLoadsReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
)
{
int32_t
mmProcessGetLoadsReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
SMonMloadInfo
mloads
=
{
0
};
SMonMloadInfo
mloads
=
{
0
};
mmGetMnodeLoads
(
pMgmt
,
&
mloads
);
mmGetMnodeLoads
(
pMgmt
,
&
mloads
);
...
@@ -67,16 +67,14 @@ int32_t mmProcessGetLoadsReq(SMnodeMgmt *pMgmt, SRpcMsg *pReq) {
...
@@ -67,16 +67,14 @@ int32_t mmProcessGetLoadsReq(SMnodeMgmt *pMgmt, SRpcMsg *pReq) {
}
}
tSerializeSMonMloadInfo
(
pRsp
,
rspLen
,
&
mloads
);
tSerializeSMonMloadInfo
(
pRsp
,
rspLen
,
&
mloads
);
p
Req
->
info
.
rsp
=
pRsp
;
p
Msg
->
info
.
rsp
=
pRsp
;
p
Req
->
info
.
rspLen
=
rspLen
;
p
Msg
->
info
.
rspLen
=
rspLen
;
return
0
;
return
0
;
}
}
int32_t
mmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
int32_t
mmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDCreateMnodeReq
createReq
=
{
0
};
SDCreateMnodeReq
createReq
=
{
0
};
if
(
tDeserializeSDCreateMnodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeSDCreateMnodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
@@ -101,10 +99,8 @@ int32_t mmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
...
@@ -101,10 +99,8 @@ int32_t mmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
}
}
int32_t
mmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
int32_t
mmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDDropMnodeReq
dropReq
=
{
0
};
SDDropMnodeReq
dropReq
=
{
0
};
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
@@ -129,10 +125,8 @@ int32_t mmProcessDropReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
...
@@ -129,10 +125,8 @@ int32_t mmProcessDropReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
}
}
int32_t
mmProcessAlterReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
int32_t
mmProcessAlterReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDAlterMnodeReq
alterReq
=
{
0
};
SDAlterMnodeReq
alterReq
=
{
0
};
if
(
tDeserializeSDCreateMnodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
alterReq
)
!=
0
)
{
if
(
tDeserializeSDCreateMnodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
alterReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
...
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
浏览文件 @
7e24be74
...
@@ -87,9 +87,9 @@ static int32_t mmBuildOptionFromReq(SMnodeMgmt *pMgmt, SMnodeOpt *pOption, SDCre
...
@@ -87,9 +87,9 @@ static int32_t mmBuildOptionFromReq(SMnodeMgmt *pMgmt, SMnodeOpt *pOption, SDCre
return
0
;
return
0
;
}
}
int32_t
mmAlter
(
SMnodeMgmt
*
pMgmt
,
SDAlterMnodeReq
*
p
Req
)
{
int32_t
mmAlter
(
SMnodeMgmt
*
pMgmt
,
SDAlterMnodeReq
*
p
Msg
)
{
SMnodeOpt
option
=
{
0
};
SMnodeOpt
option
=
{
0
};
if
(
mmBuildOptionFromReq
(
pMgmt
,
&
option
,
p
Req
)
!=
0
)
{
if
(
mmBuildOptionFromReq
(
pMgmt
,
&
option
,
p
Msg
)
!=
0
)
{
return
-
1
;
return
-
1
;
}
}
...
@@ -98,7 +98,7 @@ int32_t mmAlter(SMnodeMgmt *pMgmt, SDAlterMnodeReq *pReq) {
...
@@ -98,7 +98,7 @@ int32_t mmAlter(SMnodeMgmt *pMgmt, SDAlterMnodeReq *pReq) {
}
}
bool
deployed
=
true
;
bool
deployed
=
true
;
if
(
mmWriteFile
(
pMgmt
,
p
Req
,
deployed
)
!=
0
)
{
if
(
mmWriteFile
(
pMgmt
,
p
Msg
,
deployed
)
!=
0
)
{
dError
(
"failed to write mnode file since %s"
,
terrstr
());
dError
(
"failed to write mnode file since %s"
,
terrstr
());
return
-
1
;
return
-
1
;
}
}
...
@@ -135,7 +135,7 @@ static int32_t mmOpen(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
...
@@ -135,7 +135,7 @@ static int32_t mmOpen(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
pMgmt
->
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToQueryQueue
;
pMgmt
->
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToQueryQueue
;
pMgmt
->
msgCb
.
queueFps
[
READ_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToReadQueue
;
pMgmt
->
msgCb
.
queueFps
[
READ_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToReadQueue
;
pMgmt
->
msgCb
.
queueFps
[
WRITE_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToWriteQueue
;
pMgmt
->
msgCb
.
queueFps
[
WRITE_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToWriteQueue
;
pMgmt
->
msgCb
.
queueFps
[
SYNC_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgTo
Write
Queue
;
pMgmt
->
msgCb
.
queueFps
[
SYNC_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgTo
Sync
Queue
;
pMgmt
->
msgCb
.
mgmt
=
pMgmt
;
pMgmt
->
msgCb
.
mgmt
=
pMgmt
;
bool
deployed
=
false
;
bool
deployed
=
false
;
...
...
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
7e24be74
...
@@ -126,7 +126,7 @@ int32_t mmPutRpcMsgToReadQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) {
...
@@ -126,7 +126,7 @@ int32_t mmPutRpcMsgToReadQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
readWorker
,
pMsg
);
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
readWorker
,
pMsg
);
}
}
int32_t
mmPutMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
syncWorker
,
pMsg
);
}
int32_t
mmPut
Rpc
MsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
syncWorker
,
pMsg
);
}
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
)
{
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
)
{
SSingleWorkerCfg
qCfg
=
{
SSingleWorkerCfg
qCfg
=
{
...
...
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
浏览文件 @
7e24be74
...
@@ -39,7 +39,7 @@ typedef struct SQnodeMgmt {
...
@@ -39,7 +39,7 @@ typedef struct SQnodeMgmt {
SArray
*
qmGetMsgHandles
();
SArray
*
qmGetMsgHandles
();
int32_t
qmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
qmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
qmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
qmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
qmProcessGetMonitorInfoReq
(
SQnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
qmProcessGetMonitorInfoReq
(
SQnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
// qmWorker.c
// qmWorker.c
int32_t
qmPutRpcMsgToQueryQueue
(
SQnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
qmPutRpcMsgToQueryQueue
(
SQnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
...
...
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
浏览文件 @
7e24be74
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
void
qmGetMonitorInfo
(
SQnodeMgmt
*
pMgmt
,
SMonQmInfo
*
qmInfo
)
{}
void
qmGetMonitorInfo
(
SQnodeMgmt
*
pMgmt
,
SMonQmInfo
*
qmInfo
)
{}
int32_t
qmProcessGetMonitorInfoReq
(
SQnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
)
{
int32_t
qmProcessGetMonitorInfoReq
(
SQnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
SMonQmInfo
qmInfo
=
{
0
};
SMonQmInfo
qmInfo
=
{
0
};
qmGetMonitorInfo
(
pMgmt
,
&
qmInfo
);
qmGetMonitorInfo
(
pMgmt
,
&
qmInfo
);
dmGetMonitorSystemInfo
(
&
qmInfo
.
sys
);
dmGetMonitorSystemInfo
(
&
qmInfo
.
sys
);
...
@@ -37,17 +37,15 @@ int32_t qmProcessGetMonitorInfoReq(SQnodeMgmt *pMgmt, SRpcMsg *pReq) {
...
@@ -37,17 +37,15 @@ int32_t qmProcessGetMonitorInfoReq(SQnodeMgmt *pMgmt, SRpcMsg *pReq) {
}
}
tSerializeSMonQmInfo
(
pRsp
,
rspLen
,
&
qmInfo
);
tSerializeSMonQmInfo
(
pRsp
,
rspLen
,
&
qmInfo
);
p
Req
->
info
.
rsp
=
pRsp
;
p
Msg
->
info
.
rsp
=
pRsp
;
p
Req
->
info
.
rspLen
=
rspLen
;
p
Msg
->
info
.
rspLen
=
rspLen
;
tFreeSMonQmInfo
(
&
qmInfo
);
tFreeSMonQmInfo
(
&
qmInfo
);
return
0
;
return
0
;
}
}
int32_t
qmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
int32_t
qmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDCreateQnodeReq
createReq
=
{
0
};
SDCreateQnodeReq
createReq
=
{
0
};
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
@@ -68,10 +66,8 @@ int32_t qmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
...
@@ -68,10 +66,8 @@ int32_t qmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
}
}
int32_t
qmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
int32_t
qmProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDDropQnodeReq
dropReq
=
{
0
};
SDDropQnodeReq
dropReq
=
{
0
};
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
...
source/dnode/mgmt/mgmt_snode/inc/smInt.h
浏览文件 @
7e24be74
...
@@ -40,7 +40,7 @@ typedef struct SSnodeMgmt {
...
@@ -40,7 +40,7 @@ typedef struct SSnodeMgmt {
SArray
*
smGetMsgHandles
();
SArray
*
smGetMsgHandles
();
int32_t
smProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
smProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
smProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
smProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
smProcessGetMonitorInfoReq
(
SSnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
smProcessGetMonitorInfoReq
(
SSnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
// smWorker.c
// smWorker.c
int32_t
smStartWorker
(
SSnodeMgmt
*
pMgmt
);
int32_t
smStartWorker
(
SSnodeMgmt
*
pMgmt
);
...
...
source/dnode/mgmt/mgmt_snode/src/smHandle.c
浏览文件 @
7e24be74
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
void
smGetMonitorInfo
(
SSnodeMgmt
*
pMgmt
,
SMonSmInfo
*
smInfo
)
{}
void
smGetMonitorInfo
(
SSnodeMgmt
*
pMgmt
,
SMonSmInfo
*
smInfo
)
{}
int32_t
smProcessGetMonitorInfoReq
(
SSnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
)
{
int32_t
smProcessGetMonitorInfoReq
(
SSnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
SMonSmInfo
smInfo
=
{
0
};
SMonSmInfo
smInfo
=
{
0
};
smGetMonitorInfo
(
pMgmt
,
&
smInfo
);
smGetMonitorInfo
(
pMgmt
,
&
smInfo
);
dmGetMonitorSystemInfo
(
&
smInfo
.
sys
);
dmGetMonitorSystemInfo
(
&
smInfo
.
sys
);
...
@@ -37,17 +37,15 @@ int32_t smProcessGetMonitorInfoReq(SSnodeMgmt *pMgmt, SRpcMsg *pReq) {
...
@@ -37,17 +37,15 @@ int32_t smProcessGetMonitorInfoReq(SSnodeMgmt *pMgmt, SRpcMsg *pReq) {
}
}
tSerializeSMonSmInfo
(
pRsp
,
rspLen
,
&
smInfo
);
tSerializeSMonSmInfo
(
pRsp
,
rspLen
,
&
smInfo
);
p
Req
->
info
.
rsp
=
pRsp
;
p
Msg
->
info
.
rsp
=
pRsp
;
p
Req
->
info
.
rspLen
=
rspLen
;
p
Msg
->
info
.
rspLen
=
rspLen
;
tFreeSMonSmInfo
(
&
smInfo
);
tFreeSMonSmInfo
(
&
smInfo
);
return
0
;
return
0
;
}
}
int32_t
smProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
int32_t
smProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDCreateSnodeReq
createReq
=
{
0
};
SDCreateSnodeReq
createReq
=
{
0
};
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
@@ -68,10 +66,8 @@ int32_t smProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
...
@@ -68,10 +66,8 @@ int32_t smProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
}
}
int32_t
smProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
int32_t
smProcessDropReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDDropSnodeReq
dropReq
=
{
0
};
SDDropSnodeReq
dropReq
=
{
0
};
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeSCreateDropMQSBNodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
...
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
浏览文件 @
7e24be74
...
@@ -84,10 +84,10 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode);
...
@@ -84,10 +84,10 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode);
// vmHandle.c
// vmHandle.c
SArray
*
vmGetMsgHandles
();
SArray
*
vmGetMsgHandles
();
int32_t
vmProcessCreateVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
vmProcessCreateVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
int32_t
vmProcessDropVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
vmProcessDropVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
int32_t
vmProcessGetMonitorInfoReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
vmProcessGetMonitorInfoReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
int32_t
vmProcessGetLoadsReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
);
int32_t
vmProcessGetLoadsReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
);
// vmFile.c
// vmFile.c
int32_t
vmGetVnodeListFromFile
(
SVnodeMgmt
*
pMgmt
,
SWrapperCfg
**
ppCfgs
,
int32_t
*
numOfVnodes
);
int32_t
vmGetVnodeListFromFile
(
SVnodeMgmt
*
pMgmt
,
SWrapperCfg
**
ppCfgs
,
int32_t
*
numOfVnodes
);
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
7e24be74
...
@@ -82,7 +82,7 @@ void vmGetMonitorInfo(SVnodeMgmt *pMgmt, SMonVmInfo *pInfo) {
...
@@ -82,7 +82,7 @@ void vmGetMonitorInfo(SVnodeMgmt *pMgmt, SMonVmInfo *pInfo) {
taosArrayDestroy
(
pVloads
);
taosArrayDestroy
(
pVloads
);
}
}
int32_t
vmProcessGetMonitorInfoReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
)
{
int32_t
vmProcessGetMonitorInfoReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
SMonVmInfo
vmInfo
=
{
0
};
SMonVmInfo
vmInfo
=
{
0
};
vmGetMonitorInfo
(
pMgmt
,
&
vmInfo
);
vmGetMonitorInfo
(
pMgmt
,
&
vmInfo
);
dmGetMonitorSystemInfo
(
&
vmInfo
.
sys
);
dmGetMonitorSystemInfo
(
&
vmInfo
.
sys
);
...
@@ -101,13 +101,13 @@ int32_t vmProcessGetMonitorInfoReq(SVnodeMgmt *pMgmt, SRpcMsg *pReq) {
...
@@ -101,13 +101,13 @@ int32_t vmProcessGetMonitorInfoReq(SVnodeMgmt *pMgmt, SRpcMsg *pReq) {
}
}
tSerializeSMonVmInfo
(
pRsp
,
rspLen
,
&
vmInfo
);
tSerializeSMonVmInfo
(
pRsp
,
rspLen
,
&
vmInfo
);
p
Req
->
info
.
rsp
=
pRsp
;
p
Msg
->
info
.
rsp
=
pRsp
;
p
Req
->
info
.
rspLen
=
rspLen
;
p
Msg
->
info
.
rspLen
=
rspLen
;
tFreeSMonVmInfo
(
&
vmInfo
);
tFreeSMonVmInfo
(
&
vmInfo
);
return
0
;
return
0
;
}
}
int32_t
vmProcessGetLoadsReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Req
)
{
int32_t
vmProcessGetLoadsReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
SMonVloadInfo
vloads
=
{
0
};
SMonVloadInfo
vloads
=
{
0
};
vmGetVnodeLoads
(
pMgmt
,
&
vloads
);
vmGetVnodeLoads
(
pMgmt
,
&
vloads
);
...
@@ -124,8 +124,8 @@ int32_t vmProcessGetLoadsReq(SVnodeMgmt *pMgmt, SRpcMsg *pReq) {
...
@@ -124,8 +124,8 @@ int32_t vmProcessGetLoadsReq(SVnodeMgmt *pMgmt, SRpcMsg *pReq) {
}
}
tSerializeSMonVloadInfo
(
pRsp
,
rspLen
,
&
vloads
);
tSerializeSMonVloadInfo
(
pRsp
,
rspLen
,
&
vloads
);
p
Req
->
info
.
rsp
=
pRsp
;
p
Msg
->
info
.
rsp
=
pRsp
;
p
Req
->
info
.
rspLen
=
rspLen
;
p
Msg
->
info
.
rspLen
=
rspLen
;
tFreeSMonVloadInfo
(
&
vloads
);
tFreeSMonVloadInfo
(
&
vloads
);
return
0
;
return
0
;
}
}
...
@@ -174,12 +174,11 @@ static void vmGenerateWrapperCfg(SVnodeMgmt *pMgmt, SCreateVnodeReq *pCreate, SW
...
@@ -174,12 +174,11 @@ static void vmGenerateWrapperCfg(SVnodeMgmt *pMgmt, SCreateVnodeReq *pCreate, SW
}
}
int32_t
vmProcessCreateVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
int32_t
vmProcessCreateVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SCreateVnodeReq
createReq
=
{
0
};
SCreateVnodeReq
createReq
=
{
0
};
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
char
path
[
TSDB_FILENAME_LEN
]
=
{
0
};
char
path
[
TSDB_FILENAME_LEN
]
=
{
0
};
if
(
tDeserializeSCreateVnodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeSCreateVnodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
@@ -242,9 +241,8 @@ _OVER:
...
@@ -242,9 +241,8 @@ _OVER:
}
}
int32_t
vmProcessDropVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
int32_t
vmProcessDropVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDropVnodeReq
dropReq
=
{
0
};
SDropVnodeReq
dropReq
=
{
0
};
if
(
tDeserializeSDropVnodeReq
(
p
Req
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeSDropVnodeReq
(
p
Msg
->
pCont
,
pMsg
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
7e24be74
...
@@ -200,12 +200,12 @@ int32_t dmInitMsgHandle(SDnode *pDnode) {
...
@@ -200,12 +200,12 @@ int32_t dmInitMsgHandle(SDnode *pDnode) {
return
0
;
return
0
;
}
}
static
void
dmSendRpcRedirectRsp
(
const
SRpcMsg
*
p
Req
)
{
static
void
dmSendRpcRedirectRsp
(
const
SRpcMsg
*
p
Msg
)
{
SDnode
*
pDnode
=
dmInstance
();
SDnode
*
pDnode
=
dmInstance
();
SEpSet
epSet
=
{
0
};
SEpSet
epSet
=
{
0
};
dmGetMnodeEpSet
(
&
pDnode
->
data
,
&
epSet
);
dmGetMnodeEpSet
(
&
pDnode
->
data
,
&
epSet
);
dDebug
(
"RPC %p, req is redirected, num:%d use:%d"
,
p
Req
->
info
.
handle
,
epSet
.
numOfEps
,
epSet
.
inUse
);
dDebug
(
"RPC %p, req is redirected, num:%d use:%d"
,
p
Msg
->
info
.
handle
,
epSet
.
numOfEps
,
epSet
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
epSet
.
numOfEps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
epSet
.
numOfEps
;
++
i
)
{
dDebug
(
"mnode index:%d %s:%u"
,
i
,
epSet
.
eps
[
i
].
fqdn
,
epSet
.
eps
[
i
].
port
);
dDebug
(
"mnode index:%d %s:%u"
,
i
,
epSet
.
eps
[
i
].
fqdn
,
epSet
.
eps
[
i
].
port
);
if
(
strcmp
(
epSet
.
eps
[
i
].
fqdn
,
tsLocalFqdn
)
==
0
&&
epSet
.
eps
[
i
].
port
==
tsServerPort
)
{
if
(
strcmp
(
epSet
.
eps
[
i
].
fqdn
,
tsLocalFqdn
)
==
0
&&
epSet
.
eps
[
i
].
port
==
tsServerPort
)
{
...
@@ -220,12 +220,14 @@ static void dmSendRpcRedirectRsp(const SRpcMsg *pReq) {
...
@@ -220,12 +220,14 @@ static void dmSendRpcRedirectRsp(const SRpcMsg *pReq) {
SRpcMsg
rsp
=
{
SRpcMsg
rsp
=
{
.
code
=
TSDB_CODE_RPC_REDIRECT
,
.
code
=
TSDB_CODE_RPC_REDIRECT
,
.
info
=
p
Req
->
info
,
.
info
=
p
Msg
->
info
,
.
contLen
=
len
,
.
contLen
=
len
,
};
};
rsp
.
pCont
=
rpcMallocCont
(
len
);
rsp
.
pCont
=
rpcMallocCont
(
len
);
tSerializeSMEpSet
(
rsp
.
pCont
,
len
,
&
msg
);
tSerializeSMEpSet
(
rsp
.
pCont
,
len
,
&
msg
);
rpcSendResponse
(
&
rsp
);
rpcSendResponse
(
&
rsp
);
rpcFreeCont
(
pMsg
->
pCont
);
}
}
static
inline
void
dmSendRecv
(
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
)
{
static
inline
void
dmSendRecv
(
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
)
{
...
@@ -239,16 +241,16 @@ static inline void dmSendRecv(SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp) {
...
@@ -239,16 +241,16 @@ static inline void dmSendRecv(SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp) {
}
}
}
}
static
inline
int32_t
dmSendReq
(
const
SEpSet
*
pEpSet
,
SRpcMsg
*
p
Req
)
{
static
inline
int32_t
dmSendReq
(
const
SEpSet
*
pEpSet
,
SRpcMsg
*
p
Msg
)
{
SDnode
*
pDnode
=
dmInstance
();
SDnode
*
pDnode
=
dmInstance
();
if
(
pDnode
->
status
!=
DND_STAT_RUNNING
)
{
if
(
pDnode
->
status
!=
DND_STAT_RUNNING
)
{
rpcFreeCont
(
p
Req
->
pCont
);
rpcFreeCont
(
p
Msg
->
pCont
);
p
Req
->
pCont
=
NULL
;
p
Msg
->
pCont
=
NULL
;
terrno
=
TSDB_CODE_NODE_OFFLINE
;
terrno
=
TSDB_CODE_NODE_OFFLINE
;
dError
(
"failed to send rpc msg since %s, handle:%p"
,
terrstr
(),
p
Req
->
info
.
handle
);
dError
(
"failed to send rpc msg since %s, handle:%p"
,
terrstr
(),
p
Msg
->
info
.
handle
);
return
-
1
;
return
-
1
;
}
else
{
}
else
{
rpcSendRequest
(
pDnode
->
trans
.
clientRpc
,
pEpSet
,
p
Req
,
NULL
);
rpcSendRequest
(
pDnode
->
trans
.
clientRpc
,
pEpSet
,
p
Msg
,
NULL
);
return
0
;
return
0
;
}
}
}
}
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
7e24be74
...
@@ -624,14 +624,12 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
...
@@ -624,14 +624,12 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_DND_CONFIG_DNODE
,
.
pCont
=
pBuf
,
.
contLen
=
bufLen
,
.
info
=
pReq
->
info
};
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_DND_CONFIG_DNODE
,
.
pCont
=
pBuf
,
.
contLen
=
bufLen
,
.
info
=
pReq
->
info
};
mInfo
(
"dnode:%d, app:%p config:%s req send to dnode"
,
cfgReq
.
dnodeId
,
rpcMsg
.
info
.
ahandle
,
cfgReq
.
config
);
mDebug
(
"dnode:%d, send config req to dnode, app:%p"
,
cfgReq
.
dnodeId
,
rpcMsg
.
info
.
ahandle
);
tmsgSendReq
(
&
epSet
,
&
rpcMsg
);
return
tmsgSendReq
(
&
epSet
,
&
rpcMsg
);
return
0
;
}
}
static
int32_t
mndProcessConfigDnodeRsp
(
SRpcMsg
*
pRsp
)
{
static
int32_t
mndProcessConfigDnodeRsp
(
SRpcMsg
*
pRsp
)
{
m
Info
(
"app:%p config rsp from dnode
"
,
pRsp
->
info
.
ahandle
);
m
Debug
(
"config rsp from dnode, app:%p
"
,
pRsp
->
info
.
ahandle
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
7e24be74
...
@@ -420,6 +420,11 @@ static STsdbReadHandle* tsdbQueryTablesImpl(SVnode* pVnode, SQueryTableDataCond*
...
@@ -420,6 +420,11 @@ static STsdbReadHandle* tsdbQueryTablesImpl(SVnode* pVnode, SQueryTableDataCond*
setQueryTimewindow
(
pReadHandle
,
pCond
);
setQueryTimewindow
(
pReadHandle
,
pCond
);
if
(
pCond
->
numOfCols
>
0
)
{
if
(
pCond
->
numOfCols
>
0
)
{
int32_t
rowLen
=
0
;
for
(
int32_t
i
=
0
;
i
<
pCond
->
numOfCols
;
++
i
)
{
rowLen
+=
pCond
->
colList
[
i
].
bytes
;
}
// allocate buffer in order to load data blocks from file
// allocate buffer in order to load data blocks from file
pReadHandle
->
suppInfo
.
pstatis
=
taosMemoryCalloc
(
pCond
->
numOfCols
,
sizeof
(
SColumnDataAgg
));
pReadHandle
->
suppInfo
.
pstatis
=
taosMemoryCalloc
(
pCond
->
numOfCols
,
sizeof
(
SColumnDataAgg
));
if
(
pReadHandle
->
suppInfo
.
pstatis
==
NULL
)
{
if
(
pReadHandle
->
suppInfo
.
pstatis
==
NULL
)
{
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
7e24be74
...
@@ -118,11 +118,6 @@ int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRpcMsg
...
@@ -118,11 +118,6 @@ int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRpcMsg
break
;
break
;
}
}
if
(
tqPushMsg
(
pVnode
->
pTq
,
pMsg
->
pCont
,
pMsg
->
contLen
,
pMsg
->
msgType
,
version
)
<
0
)
{
vError
(
"vgId:%d failed to push msg to TQ since %s"
,
TD_VID
(
pVnode
),
tstrerror
(
terrno
));
return
-
1
;
}
vDebug
(
"vgId:%d process %s request success, version: %"
PRId64
,
TD_VID
(
pVnode
),
TMSG_INFO
(
pMsg
->
msgType
),
version
);
vDebug
(
"vgId:%d process %s request success, version: %"
PRId64
,
TD_VID
(
pVnode
),
TMSG_INFO
(
pMsg
->
msgType
),
version
);
if
(
tqPushMsg
(
pVnode
->
pTq
,
pMsg
->
pCont
,
pMsg
->
contLen
,
pMsg
->
msgType
,
version
)
<
0
)
{
if
(
tqPushMsg
(
pVnode
->
pTq
,
pMsg
->
pCont
,
pMsg
->
contLen
,
pMsg
->
msgType
,
version
)
<
0
)
{
...
...
source/libs/executor/src/executor.c
浏览文件 @
7e24be74
...
@@ -14,8 +14,6 @@
...
@@ -14,8 +14,6 @@
*/
*/
#include "executor.h"
#include "executor.h"
#include <executorimpl.h>
#include <vnode.h>
#include "executorimpl.h"
#include "executorimpl.h"
#include "planner.h"
#include "planner.h"
#include "tdatablock.h"
#include "tdatablock.h"
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
7e24be74
...
@@ -586,8 +586,7 @@ void doApplyFunctions(SExecTaskInfo* taskInfo, SqlFunctionCtx* pCtx, STimeWindow
...
@@ -586,8 +586,7 @@ void doApplyFunctions(SExecTaskInfo* taskInfo, SqlFunctionCtx* pCtx, STimeWindow
int32_t
numOfRows
=
pCtx
[
k
].
input
.
numOfRows
;
int32_t
numOfRows
=
pCtx
[
k
].
input
.
numOfRows
;
int32_t
startOffset
=
pCtx
[
k
].
input
.
startRowIndex
;
int32_t
startOffset
=
pCtx
[
k
].
input
.
startRowIndex
;
int32_t
pos
=
(
order
==
TSDB_ORDER_ASC
)
?
offset
:
offset
-
(
forwardStep
-
1
);
pCtx
[
k
].
input
.
startRowIndex
=
offset
;
pCtx
[
k
].
input
.
startRowIndex
=
pos
;
pCtx
[
k
].
input
.
numOfRows
=
forwardStep
;
pCtx
[
k
].
input
.
numOfRows
=
forwardStep
;
if
(
tsCol
!=
NULL
)
{
if
(
tsCol
!=
NULL
)
{
...
@@ -758,45 +757,6 @@ static int32_t doSetInputDataBlock(SOperatorInfo* pOperator, SqlFunctionCtx* pCt
...
@@ -758,45 +757,6 @@ static int32_t doSetInputDataBlock(SOperatorInfo* pOperator, SqlFunctionCtx* pCt
}
}
}
}
}
}
// setBlockStatisInfo(&pCtx[i], pBlock, pOperator->pExpr[i].base.pColumns);
// uint32_t flag = pOperator->pExpr[i].base.pParam[0].pCol->flag;
// if (TSDB_COL_IS_NORMAL_COL(flag) /*|| (pCtx[i].functionId == FUNCTION_BLKINFO) ||
// (TSDB_COL_IS_TAG(flag) && pOperator->pRuntimeEnv->scanFlag == MERGE_STAGE)*/) {
// SColumn* pCol = pOperator->pExpr[i].base.pParam[0].pCol;
// if (pCtx[i].columnIndex == -1) {
// for(int32_t j = 0; j < pBlock->info.numOfCols; ++j) {
// SColumnInfoData* pColData = taosArrayGet(pBlock->pDataBlock, j);
// if (pColData->info.colId == pCol->colId) {
// pCtx[i].columnIndex = j;
// break;
// }
// }
// }
// uint32_t status = aAggs[pCtx[i].functionId].status;
// if ((status & (FUNCSTATE_SELECTIVITY | FUNCSTATE_NEED_TS)) != 0) {
// SColumnInfoData* tsInfo = taosArrayGet(pBlock->pDataBlock, 0);
// In case of the top/bottom query again the nest query result, which has no timestamp column
// don't set the ptsList attribute.
// if (tsInfo->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
// pCtx[i].ptsList = (int64_t*) tsInfo->pData;
// } else {
// pCtx[i].ptsList = NULL;
// }
// }
// } else if (TSDB_COL_IS_UD_COL(pCol->flag) && (pOperator->pRuntimeEnv->scanFlag == MERGE_STAGE)) {
// SColIndex* pColIndex = &pOperator->pExpr[i].base.colInfo;
// SColumnInfoData* p = taosArrayGet(pBlock->pDataBlock, pColIndex->colIndex);
//
// pCtx[i].pInput = p->pData;
// assert(p->info.colId == pColIndex->info.colId && pCtx[i].inputType == p->info.type);
// for(int32_t j = 0; j < pBlock->info.rows; ++j) {
// char* dst = p->pData + j * p->info.bytes;
// taosVariantDump(&pOperator->pExpr[i].base.param[1], dst, p->info.type, true);
// }
// }
}
}
return
code
;
return
code
;
...
@@ -2842,9 +2802,11 @@ int32_t setSDataBlockFromFetchRsp(SSDataBlock* pRes, SLoadRemoteDataInfo* pLoadI
...
@@ -2842,9 +2802,11 @@ int32_t setSDataBlockFromFetchRsp(SSDataBlock* pRes, SLoadRemoteDataInfo* pLoadI
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
idata
=
{
0
};
SColumnInfoData
idata
=
{
0
};
idata
.
info
.
type
=
pSchema
[
i
].
type
;
idata
.
info
.
type
=
pSchema
[
i
].
type
;
idata
.
info
.
bytes
=
pSchema
[
i
].
bytes
;
idata
.
info
.
bytes
=
pSchema
[
i
].
bytes
;
idata
.
info
.
colId
=
pSchema
[
i
].
colId
;
idata
.
info
.
colId
=
pSchema
[
i
].
colId
;
idata
.
hasNull
=
true
;
taosArrayPush
(
pBlock
->
pDataBlock
,
&
idata
);
taosArrayPush
(
pBlock
->
pDataBlock
,
&
idata
);
if
(
IS_VAR_DATA_TYPE
(
idata
.
info
.
type
))
{
if
(
IS_VAR_DATA_TYPE
(
idata
.
info
.
type
))
{
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
7e24be74
...
@@ -898,11 +898,11 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
...
@@ -898,11 +898,11 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
SSDataBlock
*
upRes
=
getUpdateDataBlock
(
pInfo
,
true
);
//TODO(liuyao) get invertible from plan
SSDataBlock
*
upRes
=
getUpdateDataBlock
(
pInfo
,
true
);
//TODO(liuyao) get invertible from plan
if
(
upRes
)
{
if
(
upRes
)
{
pInfo
->
pUpdateRes
=
upRes
;
pInfo
->
pUpdateRes
=
upRes
;
if
(
upRes
->
info
.
type
=
STREAM_REPROCESS
)
{
if
(
upRes
->
info
.
type
=
=
STREAM_REPROCESS
)
{
pInfo
->
updateResIndex
=
0
;
pInfo
->
updateResIndex
=
0
;
prepareDataScan
(
pInfo
);
prepareDataScan
(
pInfo
);
pInfo
->
scanMode
=
STREAM_SCAN_FROM_UPDATERES
;
pInfo
->
scanMode
=
STREAM_SCAN_FROM_UPDATERES
;
}
else
if
(
upRes
->
info
.
type
=
STREAM_INVERT
)
{
}
else
if
(
upRes
->
info
.
type
=
=
STREAM_INVERT
)
{
pInfo
->
scanMode
=
STREAM_SCAN_FROM_RES
;
pInfo
->
scanMode
=
STREAM_SCAN_FROM_RES
;
return
upRes
;
return
upRes
;
}
}
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
7e24be74
...
@@ -1072,7 +1072,9 @@ static void doClearWindows(SAggSupporter* pSup, SOptrBasicInfo* pBinfo,
...
@@ -1072,7 +1072,9 @@ static void doClearWindows(SAggSupporter* pSup, SOptrBasicInfo* pBinfo,
static
SSDataBlock
*
doStreamIntervalAgg
(
SOperatorInfo
*
pOperator
)
{
static
SSDataBlock
*
doStreamIntervalAgg
(
SOperatorInfo
*
pOperator
)
{
SIntervalAggOperatorInfo
*
pInfo
=
pOperator
->
info
;
SIntervalAggOperatorInfo
*
pInfo
=
pOperator
->
info
;
int32_t
order
=
TSDB_ORDER_ASC
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
pInfo
->
order
=
TSDB_ORDER_ASC
;
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
return
NULL
;
...
@@ -1086,11 +1088,9 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
...
@@ -1086,11 +1088,9 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
return
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
?
NULL
:
pInfo
->
binfo
.
pRes
;
return
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
?
NULL
:
pInfo
->
binfo
.
pRes
;
}
}
// STimeWindow win = {0};
SOperatorInfo
*
downstream
=
pOperator
->
pDownstream
[
0
];
SOperatorInfo
*
downstream
=
pOperator
->
pDownstream
[
0
];
SArray
*
pUpdated
=
NULL
;
SArray
*
pUpdated
=
NULL
;
while
(
1
)
{
while
(
1
)
{
publishOperatorProfEvent
(
downstream
,
QUERY_PROF_BEFORE_OPERATOR_EXEC
);
publishOperatorProfEvent
(
downstream
,
QUERY_PROF_BEFORE_OPERATOR_EXEC
);
SSDataBlock
*
pBlock
=
downstream
->
fpSet
.
getNextFn
(
downstream
);
SSDataBlock
*
pBlock
=
downstream
->
fpSet
.
getNextFn
(
downstream
);
...
@@ -1103,16 +1103,18 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
...
@@ -1103,16 +1103,18 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
// The timewindows that overlaps the timestamps of the input pBlock need to be recalculated and return to the
// The timewindows that overlaps the timestamps of the input pBlock need to be recalculated and return to the
// caller. Note that all the time window are not close till now.
// caller. Note that all the time window are not close till now.
// the pDataBlock are always the same one, no need to call this again
// the pDataBlock are always the same one, no need to call this again
setInputDataBlock
(
pOperator
,
pInfo
->
binfo
.
pCtx
,
pBlock
,
order
,
MAIN_SCAN
,
true
);
setInputDataBlock
(
pOperator
,
pInfo
->
binfo
.
pCtx
,
pBlock
,
pInfo
->
order
,
MAIN_SCAN
,
true
);
if
(
pInfo
->
invertible
)
{
if
(
pInfo
->
invertible
)
{
setInverFunction
(
pInfo
->
binfo
.
pCtx
,
pOperator
->
numOfExprs
,
pBlock
->
info
.
type
);
setInverFunction
(
pInfo
->
binfo
.
pCtx
,
pOperator
->
numOfExprs
,
pBlock
->
info
.
type
);
}
}
if
(
pBlock
->
info
.
type
==
STREAM_REPROCESS
)
{
if
(
pBlock
->
info
.
type
==
STREAM_REPROCESS
)
{
doClearWindows
(
&
pInfo
->
aggSup
,
&
pInfo
->
binfo
,
&
pInfo
->
interval
,
doClearWindows
(
&
pInfo
->
aggSup
,
&
pInfo
->
binfo
,
&
pInfo
->
interval
,
pInfo
->
primaryTsIndex
,
pOperator
->
numOfExprs
,
pBlock
);
pInfo
->
primaryTsIndex
,
pOperator
->
numOfExprs
,
pBlock
);
qDebug
(
"%s clear existed time window results for updates checked"
,
GET_TASKID
(
pTaskInfo
));
continue
;
continue
;
}
}
pInfo
->
order
=
TSDB_ORDER_ASC
;
pUpdated
=
hashIntervalAgg
(
pOperator
,
&
pInfo
->
binfo
.
resultRowInfo
,
pBlock
,
0
);
pUpdated
=
hashIntervalAgg
(
pOperator
,
&
pInfo
->
binfo
.
resultRowInfo
,
pBlock
,
0
);
}
}
...
...
source/libs/function/src/functionMgt.c
浏览文件 @
7e24be74
...
@@ -207,6 +207,9 @@ bool fmIsInvertible(int32_t funcId) {
...
@@ -207,6 +207,9 @@ bool fmIsInvertible(int32_t funcId) {
case
FUNCTION_TYPE_SUM
:
case
FUNCTION_TYPE_SUM
:
case
FUNCTION_TYPE_STDDEV
:
case
FUNCTION_TYPE_STDDEV
:
case
FUNCTION_TYPE_AVG
:
case
FUNCTION_TYPE_AVG
:
case
FUNCTION_TYPE_WSTARTTS
:
case
FUNCTION_TYPE_WENDTS
:
case
FUNCTION_TYPE_WDURATION
:
res
=
true
;
res
=
true
;
break
;
break
;
default:
default:
...
...
source/libs/function/test/udf2.c
浏览文件 @
7e24be74
...
@@ -64,7 +64,11 @@ int32_t udf2(SUdfDataBlock* block, SUdfInterBuf *interBuf, SUdfInterBuf *newInte
...
@@ -64,7 +64,11 @@ int32_t udf2(SUdfDataBlock* block, SUdfInterBuf *interBuf, SUdfInterBuf *newInte
*
(
double
*
)(
newInterBuf
->
buf
)
=
sumSquares
;
*
(
double
*
)(
newInterBuf
->
buf
)
=
sumSquares
;
newInterBuf
->
bufLen
=
sizeof
(
double
);
newInterBuf
->
bufLen
=
sizeof
(
double
);
}
}
newInterBuf
->
numOfResult
=
numOutput
;
if
(
interBuf
->
numOfResult
==
0
&&
numOutput
==
0
)
{
newInterBuf
->
numOfResult
=
0
;
}
else
{
newInterBuf
->
numOfResult
=
1
;
}
return
0
;
return
0
;
}
}
...
...
tests/script/tsim/tstream/basic1.sim
浏览文件 @
7e24be74
...
@@ -137,7 +137,11 @@ endi
...
@@ -137,7 +137,11 @@ endi
sql insert into t1 values(1648791223001,12,14,13,11.1);
sql insert into t1 values(1648791223001,12,14,13,11.1);
sleep 500
sleep 500
sql select `_wstartts`, c1, c2 ,c3 ,c4, c5 from streamt;
sql select * from streamt;
print count(*) , count(d) , sum(a) , max(b) , min(c)
print 0: $data00 , $data01 , $data02 , $data03 , $data04 , $data05
print 1: $data10 , $data11 , $data12 , $data13 , $data14 , $data15
if $rows != 4 then
if $rows != 4 then
print ======$rows
print ======$rows
...
...
tests/system-test/7-tmq/subscribeDb1.py
浏览文件 @
7e24be74
...
@@ -354,7 +354,7 @@ class TDTestCase:
...
@@ -354,7 +354,7 @@ class TDTestCase:
event
.
wait
()
event
.
wait
()
tdLog
.
info
(
"start consume processor"
)
tdLog
.
info
(
"start consume processor"
)
pollDelay
=
5
pollDelay
=
1
5
showMsg
=
1
showMsg
=
1
showRow
=
1
showRow
=
1
self
.
startTmqSimProcess
(
buildPath
,
cfgPath
,
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
)
self
.
startTmqSimProcess
(
buildPath
,
cfgPath
,
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录