Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
91f9b58f
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
91f9b58f
编写于
4月 27, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
17a5691a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
32 deletion
+27
-32
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+16
-21
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-2
source/dnode/vnode/src/tq/tqMeta.c
source/dnode/vnode/src/tq/tqMeta.c
+2
-2
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+2
-2
source/dnode/vnode/src/tq/tqScan.c
source/dnode/vnode/src/tq/tqScan.c
+2
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+3
-3
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
91f9b58f
...
...
@@ -175,11 +175,8 @@ typedef struct STsdbReader STsdbReader;
#define CACHESCAN_RETRIEVE_LAST_ROW 0x4
#define CACHESCAN_RETRIEVE_LAST 0x8
int32_t
tsdbSetTableList
(
STsdbReader
*
pReader
,
const
void
*
pTableList
,
int32_t
num
);
int32_t
tsdbReaderOpen
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
void
*
pTableList
,
int32_t
numOfTables
,
SSDataBlock
*
pResBlock
,
STsdbReader
**
ppReader
,
const
char
*
idstr
,
bool
countOnly
);
void
tsdbReaderSetId
(
STsdbReader
*
pReader
,
const
char
*
idstr
);
int32_t
tsdbReaderOpen
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
void
*
pTableList
,
int32_t
numOfTables
,
SSDataBlock
*
pResBlock
,
STsdbReader
**
ppReader
,
const
char
*
idstr
,
bool
countOnly
);
void
tsdbReaderClose
(
STsdbReader
*
pReader
);
int32_t
tsdbNextDataBlock
(
STsdbReader
*
pReader
,
bool
*
hasNext
);
int32_t
tsdbRetrieveDatablockSMA
(
STsdbReader
*
pReader
,
SSDataBlock
*
pDataBlock
,
bool
*
allHave
);
...
...
@@ -190,7 +187,10 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader *pReader, STableBlockDistInfo
int64_t
tsdbGetNumOfRowsInMemTable
(
STsdbReader
*
pHandle
);
void
*
tsdbGetIdx
(
SMeta
*
pMeta
);
void
*
tsdbGetIvtIdx
(
SMeta
*
pMeta
);
uint64_t
getReaderMaxVersion
(
STsdbReader
*
pReader
);
uint64_t
tsdbGetReaderMaxVersion
(
STsdbReader
*
pReader
);
int32_t
tsdbSetTableList
(
STsdbReader
*
pReader
,
const
void
*
pTableList
,
int32_t
num
);
void
tsdbReaderSetId
(
STsdbReader
*
pReader
,
const
char
*
idstr
);
void
tsdbReaderSetCloseFlag
(
STsdbReader
*
pReader
);
int32_t
tsdbCacherowsReaderOpen
(
void
*
pVnode
,
int32_t
type
,
void
*
pTableIdList
,
int32_t
numOfTables
,
int32_t
numOfCols
,
uint64_t
suid
,
void
**
pReader
,
const
char
*
idstr
);
...
...
@@ -231,26 +231,21 @@ typedef struct SSnapContext {
}
SSnapContext
;
typedef
struct
STqReader
{
SPackedData
msg2
;
SSubmitReq2
submit
;
int32_t
nextBlk
;
int64_t
lastBlkUid
;
SWalReader
*
pWalReader
;
SMeta
*
pVnodeMeta
;
SHashObj
*
tbIdHash
;
SArray
*
pColIdList
;
// SArray<int16_t>
SPackedData
msg2
;
SSubmitReq2
submit
;
int32_t
nextBlk
;
int64_t
lastBlkUid
;
SWalReader
*
pWalReader
;
SMeta
*
pVnodeMeta
;
SHashObj
*
tbIdHash
;
SArray
*
pColIdList
;
// SArray<int16_t>
int32_t
cachedSchemaVer
;
int64_t
cachedSchemaSuid
;
SSchemaWrapper
*
pSchemaWrapper
;
STSchema
*
pSchema
;
}
STqReader
;
STqReader
*
tq
OpenReader
(
SVnode
*
pVnode
);
STqReader
*
tq
ReaderOpen
(
SVnode
*
pVnode
);
void
tqCloseReader
(
STqReader
*
);
void
tqReaderSetColIdList
(
STqReader
*
pReader
,
SArray
*
pColIdList
);
...
...
@@ -266,7 +261,7 @@ int32_t tqReaderSetSubmitMsg(STqReader *pReader, void *msgStr, int32_t msgLen, i
bool
tqNextBlockImpl
(
STqReader
*
pReader
);
bool
tqNextDataBlockFilterOut
(
STqReader
*
pReader
,
SHashObj
*
filterOutUids
);
int32_t
tqRetrieveDataBlock
(
SSDataBlock
*
pBlock
,
STqReader
*
pReader
,
SSubmitTbData
**
pSubmitTbDataRet
);
int32_t
tqRetrieveTaosxBlock
2
(
STqReader
*
pReader
,
SArray
*
blocks
,
SArray
*
schemas
,
SSubmitTbData
**
pSubmitTbDataRet
);
int32_t
tqRetrieveTaosxBlock
(
STqReader
*
pReader
,
SArray
*
blocks
,
SArray
*
schemas
,
SSubmitTbData
**
pSubmitTbDataRet
);
int32_t
vnodeEnqueueStreamMsg
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
91f9b58f
...
...
@@ -504,7 +504,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
pHandle
->
execHandle
.
pTqReader
=
qExtractReaderFromStreamScanner
(
scanner
);
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__DB
)
{
pHandle
->
pWalReader
=
walOpenReader
(
pVnode
->
pWal
,
NULL
);
pHandle
->
execHandle
.
pTqReader
=
tq
OpenReader
(
pVnode
);
pHandle
->
execHandle
.
pTqReader
=
tq
ReaderOpen
(
pVnode
);
pHandle
->
execHandle
.
execDb
.
pFilterOutTbUid
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_NO_LOCK
);
...
...
@@ -523,7 +523,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
int64_t
tbUid
=
*
(
int64_t
*
)
taosArrayGet
(
tbUidList
,
i
);
tqDebug
(
"vgId:%d, idx %d, uid:%"
PRId64
,
vgId
,
i
,
tbUid
);
}
pHandle
->
execHandle
.
pTqReader
=
tq
OpenReader
(
pVnode
);
pHandle
->
execHandle
.
pTqReader
=
tq
ReaderOpen
(
pVnode
);
tqReaderSetTbUidList
(
pHandle
->
execHandle
.
pTqReader
,
tbUidList
);
taosArrayDestroy
(
tbUidList
);
...
...
source/dnode/vnode/src/tq/tqMeta.c
浏览文件 @
91f9b58f
...
...
@@ -328,7 +328,7 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
}
}
else
if
(
handle
.
execHandle
.
subType
==
TOPIC_SUB_TYPE__DB
)
{
handle
.
pWalReader
=
walOpenReader
(
pTq
->
pVnode
->
pWal
,
NULL
);
handle
.
execHandle
.
pTqReader
=
tq
OpenReader
(
pTq
->
pVnode
);
handle
.
execHandle
.
pTqReader
=
tq
ReaderOpen
(
pTq
->
pVnode
);
buildSnapContext
(
reader
.
meta
,
reader
.
version
,
0
,
handle
.
execHandle
.
subType
,
handle
.
fetchMeta
,
(
SSnapContext
**
)(
&
reader
.
sContext
));
...
...
@@ -343,7 +343,7 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
int64_t
tbUid
=
*
(
int64_t
*
)
taosArrayGet
(
tbUidList
,
i
);
tqDebug
(
"vgId:%d, idx %d, uid:%"
PRId64
,
vgId
,
i
,
tbUid
);
}
handle
.
execHandle
.
pTqReader
=
tq
OpenReader
(
pTq
->
pVnode
);
handle
.
execHandle
.
pTqReader
=
tq
ReaderOpen
(
pTq
->
pVnode
);
tqReaderSetTbUidList
(
handle
.
execHandle
.
pTqReader
,
tbUidList
);
taosArrayDestroy
(
tbUidList
);
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
91f9b58f
...
...
@@ -249,7 +249,7 @@ END:
return
code
;
}
STqReader
*
tq
OpenReader
(
SVnode
*
pVnode
)
{
STqReader
*
tq
ReaderOpen
(
SVnode
*
pVnode
)
{
STqReader
*
pReader
=
taosMemoryCalloc
(
1
,
sizeof
(
STqReader
));
if
(
pReader
==
NULL
)
{
return
NULL
;
...
...
@@ -653,7 +653,7 @@ FAIL:
return
-
1
;
}
int32_t
tqRetrieveTaosxBlock
2
(
STqReader
*
pReader
,
SArray
*
blocks
,
SArray
*
schemas
,
SSubmitTbData
**
pSubmitTbDataRet
)
{
int32_t
tqRetrieveTaosxBlock
(
STqReader
*
pReader
,
SArray
*
blocks
,
SArray
*
schemas
,
SSubmitTbData
**
pSubmitTbDataRet
)
{
tqDebug
(
"tq reader retrieve data block %p, %d"
,
pReader
->
msg2
.
msgStr
,
pReader
->
nextBlk
);
SSubmitTbData
*
pSubmitTbData
=
taosArrayGet
(
pReader
->
submit
.
aSubmitTbData
,
pReader
->
nextBlk
);
...
...
source/dnode/vnode/src/tq/tqScan.c
浏览文件 @
91f9b58f
...
...
@@ -207,7 +207,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
taosArrayClear
(
pBlocks
);
taosArrayClear
(
pSchemas
);
SSubmitTbData
*
pSubmitTbDataRet
=
NULL
;
if
(
tqRetrieveTaosxBlock
2
(
pReader
,
pBlocks
,
pSchemas
,
&
pSubmitTbDataRet
)
<
0
)
{
if
(
tqRetrieveTaosxBlock
(
pReader
,
pBlocks
,
pSchemas
,
&
pSubmitTbDataRet
)
<
0
)
{
if
(
terrno
==
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
)
continue
;
}
if
(
pRsp
->
withTbName
)
{
...
...
@@ -266,7 +266,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
taosArrayClear
(
pBlocks
);
taosArrayClear
(
pSchemas
);
SSubmitTbData
*
pSubmitTbDataRet
=
NULL
;
if
(
tqRetrieveTaosxBlock
2
(
pReader
,
pBlocks
,
pSchemas
,
&
pSubmitTbDataRet
)
<
0
)
{
if
(
tqRetrieveTaosxBlock
(
pReader
,
pBlocks
,
pSchemas
,
&
pSubmitTbDataRet
)
<
0
)
{
if
(
terrno
==
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
)
continue
;
}
if
(
pRsp
->
withTbName
)
{
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
91f9b58f
...
...
@@ -1855,7 +1855,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
SSDataBlock
*
pSDB
=
doRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
pInfo
->
primaryTsIndex
,
&
pInfo
->
updateResIndex
);
if
(
pSDB
)
{
STableScanInfo
*
pTableScanInfo
=
pInfo
->
pTableScanOp
->
info
;
uint64_t
version
=
g
etReaderMaxVersion
(
pTableScanInfo
->
base
.
dataReader
);
uint64_t
version
=
tsdbG
etReaderMaxVersion
(
pTableScanInfo
->
base
.
dataReader
);
updateInfoSetScanRange
(
pInfo
->
pUpdateInfo
,
&
pTableScanInfo
->
base
.
cond
.
twindows
,
pInfo
->
groupId
,
version
);
pSDB
->
info
.
type
=
pInfo
->
scanMode
==
STREAM_SCAN_FROM_DATAREADER_RANGE
?
STREAM_NORMAL
:
STREAM_PULL_DATA
;
checkUpdateData
(
pInfo
,
true
,
pSDB
,
false
);
...
...
@@ -2021,7 +2021,7 @@ FETCH_NEXT_BLOCK:
SSDataBlock
*
pSDB
=
doRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
pInfo
->
primaryTsIndex
,
&
pInfo
->
updateResIndex
);
if
(
pSDB
)
{
STableScanInfo
*
pTableScanInfo
=
pInfo
->
pTableScanOp
->
info
;
uint64_t
version
=
g
etReaderMaxVersion
(
pTableScanInfo
->
base
.
dataReader
);
uint64_t
version
=
tsdbG
etReaderMaxVersion
(
pTableScanInfo
->
base
.
dataReader
);
updateInfoSetScanRange
(
pInfo
->
pUpdateInfo
,
&
pTableScanInfo
->
base
.
cond
.
twindows
,
pInfo
->
groupId
,
version
);
pSDB
->
info
.
type
=
pInfo
->
scanMode
==
STREAM_SCAN_FROM_DATAREADER_RANGE
?
STREAM_NORMAL
:
STREAM_PULL_DATA
;
checkUpdateData
(
pInfo
,
true
,
pSDB
,
false
);
...
...
@@ -2426,7 +2426,7 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys
if
(
pHandle
->
initTqReader
)
{
ASSERT
(
pHandle
->
tqReader
==
NULL
);
pInfo
->
tqReader
=
tq
OpenReader
(
pHandle
->
vnode
);
pInfo
->
tqReader
=
tq
ReaderOpen
(
pHandle
->
vnode
);
ASSERT
(
pInfo
->
tqReader
);
}
else
{
ASSERT
(
pHandle
->
tqReader
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录