Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6fcee0e2
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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,发现更多精彩内容 >>
提交
6fcee0e2
编写于
6月 10, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(tsdb): tsdb reader open
上级
73b8f02a
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
63 addition
and
52 deletion
+63
-52
include/common/tcommon.h
include/common/tcommon.h
+2
-0
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-0
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+18
-10
source/dnode/mnode/impl/src/mndDef.c
source/dnode/mnode/impl/src/mndDef.c
+3
-0
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+3
-1
source/dnode/mnode/impl/src/mndTopic.c
source/dnode/mnode/impl/src/mndTopic.c
+7
-14
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+11
-11
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+2
-2
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+3
-3
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+13
-11
未找到文件。
include/common/tcommon.h
浏览文件 @
6fcee0e2
...
@@ -116,6 +116,8 @@ typedef struct SQueryTableDataCond {
...
@@ -116,6 +116,8 @@ typedef struct SQueryTableDataCond {
int32_t
type
;
// data block load type:
int32_t
type
;
// data block load type:
int32_t
numOfTWindows
;
int32_t
numOfTWindows
;
STimeWindow
*
twindows
;
STimeWindow
*
twindows
;
int32_t
startVersion
;
int32_t
endVersion
;
}
SQueryTableDataCond
;
}
SQueryTableDataCond
;
void
*
blockDataDestroy
(
SSDataBlock
*
pBlock
);
void
*
blockDataDestroy
(
SSDataBlock
*
pBlock
);
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
6fcee0e2
...
@@ -484,6 +484,7 @@ typedef struct {
...
@@ -484,6 +484,7 @@ typedef struct {
int64_t
stbUid
;
int64_t
stbUid
;
SHashObj
*
consumerHash
;
// consumerId -> SMqConsumerEp
SHashObj
*
consumerHash
;
// consumerId -> SMqConsumerEp
SArray
*
unassignedVgs
;
// SArray<SMqVgEp*>
SArray
*
unassignedVgs
;
// SArray<SMqVgEp*>
char
dbName
[
TSDB_DB_FNAME_LEN
];
}
SMqSubscribeObj
;
}
SMqSubscribeObj
;
SMqSubscribeObj
*
tNewSubscribeObj
(
const
char
key
[
TSDB_SUBSCRIBE_KEY_LEN
]);
SMqSubscribeObj
*
tNewSubscribeObj
(
const
char
key
[
TSDB_SUBSCRIBE_KEY_LEN
]);
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
6fcee0e2
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#define MND_CONSUMER_LOST_HB_CNT 3
#define MND_CONSUMER_LOST_HB_CNT 3
static
int8_t
mqReb
Lock
=
0
;
static
int8_t
mqReb
InExecCnt
=
0
;
static
const
char
*
mndConsumerStatusName
(
int
status
);
static
const
char
*
mndConsumerStatusName
(
int
status
);
...
@@ -76,15 +76,15 @@ int32_t mndInitConsumer(SMnode *pMnode) {
...
@@ -76,15 +76,15 @@ int32_t mndInitConsumer(SMnode *pMnode) {
void
mndCleanupConsumer
(
SMnode
*
pMnode
)
{}
void
mndCleanupConsumer
(
SMnode
*
pMnode
)
{}
bool
mndRebTryStart
()
{
bool
mndRebTryStart
()
{
int8_t
old
=
atomic_val_compare_exchange_8
(
&
mqReb
Lock
,
0
,
1
);
int8_t
old
=
atomic_val_compare_exchange_8
(
&
mqReb
InExecCnt
,
0
,
1
);
return
old
==
0
;
return
old
==
0
;
}
}
void
mndRebEnd
()
{
atomic_sub_fetch_8
(
&
mqReb
Lock
,
1
);
}
void
mndRebEnd
()
{
atomic_sub_fetch_8
(
&
mqReb
InExecCnt
,
1
);
}
void
mndRebCntInc
()
{
atomic_add_fetch_8
(
&
mqReb
Lock
,
1
);
}
void
mndRebCntInc
()
{
atomic_add_fetch_8
(
&
mqReb
InExecCnt
,
1
);
}
void
mndRebCntDec
()
{
atomic_sub_fetch_8
(
&
mqReb
Lock
,
1
);
}
void
mndRebCntDec
()
{
atomic_sub_fetch_8
(
&
mqReb
InExecCnt
,
1
);
}
static
int32_t
mndProcessConsumerLostMsg
(
SRpcMsg
*
pMsg
)
{
static
int32_t
mndProcessConsumerLostMsg
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
...
@@ -92,7 +92,6 @@ static int32_t mndProcessConsumerLostMsg(SRpcMsg *pMsg) {
...
@@ -92,7 +92,6 @@ static int32_t mndProcessConsumerLostMsg(SRpcMsg *pMsg) {
SMqConsumerObj
*
pConsumer
=
mndAcquireConsumer
(
pMnode
,
pLostMsg
->
consumerId
);
SMqConsumerObj
*
pConsumer
=
mndAcquireConsumer
(
pMnode
,
pLostMsg
->
consumerId
);
ASSERT
(
pConsumer
);
ASSERT
(
pConsumer
);
mInfo
(
"receive consumer lost msg, consumer id %ld, status %s"
,
pLostMsg
->
consumerId
,
mInfo
(
"receive consumer lost msg, consumer id %ld, status %s"
,
pLostMsg
->
consumerId
,
mndConsumerStatusName
(
pConsumer
->
status
));
mndConsumerStatusName
(
pConsumer
->
status
));
...
@@ -106,7 +105,7 @@ static int32_t mndProcessConsumerLostMsg(SRpcMsg *pMsg) {
...
@@ -106,7 +105,7 @@ static int32_t mndProcessConsumerLostMsg(SRpcMsg *pMsg) {
mndReleaseConsumer
(
pMnode
,
pConsumer
);
mndReleaseConsumer
(
pMnode
,
pConsumer
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_R
ETRY
,
TRN_CONFLICT_NOTHING
,
pMsg
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_R
OLLBACK
,
TRN_CONFLICT_NOTHING
,
pMsg
);
if
(
pTrans
==
NULL
)
goto
FAIL
;
if
(
pTrans
==
NULL
)
goto
FAIL
;
if
(
mndSetConsumerCommitLogs
(
pMnode
,
pTrans
,
pConsumerNew
)
!=
0
)
goto
FAIL
;
if
(
mndSetConsumerCommitLogs
(
pMnode
,
pTrans
,
pConsumerNew
)
!=
0
)
goto
FAIL
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
FAIL
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
FAIL
;
...
@@ -125,6 +124,14 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) {
...
@@ -125,6 +124,14 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) {
SMqConsumerObj
*
pConsumer
=
mndAcquireConsumer
(
pMnode
,
pRecoverMsg
->
consumerId
);
SMqConsumerObj
*
pConsumer
=
mndAcquireConsumer
(
pMnode
,
pRecoverMsg
->
consumerId
);
ASSERT
(
pConsumer
);
ASSERT
(
pConsumer
);
mInfo
(
"receive consumer recover msg, consumer id %ld, status %s"
,
pRecoverMsg
->
consumerId
,
mndConsumerStatusName
(
pConsumer
->
status
));
if
(
pConsumer
->
status
!=
MQ_CONSUMER_STATUS__READY
)
{
mndReleaseConsumer
(
pMnode
,
pConsumer
);
return
-
1
;
}
SMqConsumerObj
*
pConsumerNew
=
tNewSMqConsumerObj
(
pConsumer
->
consumerId
,
pConsumer
->
cgroup
);
SMqConsumerObj
*
pConsumerNew
=
tNewSMqConsumerObj
(
pConsumer
->
consumerId
,
pConsumer
->
cgroup
);
pConsumerNew
->
updateType
=
CONSUMER_UPDATE__RECOVER
;
pConsumerNew
->
updateType
=
CONSUMER_UPDATE__RECOVER
;
...
@@ -844,10 +851,11 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
...
@@ -844,10 +851,11 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
topicSz
=
1
;
topicSz
=
1
;
}
}
for
(
int32_t
i
=
0
;
i
<
topicSz
;
i
++
)
{
if
(
numOfRows
+
topicSz
>
rowsCapacity
)
{
if
(
numOfRows
+
topicSz
>
rowsCapacity
)
{
blockDataEnsureCapacity
(
pBlock
,
numOfRows
+
topicSz
);
blockDataEnsureCapacity
(
pBlock
,
numOfRows
+
topicSz
);
}
}
for
(
int32_t
i
=
0
;
i
<
topicSz
;
i
++
)
{
SColumnInfoData
*
pColInfo
;
SColumnInfoData
*
pColInfo
;
int32_t
cols
=
0
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/src/mndDef.c
浏览文件 @
6fcee0e2
...
@@ -415,6 +415,7 @@ SMqSubscribeObj *tCloneSubscribeObj(const SMqSubscribeObj *pSub) {
...
@@ -415,6 +415,7 @@ SMqSubscribeObj *tCloneSubscribeObj(const SMqSubscribeObj *pSub) {
taosHashPut
(
pSubNew
->
consumerHash
,
&
newEp
.
consumerId
,
sizeof
(
int64_t
),
&
newEp
,
sizeof
(
SMqConsumerEp
));
taosHashPut
(
pSubNew
->
consumerHash
,
&
newEp
.
consumerId
,
sizeof
(
int64_t
),
&
newEp
,
sizeof
(
SMqConsumerEp
));
}
}
pSubNew
->
unassignedVgs
=
taosArrayDeepCopy
(
pSub
->
unassignedVgs
,
(
FCopy
)
tCloneSMqVgEp
);
pSubNew
->
unassignedVgs
=
taosArrayDeepCopy
(
pSub
->
unassignedVgs
,
(
FCopy
)
tCloneSMqVgEp
);
memcpy
(
pSubNew
->
dbName
,
pSub
->
dbName
,
TSDB_DB_FNAME_LEN
);
return
pSubNew
;
return
pSubNew
;
}
}
...
@@ -445,6 +446,7 @@ int32_t tEncodeSubscribeObj(void **buf, const SMqSubscribeObj *pSub) {
...
@@ -445,6 +446,7 @@ int32_t tEncodeSubscribeObj(void **buf, const SMqSubscribeObj *pSub) {
}
}
ASSERT
(
cnt
==
sz
);
ASSERT
(
cnt
==
sz
);
tlen
+=
taosEncodeArray
(
buf
,
pSub
->
unassignedVgs
,
(
FEncode
)
tEncodeSMqVgEp
);
tlen
+=
taosEncodeArray
(
buf
,
pSub
->
unassignedVgs
,
(
FEncode
)
tEncodeSMqVgEp
);
tlen
+=
taosEncodeString
(
buf
,
pSub
->
dbName
);
return
tlen
;
return
tlen
;
}
}
...
@@ -467,6 +469,7 @@ void *tDecodeSubscribeObj(const void *buf, SMqSubscribeObj *pSub) {
...
@@ -467,6 +469,7 @@ void *tDecodeSubscribeObj(const void *buf, SMqSubscribeObj *pSub) {
}
}
buf
=
taosDecodeArray
(
buf
,
&
pSub
->
unassignedVgs
,
(
FDecode
)
tDecodeSMqVgEp
,
sizeof
(
SMqVgEp
));
buf
=
taosDecodeArray
(
buf
,
&
pSub
->
unassignedVgs
,
(
FDecode
)
tDecodeSMqVgEp
,
sizeof
(
SMqVgEp
));
buf
=
taosDecodeStringTo
(
buf
,
pSub
->
dbName
);
return
(
void
*
)
buf
;
return
(
void
*
)
buf
;
}
}
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
6fcee0e2
...
@@ -402,7 +402,8 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
...
@@ -402,7 +402,8 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
}
}
static
int32_t
mndPersistRebResult
(
SMnode
*
pMnode
,
SRpcMsg
*
pMsg
,
const
SMqRebOutputObj
*
pOutput
)
{
static
int32_t
mndPersistRebResult
(
SMnode
*
pMnode
,
SRpcMsg
*
pMsg
,
const
SMqRebOutputObj
*
pOutput
)
{
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_NOTHING
,
pMsg
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_DB_INSIDE
,
pMsg
);
mndTransSetDbName
(
pTrans
,
pOutput
->
pSub
->
dbName
);
if
(
pTrans
==
NULL
)
return
-
1
;
if
(
pTrans
==
NULL
)
return
-
1
;
// make txn:
// make txn:
...
@@ -547,6 +548,7 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
...
@@ -547,6 +548,7 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
taosRLockLatch
(
&
pTopic
->
lock
);
taosRLockLatch
(
&
pTopic
->
lock
);
rebOutput
.
pSub
=
mndCreateSub
(
pMnode
,
pTopic
,
pRebInfo
->
key
);
rebOutput
.
pSub
=
mndCreateSub
(
pMnode
,
pTopic
,
pRebInfo
->
key
);
memcpy
(
rebOutput
.
pSub
->
dbName
,
pTopic
->
db
,
TSDB_DB_FNAME_LEN
);
ASSERT
(
taosHashGetSize
(
rebOutput
.
pSub
->
consumerHash
)
==
0
);
ASSERT
(
taosHashGetSize
(
rebOutput
.
pSub
->
consumerHash
)
==
0
);
taosRUnLockLatch
(
&
pTopic
->
lock
);
taosRUnLockLatch
(
&
pTopic
->
lock
);
...
...
source/dnode/mnode/impl/src/mndTopic.c
浏览文件 @
6fcee0e2
...
@@ -87,29 +87,21 @@ int32_t mndCheckColAndTagModifiable(SMnode *pMnode, int64_t suid, col_id_t colId
...
@@ -87,29 +87,21 @@ int32_t mndCheckColAndTagModifiable(SMnode *pMnode, int64_t suid, col_id_t colId
SNode
*
pAst
=
NULL
;
SNode
*
pAst
=
NULL
;
if
(
nodesStringToNode
(
pTopic
->
ast
,
&
pAst
)
!=
0
)
{
if
(
nodesStringToNode
(
pTopic
->
ast
,
&
pAst
)
!=
0
)
{
ASSERT
(
0
);
ASSERT
(
0
);
return
false
;
return
-
1
;
}
}
SHashObj
*
pColHash
=
NULL
;
SNodeList
*
pNodeList
=
NULL
;
SNodeList
*
pNodeList
=
NULL
;
nodesCollectColumns
((
SSelectStmt
*
)
pAst
,
SQL_CLAUSE_FROM
,
NULL
,
COLLECT_COL_TYPE_ALL
,
&
pNodeList
);
nodesCollectColumns
((
SSelectStmt
*
)
pAst
,
SQL_CLAUSE_FROM
,
NULL
,
COLLECT_COL_TYPE_ALL
,
&
pNodeList
);
SNode
*
pNode
=
NULL
;
SNode
*
pNode
=
NULL
;
FOREACH
(
pNode
,
pNodeList
)
{
FOREACH
(
pNode
,
pNodeList
)
{
SColumnNode
*
pCol
=
(
SColumnNode
*
)
pNode
;
SColumnNode
*
pCol
=
(
SColumnNode
*
)
pNode
;
if
(
pCol
->
tableId
!=
suid
)
goto
NEXT
;
if
(
pCol
->
tableId
!=
suid
)
goto
NEXT
;
if
(
pColHash
==
NULL
)
{
if
(
pCol
->
colId
>
0
&&
pCol
->
colId
==
colId
)
{
pColHash
=
taosHashInit
(
0
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_SMALLINT
),
false
,
HASH_NO_LOCK
);
}
if
(
pCol
->
colId
>
0
)
{
taosHashPut
(
pColHash
,
&
pCol
->
colId
,
sizeof
(
int16_t
),
NULL
,
0
);
}
mTrace
(
"topic:%s, colId:%d is used"
,
pTopic
->
name
,
pCol
->
colId
);
}
if
(
taosHashGet
(
pColHash
,
&
colId
,
sizeof
(
int16_t
))
!=
NULL
)
{
found
=
true
;
found
=
true
;
goto
NEXT
;
goto
NEXT
;
}
}
mTrace
(
"topic:%s, colId:%d is used"
,
pTopic
->
name
,
pCol
->
colId
);
}
NEXT:
NEXT:
sdbRelease
(
pSdb
,
pTopic
);
sdbRelease
(
pSdb
,
pTopic
);
...
@@ -563,7 +555,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
...
@@ -563,7 +555,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
mndReleaseConsumer
(
pMnode
,
pConsumer
);
mndReleaseConsumer
(
pMnode
,
pConsumer
);
mndReleaseTopic
(
pMnode
,
pTopic
);
mndReleaseTopic
(
pMnode
,
pTopic
);
terrno
=
TSDB_CODE_MND_TOPIC_SUBSCRIBED
;
terrno
=
TSDB_CODE_MND_TOPIC_SUBSCRIBED
;
mError
(
"topic:%s, failed to drop since subscribed by consumer %ld
from c
group %s"
,
dropReq
.
name
,
mError
(
"topic:%s, failed to drop since subscribed by consumer %ld
in consumer
group %s"
,
dropReq
.
name
,
pConsumer
->
consumerId
,
pConsumer
->
cgroup
);
pConsumer
->
consumerId
,
pConsumer
->
cgroup
);
return
-
1
;
return
-
1
;
}
}
...
@@ -580,7 +572,8 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
...
@@ -580,7 +572,8 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
}
}
#endif
#endif
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_NOTHING
,
pReq
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_DB_INSIDE
,
pReq
);
mndTransSetDbName
(
pTrans
,
pTopic
->
db
);
if
(
pTrans
==
NULL
)
{
if
(
pTrans
==
NULL
)
{
mError
(
"topic:%s, failed to drop since %s"
,
pTopic
->
name
,
terrstr
());
mError
(
"topic:%s, failed to drop since %s"
,
pTopic
->
name
,
terrstr
());
return
-
1
;
return
-
1
;
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
6fcee0e2
...
@@ -89,7 +89,7 @@ typedef struct SMetaFltParam {
...
@@ -89,7 +89,7 @@ typedef struct SMetaFltParam {
tb_uid_t
suid
;
tb_uid_t
suid
;
int16_t
cid
;
int16_t
cid
;
int16_t
type
;
int16_t
type
;
char
*
val
;
char
*
val
;
bool
reverse
;
bool
reverse
;
int
(
*
filterFunc
)(
void
*
a
,
void
*
b
,
int16_t
type
);
int
(
*
filterFunc
)(
void
*
a
,
void
*
b
,
int16_t
type
);
...
@@ -116,7 +116,7 @@ typedef void *tsdbReaderT;
...
@@ -116,7 +116,7 @@ typedef void *tsdbReaderT;
#define BLOCK_LOAD_TABLE_SEQ_ORDER 2
#define BLOCK_LOAD_TABLE_SEQ_ORDER 2
#define BLOCK_LOAD_TABLE_RR_ORDER 3
#define BLOCK_LOAD_TABLE_RR_ORDER 3
tsdbReaderT
*
tsdb
QueryTables
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableInfoGroup
,
uint64_t
qId
,
tsdbReaderT
*
tsdb
ReaderOpen
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableInfoGroup
,
uint64_t
qId
,
uint64_t
taskId
);
uint64_t
taskId
);
tsdbReaderT
tsdbQueryCacheLast
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
groupList
,
uint64_t
qId
,
tsdbReaderT
tsdbQueryCacheLast
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
groupList
,
uint64_t
qId
,
void
*
pMemRef
);
void
*
pMemRef
);
...
@@ -124,8 +124,8 @@ int32_t tsdbGetFileBlocksDistInfo(tsdbReaderT *pReader, STableBlockDistInfo
...
@@ -124,8 +124,8 @@ int32_t tsdbGetFileBlocksDistInfo(tsdbReaderT *pReader, STableBlockDistInfo
bool
isTsdbCacheLastRow
(
tsdbReaderT
*
pReader
);
bool
isTsdbCacheLastRow
(
tsdbReaderT
*
pReader
);
int32_t
tsdbGetAllTableList
(
SMeta
*
pMeta
,
uint64_t
uid
,
SArray
*
list
);
int32_t
tsdbGetAllTableList
(
SMeta
*
pMeta
,
uint64_t
uid
,
SArray
*
list
);
int32_t
tsdbGetCtbIdList
(
SMeta
*
pMeta
,
int64_t
suid
,
SArray
*
list
);
int32_t
tsdbGetCtbIdList
(
SMeta
*
pMeta
,
int64_t
suid
,
SArray
*
list
);
void
*
tsdbGetIdx
(
SMeta
*
pMeta
);
void
*
tsdbGetIdx
(
SMeta
*
pMeta
);
void
*
tsdbGetIvtIdx
(
SMeta
*
pMeta
);
void
*
tsdbGetIvtIdx
(
SMeta
*
pMeta
);
int64_t
tsdbGetNumOfRowsInMemTable
(
tsdbReaderT
*
pHandle
);
int64_t
tsdbGetNumOfRowsInMemTable
(
tsdbReaderT
*
pHandle
);
bool
tsdbNextDataBlock
(
tsdbReaderT
pTsdbReadHandle
);
bool
tsdbNextDataBlock
(
tsdbReaderT
pTsdbReadHandle
);
...
@@ -201,7 +201,7 @@ struct SMetaEntry {
...
@@ -201,7 +201,7 @@ struct SMetaEntry {
int64_t
version
;
int64_t
version
;
int8_t
type
;
int8_t
type
;
tb_uid_t
uid
;
tb_uid_t
uid
;
char
*
name
;
char
*
name
;
union
{
union
{
struct
{
struct
{
SSchemaWrapper
schemaRow
;
SSchemaWrapper
schemaRow
;
...
@@ -229,17 +229,17 @@ struct SMetaEntry {
...
@@ -229,17 +229,17 @@ struct SMetaEntry {
struct
SMetaReader
{
struct
SMetaReader
{
int32_t
flags
;
int32_t
flags
;
SMeta
*
pMeta
;
SMeta
*
pMeta
;
SDecoder
coder
;
SDecoder
coder
;
SMetaEntry
me
;
SMetaEntry
me
;
void
*
pBuf
;
void
*
pBuf
;
int32_t
szBuf
;
int32_t
szBuf
;
};
};
struct
SMTbCursor
{
struct
SMTbCursor
{
TBC
*
pDbc
;
TBC
*
pDbc
;
void
*
pKey
;
void
*
pKey
;
void
*
pVal
;
void
*
pVal
;
int32_t
kLen
;
int32_t
kLen
;
int32_t
vLen
;
int32_t
vLen
;
SMetaReader
mr
;
SMetaReader
mr
;
...
...
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
6fcee0e2
...
@@ -119,7 +119,7 @@ int tsdbInsertData(STsdb* pTsdb, int64_t version, SSubmitReq* pMsg, SSu
...
@@ -119,7 +119,7 @@ int tsdbInsertData(STsdb* pTsdb, int64_t version, SSubmitReq* pMsg, SSu
int32_t
tsdbInsertTableData
(
STsdb
*
pTsdb
,
int64_t
version
,
SSubmitMsgIter
*
pMsgIter
,
SSubmitBlk
*
pBlock
,
int32_t
tsdbInsertTableData
(
STsdb
*
pTsdb
,
int64_t
version
,
SSubmitMsgIter
*
pMsgIter
,
SSubmitBlk
*
pBlock
,
SSubmitBlkRsp
*
pRsp
);
SSubmitBlkRsp
*
pRsp
);
int32_t
tsdbDeleteTableData
(
STsdb
*
pTsdb
,
int64_t
version
,
tb_uid_t
suid
,
tb_uid_t
uid
,
TSKEY
sKey
,
TSKEY
eKey
);
int32_t
tsdbDeleteTableData
(
STsdb
*
pTsdb
,
int64_t
version
,
tb_uid_t
suid
,
tb_uid_t
uid
,
TSKEY
sKey
,
TSKEY
eKey
);
tsdbReaderT
*
tsdb
QueryTables
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableList
,
uint64_t
qId
,
tsdbReaderT
*
tsdb
ReaderOpen
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableList
,
uint64_t
qId
,
uint64_t
taskId
);
uint64_t
taskId
);
tsdbReaderT
tsdbQueryCacheLastT
(
STsdb
*
tsdb
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableList
,
uint64_t
qId
,
tsdbReaderT
tsdbQueryCacheLastT
(
STsdb
*
tsdb
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableList
,
uint64_t
qId
,
void
*
pMemRef
);
void
*
pMemRef
);
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
6fcee0e2
...
@@ -500,7 +500,7 @@ static int32_t setCurrentSchema(SVnode* pVnode, STsdbReadHandle* pTsdbReadHandle
...
@@ -500,7 +500,7 @@ static int32_t setCurrentSchema(SVnode* pVnode, STsdbReadHandle* pTsdbReadHandle
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
tsdbReaderT
*
tsdb
QueryTables
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableList
,
uint64_t
qId
,
tsdbReaderT
*
tsdb
ReaderOpen
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableList
,
uint64_t
qId
,
uint64_t
taskId
)
{
uint64_t
taskId
)
{
STsdbReadHandle
*
pTsdbReadHandle
=
tsdbQueryTablesImpl
(
pVnode
,
pCond
,
qId
,
taskId
);
STsdbReadHandle
*
pTsdbReadHandle
=
tsdbQueryTablesImpl
(
pVnode
,
pCond
,
qId
,
taskId
);
if
(
pTsdbReadHandle
==
NULL
)
{
if
(
pTsdbReadHandle
==
NULL
)
{
...
@@ -642,7 +642,7 @@ tsdbReaderT tsdbQueryLastRow(SVnode* pVnode, SQueryTableDataCond* pCond, STableL
...
@@ -642,7 +642,7 @@ tsdbReaderT tsdbQueryLastRow(SVnode* pVnode, SQueryTableDataCond* pCond, STableL
return
NULL
;
return
NULL
;
}
}
STsdbReadHandle
*
pTsdbReadHandle
=
(
STsdbReadHandle
*
)
tsdb
QueryTables
(
pVnode
,
pCond
,
pList
,
qId
,
taskId
);
STsdbReadHandle
*
pTsdbReadHandle
=
(
STsdbReadHandle
*
)
tsdb
ReaderOpen
(
pVnode
,
pCond
,
pList
,
qId
,
taskId
);
if
(
pTsdbReadHandle
==
NULL
)
{
if
(
pTsdbReadHandle
==
NULL
)
{
return
NULL
;
return
NULL
;
}
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
6fcee0e2
...
@@ -2010,9 +2010,9 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprI
...
@@ -2010,9 +2010,9 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprI
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
slotId
);
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
slotId
);
char
*
in
=
GET_ROWCELL_INTERBUF
(
pCtx
[
j
].
resultInfo
);
char
*
in
=
GET_ROWCELL_INTERBUF
(
pCtx
[
j
].
resultInfo
);
if
(
pCtx
[
j
].
increase
)
{
if
(
pCtx
[
j
].
increase
)
{
int64_t
ts
=
*
(
int64_t
*
)
in
;
int64_t
ts
=
*
(
int64_t
*
)
in
;
for
(
int32_t
k
=
0
;
k
<
pRow
->
numOfRows
;
++
k
)
{
for
(
int32_t
k
=
0
;
k
<
pRow
->
numOfRows
;
++
k
)
{
colDataAppend
(
pColInfoData
,
pBlock
->
info
.
rows
+
k
,
(
const
char
*
)
&
ts
,
pCtx
[
j
].
resultInfo
->
isNullRes
);
colDataAppend
(
pColInfoData
,
pBlock
->
info
.
rows
+
k
,
(
const
char
*
)
&
ts
,
pCtx
[
j
].
resultInfo
->
isNullRes
);
ts
++
;
ts
++
;
}
}
}
else
{
}
else
{
...
@@ -3112,8 +3112,8 @@ static SSDataBlock* doMerge(SOperatorInfo* pOperator) {
...
@@ -3112,8 +3112,8 @@ static SSDataBlock* doMerge(SOperatorInfo* pOperator) {
return
(
pInfo
->
binfo
.
pRes
->
info
.
rows
>
0
)
?
pInfo
->
binfo
.
pRes
:
NULL
;
return
(
pInfo
->
binfo
.
pRes
->
info
.
rows
>
0
)
?
pInfo
->
binfo
.
pRes
:
NULL
;
}
}
SSDataBlock
*
getSortedMergeBlockData
(
SSortHandle
*
pHandle
,
SSDataBlock
*
pDataBlock
,
int32_t
capacity
,
SArray
*
pColMatchInfo
,
SSDataBlock
*
getSortedMergeBlockData
(
SSortHandle
*
pHandle
,
SSDataBlock
*
pDataBlock
,
int32_t
capacity
,
SSortedMergeOperatorInfo
*
pInfo
)
{
SArray
*
pColMatchInfo
,
SSortedMergeOperatorInfo
*
pInfo
)
{
blockDataCleanup
(
pDataBlock
);
blockDataCleanup
(
pDataBlock
);
SSDataBlock
*
p
=
tsortGetSortedDataBlock
(
pHandle
);
SSDataBlock
*
p
=
tsortGetSortedDataBlock
(
pHandle
);
...
@@ -4686,7 +4686,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4686,7 +4686,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
int32_t
tsSlotId
=
((
SColumnNode
*
)
pIntervalPhyNode
->
window
.
pTspk
)
->
slotId
;
int32_t
tsSlotId
=
((
SColumnNode
*
)
pIntervalPhyNode
->
window
.
pTspk
)
->
slotId
;
bool
isStream
=
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL
==
type
);
bool
isStream
=
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL
==
type
);
pOptr
=
createIntervalOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pResBlock
,
&
interval
,
tsSlotId
,
&
as
,
pTaskInfo
,
isStream
);
pOptr
=
createIntervalOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pResBlock
,
&
interval
,
tsSlotId
,
&
as
,
pTaskInfo
,
isStream
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL
==
type
)
{
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL
==
type
)
{
int32_t
children
=
8
;
int32_t
children
=
8
;
...
@@ -5067,7 +5068,7 @@ tsdbReaderT doCreateDataReader(STableScanPhysiNode* pTableScanNode, SReadHandle*
...
@@ -5067,7 +5068,7 @@ tsdbReaderT doCreateDataReader(STableScanPhysiNode* pTableScanNode, SReadHandle*
goto
_error
;
goto
_error
;
}
}
return
tsdb
QueryTables
(
pHandle
->
vnode
,
&
cond
,
pTableListInfo
,
queryId
,
taskId
);
return
tsdb
ReaderOpen
(
pHandle
->
vnode
,
&
cond
,
pTableListInfo
,
queryId
,
taskId
);
_error:
_error:
terrno
=
code
;
terrno
=
code
;
...
@@ -5349,7 +5350,8 @@ int32_t getOperatorExplainExecInfo(SOperatorInfo* operatorInfo, SExplainExecInfo
...
@@ -5349,7 +5350,8 @@ int32_t getOperatorExplainExecInfo(SOperatorInfo* operatorInfo, SExplainExecInfo
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
initStreamAggSupporter
(
SStreamAggSupporter
*
pSup
,
const
char
*
pKey
,
SqlFunctionCtx
*
pCtx
,
int32_t
numOfOutput
,
size_t
size
)
{
int32_t
initStreamAggSupporter
(
SStreamAggSupporter
*
pSup
,
const
char
*
pKey
,
SqlFunctionCtx
*
pCtx
,
int32_t
numOfOutput
,
size_t
size
)
{
pSup
->
resultRowSize
=
getResultRowSize
(
pCtx
,
numOfOutput
);
pSup
->
resultRowSize
=
getResultRowSize
(
pCtx
,
numOfOutput
);
pSup
->
keySize
=
sizeof
(
int64_t
)
+
sizeof
(
TSKEY
);
pSup
->
keySize
=
sizeof
(
int64_t
)
+
sizeof
(
TSKEY
);
pSup
->
pKeyBuf
=
taosMemoryCalloc
(
1
,
pSup
->
keySize
);
pSup
->
pKeyBuf
=
taosMemoryCalloc
(
1
,
pSup
->
keySize
);
...
@@ -5370,7 +5372,7 @@ int32_t initStreamAggSupporter(SStreamAggSupporter* pSup, const char* pKey, SqlF
...
@@ -5370,7 +5372,7 @@ int32_t initStreamAggSupporter(SStreamAggSupporter* pSup, const char* pKey, SqlF
bufSize
=
pageSize
*
4
;
bufSize
=
pageSize
*
4
;
}
}
int32_t
code
=
createDiskbasedBuf
(
&
pSup
->
pResultBuf
,
pageSize
,
bufSize
,
pKey
,
TD_TMP_DIR_PATH
);
int32_t
code
=
createDiskbasedBuf
(
&
pSup
->
pResultBuf
,
pageSize
,
bufSize
,
pKey
,
TD_TMP_DIR_PATH
);
for
(
int32_t
i
=
0
;
i
<
numOfOutput
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfOutput
;
++
i
)
{
pCtx
[
i
].
pBuf
=
pSup
->
pResultBuf
;
pCtx
[
i
].
pBuf
=
pSup
->
pResultBuf
;
}
}
return
code
;
return
code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录