Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c5854b83
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
未验证
提交
c5854b83
编写于
2月 21, 2022
作者:
L
Liu Jicong
提交者:
GitHub
2月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10331 from taosdata/feature/tq
extract convert to set msg
上级
83712ffd
925a9fbd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
20 deletion
+40
-20
include/util/tdef.h
include/util/tdef.h
+2
-0
source/client/src/tmq.c
source/client/src/tmq.c
+2
-4
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-0
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+3
-3
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+24
-9
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+7
-4
未找到文件。
include/util/tdef.h
浏览文件 @
c5854b83
...
...
@@ -333,6 +333,8 @@ do { \
#define TSDB_QUERY_TYPE_NON_TYPE 0x00u // none type
#define TSDB_QUERY_TYPE_FREE_RESOURCE 0x01u // free qhandle at vnode
#define TSDB_QUERY_TYPE_NON_TYPE 0x00u // none type
#define TSDB_QUERY_TYPE_FREE_RESOURCE 0x01u // free qhandle at vnode
#define TSDB_META_COMPACT_RATIO 0 // disable tsdb meta compact by default
...
...
source/client/src/tmq.c
浏览文件 @
c5854b83
...
...
@@ -75,7 +75,7 @@ struct tmq_message_t {
SMqConsumeRsp
rsp
;
};
typedef
struct
SMqClientVg
{
typedef
struct
{
// statistics
int64_t
pollCnt
;
// offset
...
...
@@ -86,7 +86,7 @@ typedef struct SMqClientVg {
SEpSet
epSet
;
}
SMqClientVg
;
typedef
struct
SMqClientTopic
{
typedef
struct
{
// subscribe info
int32_t
sqlLen
;
char
*
sql
;
...
...
@@ -779,11 +779,9 @@ tmq_message_t* tmq_consumer_poll(tmq_t* tmq, int64_t blocking_time) {
param
->
pVg
=
pVg
;
tsem_init
(
&
param
->
rspSem
,
0
,
0
);
SRequestObj
*
pRequest
=
createRequest
(
tmq
->
pTscObj
,
NULL
,
NULL
,
TDMT_VND_CONSUME
);
pRequest
->
body
.
requestMsg
=
(
SDataBuf
){.
pData
=
pReq
,
.
len
=
sizeof
(
SMqConsumeReq
),
.
handle
=
NULL
};
SMsgSendInfo
*
sendInfo
=
buildMsgInfoImpl
(
pRequest
);
sendInfo
->
requestObjRefId
=
0
;
sendInfo
->
param
=
param
;
...
...
source/common/src/tmsg.c
浏览文件 @
c5854b83
...
...
@@ -34,6 +34,7 @@ int32_t tInitSubmitMsgIter(SSubmitReq *pMsg, SSubmitMsgIter *pIter) {
}
pIter
->
totalLen
=
pMsg
->
length
;
ASSERT
(
pIter
->
totalLen
>
0
);
pIter
->
len
=
0
;
pIter
->
pMsg
=
pMsg
;
if
(
pMsg
->
length
<=
sizeof
(
SSubmitReq
))
{
...
...
@@ -52,6 +53,7 @@ int32_t tGetSubmitMsgNext(SSubmitMsgIter *pIter, SSubmitBlk **pPBlock) {
}
else
{
SSubmitBlk
*
pSubmitBlk
=
(
SSubmitBlk
*
)
POINTER_SHIFT
(
pIter
->
pMsg
,
pIter
->
len
);
pIter
->
len
+=
(
sizeof
(
SSubmitBlk
)
+
pSubmitBlk
->
dataLen
+
pSubmitBlk
->
schemaLen
);
ASSERT
(
pIter
->
len
>
0
);
}
if
(
pIter
->
len
>
pIter
->
totalLen
)
{
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
c5854b83
...
...
@@ -226,9 +226,9 @@ static FORCE_INLINE int tqReadHandleSetTbUidList(STqReadHandle *pHandle, const S
return
0
;
}
void
tqReadHandleSetMsg
(
STqReadHandle
*
pHandle
,
SSubmitReq
*
pMsg
,
int64_t
ver
);
bool
tqNextDataBlock
(
STqReadHandle
*
pHandle
);
int
tqRetrieveDataBlockInfo
(
STqReadHandle
*
pHandle
,
SDataBlockInfo
*
pBlockInfo
);
int32_t
tqReadHandleSetMsg
(
STqReadHandle
*
pHandle
,
SSubmitReq
*
pMsg
,
int64_t
ver
);
bool
tqNextDataBlock
(
STqReadHandle
*
pHandle
);
int
tqRetrieveDataBlockInfo
(
STqReadHandle
*
pHandle
,
SDataBlockInfo
*
pBlockInfo
);
// return SArray<SColumnInfoData>
SArray
*
tqRetrieveDataBlock
(
STqReadHandle
*
pHandle
);
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
c5854b83
...
...
@@ -31,13 +31,28 @@ STqReadHandle* tqInitSubmitMsgScanner(SMeta* pMeta) {
return
pReadHandle
;
}
void
tqReadHandleSetMsg
(
STqReadHandle
*
pReadHandle
,
SSubmitReq
*
pMsg
,
int64_t
ver
)
{
int32_t
tqReadHandleSetMsg
(
STqReadHandle
*
pReadHandle
,
SSubmitReq
*
pMsg
,
int64_t
ver
)
{
pReadHandle
->
pMsg
=
pMsg
;
pMsg
->
length
=
htonl
(
pMsg
->
length
);
pMsg
->
numOfBlocks
=
htonl
(
pMsg
->
numOfBlocks
);
tInitSubmitMsgIter
(
pMsg
,
&
pReadHandle
->
msgIter
);
if
(
tInitSubmitMsgIter
(
pMsg
,
&
pReadHandle
->
msgIter
)
<
0
)
return
-
1
;
while
(
true
)
{
if
(
tGetSubmitMsgNext
(
&
pReadHandle
->
msgIter
,
&
pReadHandle
->
pBlock
)
<
0
)
return
-
1
;
if
(
pReadHandle
->
pBlock
==
NULL
)
break
;
pReadHandle
->
pBlock
->
uid
=
htobe64
(
pReadHandle
->
pBlock
->
uid
);
pReadHandle
->
pBlock
->
tid
=
htonl
(
pReadHandle
->
pBlock
->
tid
);
pReadHandle
->
pBlock
->
sversion
=
htonl
(
pReadHandle
->
pBlock
->
sversion
);
pReadHandle
->
pBlock
->
dataLen
=
htonl
(
pReadHandle
->
pBlock
->
dataLen
);
pReadHandle
->
pBlock
->
schemaLen
=
htonl
(
pReadHandle
->
pBlock
->
schemaLen
);
pReadHandle
->
pBlock
->
numOfRows
=
htons
(
pReadHandle
->
pBlock
->
numOfRows
);
}
if
(
tInitSubmitMsgIter
(
pMsg
,
&
pReadHandle
->
msgIter
)
<
0
)
return
-
1
;
pReadHandle
->
ver
=
ver
;
memset
(
&
pReadHandle
->
blkIter
,
0
,
sizeof
(
SSubmitBlkIter
));
return
0
;
}
bool
tqNextDataBlock
(
STqReadHandle
*
pHandle
)
{
...
...
@@ -47,19 +62,19 @@ bool tqNextDataBlock(STqReadHandle* pHandle) {
}
if
(
pHandle
->
pBlock
==
NULL
)
return
false
;
pHandle
->
pBlock
->
uid
=
htobe64
(
pHandle
->
pBlock
->
uid
);
/*pHandle->pBlock->uid = htobe64(pHandle->pBlock->uid);*/
/*if (pHandle->tbUid == pHandle->pBlock->uid) {*/
ASSERT
(
pHandle
->
tbIdHash
);
void
*
ret
=
taosHashGet
(
pHandle
->
tbIdHash
,
&
pHandle
->
pBlock
->
uid
,
sizeof
(
int64_t
));
if
(
ret
!=
NULL
)
{
/*printf("retrieve one tb %ld\n", pHandle->pBlock->uid);*/
pHandle
->
pBlock
->
tid
=
htonl
(
pHandle
->
pBlock
->
tid
);
pHandle
->
pBlock
->
sversion
=
htonl
(
pHandle
->
pBlock
->
sversion
);
pHandle
->
pBlock
->
dataLen
=
htonl
(
pHandle
->
pBlock
->
dataLen
);
pHandle
->
pBlock
->
schemaLen
=
htonl
(
pHandle
->
pBlock
->
schemaLen
);
pHandle
->
pBlock
->
numOfRows
=
htons
(
pHandle
->
pBlock
->
numOfRows
);
/*pHandle->pBlock->tid = htonl(pHandle->pBlock->tid);*/
/*pHandle->pBlock->sversion = htonl(pHandle->pBlock->sversion);*/
/*pHandle->pBlock->dataLen = htonl(pHandle->pBlock->dataLen);*/
/*pHandle->pBlock->schemaLen = htonl(pHandle->pBlock->schemaLen);*/
/*pHandle->pBlock->numOfRows = htons(pHandle->pBlock->numOfRows);*/
return
true
;
}
else
{
/*} else {*/
/*printf("skip one tb %ld\n", pHandle->pBlock->uid);*/
}
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
c5854b83
...
...
@@ -14,9 +14,9 @@
*/
#include "executor.h"
#include "tq.h"
#include "executorimpl.h"
#include "planner.h"
#include "tq.h"
static
int32_t
doSetStreamBlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
char
*
id
)
{
ASSERT
(
pOperator
!=
NULL
);
...
...
@@ -34,7 +34,10 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, char* id)
return
doSetStreamBlock
(
pOperator
->
pDownstream
[
0
],
input
,
id
);
}
else
{
SStreamBlockScanInfo
*
pInfo
=
pOperator
->
info
;
tqReadHandleSetMsg
(
pInfo
->
readerHandle
,
input
,
0
);
if
(
tqReadHandleSetMsg
(
pInfo
->
readerHandle
,
input
,
0
)
<
0
)
{
qError
(
"submit msg error while set stream msg, %s"
PRIx64
,
id
);
return
TSDB_CODE_QRY_APP_ERROR
;
}
return
TSDB_CODE_SUCCESS
;
}
}
...
...
@@ -48,9 +51,9 @@ int32_t qSetStreamInput(qTaskInfo_t tinfo, const void* input) {
return
TSDB_CODE_SUCCESS
;
}
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
int32_t
code
=
doSetStreamBlock
(
pTaskInfo
->
pRoot
,
(
void
*
)
input
,
GET_TASKID
(
pTaskInfo
));
int32_t
code
=
doSetStreamBlock
(
pTaskInfo
->
pRoot
,
(
void
*
)
input
,
GET_TASKID
(
pTaskInfo
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"%s failed to set the stream block data"
,
GET_TASKID
(
pTaskInfo
));
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录