Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d3c97947
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
d3c97947
编写于
12月 29, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tsdb/read): use int32_t instead of size_t for taosHashGetSize
上级
2ed9c19d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
20 addition
and
15 deletion
+20
-15
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+20
-15
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
d3c97947
...
@@ -2902,14 +2902,15 @@ static int32_t buildBlockFromBufferSequentially(STsdbReader* pReader) {
...
@@ -2902,14 +2902,15 @@ static int32_t buildBlockFromBufferSequentially(STsdbReader* pReader) {
// set the correct start position in case of the first/last file block, according to the query time window
// set the correct start position in case of the first/last file block, according to the query time window
static
void
initBlockDumpInfo
(
STsdbReader
*
pReader
,
SDataBlockIter
*
pBlockIter
)
{
static
void
initBlockDumpInfo
(
STsdbReader
*
pReader
,
SDataBlockIter
*
pBlockIter
)
{
int64_t
lastKey
=
ASCENDING_TRAVERSE
(
pReader
->
order
)
?
INT64_MIN
:
INT64_MAX
;
SDataBlk
*
pBlock
=
getCurrentBlock
(
pBlockIter
);
SDataBlk
*
pBlock
=
getCurrentBlock
(
pBlockIter
);
SFileDataBlockInfo
*
pBlockInfo
=
getCurrentBlockInfo
(
pBlockIter
);
SFileDataBlockInfo
*
pBlockInfo
=
getCurrentBlockInfo
(
pBlockIter
);
if
(
pBlockInfo
)
{
STableBlockScanInfo
*
pScanInfo
=
taosHashGet
(
pBlockIter
->
pTableMap
,
&
pBlockInfo
->
uid
,
sizeof
(
pBlockInfo
->
uid
));
STableBlockScanInfo
*
pScanInfo
=
taosHashGet
(
pBlockIter
->
pTableMap
,
&
pBlockInfo
->
uid
,
sizeof
(
pBlockInfo
->
uid
));
if
(
pScanInfo
==
NULL
)
{
if
(
pScanInfo
)
{
tsdbError
(
"failed to locate the uid:%"
PRIu64
" in query table uid list"
,
pBlockInfo
->
uid
)
;
lastKey
=
pScanInfo
->
lastKey
;
return
;
}
}
}
SReaderStatus
*
pStatus
=
&
pReader
->
status
;
SReaderStatus
*
pStatus
=
&
pReader
->
status
;
SFileBlockDumpInfo
*
pDumpInfo
=
&
pStatus
->
fBlockDumpInfo
;
SFileBlockDumpInfo
*
pDumpInfo
=
&
pStatus
->
fBlockDumpInfo
;
...
@@ -2917,7 +2918,7 @@ static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter)
...
@@ -2917,7 +2918,7 @@ static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter)
pDumpInfo
->
totalRows
=
pBlock
->
nRow
;
pDumpInfo
->
totalRows
=
pBlock
->
nRow
;
pDumpInfo
->
allDumped
=
false
;
pDumpInfo
->
allDumped
=
false
;
pDumpInfo
->
rowIndex
=
ASCENDING_TRAVERSE
(
pReader
->
order
)
?
0
:
pBlock
->
nRow
-
1
;
pDumpInfo
->
rowIndex
=
ASCENDING_TRAVERSE
(
pReader
->
order
)
?
0
:
pBlock
->
nRow
-
1
;
pDumpInfo
->
lastKey
=
pScanInfo
->
lastKey
;
pDumpInfo
->
lastKey
=
lastKey
;
}
}
static
int32_t
initForFirstBlockInFile
(
STsdbReader
*
pReader
,
SDataBlockIter
*
pBlockIter
)
{
static
int32_t
initForFirstBlockInFile
(
STsdbReader
*
pReader
,
SDataBlockIter
*
pBlockIter
)
{
...
@@ -4058,11 +4059,11 @@ static int32_t tsdbSetQueryReseek(void* pQHandle) {
...
@@ -4058,11 +4059,11 @@ static int32_t tsdbSetQueryReseek(void* pQHandle) {
int32_t
tsdbReaderResume
(
STsdbReader
*
pReader
)
{
int32_t
tsdbReaderResume
(
STsdbReader
*
pReader
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
STableBlockScanInfo
*
pBlockScanInfo
=
*
pReader
->
status
.
pTableIter
;
STableBlockScanInfo
*
*
pBlockScanInfo
=
pReader
->
status
.
pTableIter
;
// restore reader's state
// restore reader's state
// task snapshot
// task snapshot
size
_t
numOfTables
=
taosHashGetSize
(
pReader
->
status
.
pTableMap
);
int32
_t
numOfTables
=
taosHashGetSize
(
pReader
->
status
.
pTableMap
);
if
(
numOfTables
>
0
)
{
if
(
numOfTables
>
0
)
{
code
=
tsdbTakeReadSnap
(
pReader
,
tsdbSetQueryReseek
,
&
pReader
->
pReadSnap
);
code
=
tsdbTakeReadSnap
(
pReader
,
tsdbSetQueryReseek
,
&
pReader
->
pReadSnap
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
@@ -4100,8 +4101,8 @@ int32_t tsdbReaderResume(STsdbReader* pReader) {
...
@@ -4100,8 +4101,8 @@ int32_t tsdbReaderResume(STsdbReader* pReader) {
pReader
->
suspended
=
false
;
pReader
->
suspended
=
false
;
tsdbDebug
(
"reader: %p resumed uid %"
PRIu64
", numOfTable:%"
PRI
u64
", in this query %s"
,
pReader
,
tsdbDebug
(
"reader: %p resumed uid %"
PRIu64
", numOfTable:%"
PRI
d32
", in this query %s"
,
pReader
,
pBlockScanInfo
?
pBlockScanInfo
->
uid
:
0
,
numOfTables
,
pReader
->
idStr
);
pBlockScanInfo
?
(
*
pBlockScanInfo
)
->
uid
:
0
,
numOfTables
,
pReader
->
idStr
);
return
code
;
return
code
;
_err:
_err:
...
@@ -4201,9 +4202,7 @@ bool tsdbNextDataBlock(STsdbReader* pReader) {
...
@@ -4201,9 +4202,7 @@ bool tsdbNextDataBlock(STsdbReader* pReader) {
}
}
}
}
if
(
pStatus
->
composedDataBlock
)
{
taosThreadMutexUnlock
(
&
pReader
->
readerMutex
);
taosThreadMutexUnlock
(
&
pReader
->
readerMutex
);
}
return
false
;
return
false
;
}
}
...
@@ -4335,6 +4334,8 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SSDataBlock* pDataBlock,
...
@@ -4335,6 +4334,8 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SSDataBlock* pDataBlock,
*
pBlockSMA
=
pResBlock
->
pBlockAgg
;
*
pBlockSMA
=
pResBlock
->
pBlockAgg
;
pReader
->
cost
.
smaDataLoad
+=
1
;
pReader
->
cost
.
smaDataLoad
+=
1
;
taosThreadMutexUnlock
(
&
pReader
->
readerMutex
);
tsdbDebug
(
"vgId:%d, succeed to load block SMA for uid %"
PRIu64
", %s"
,
0
,
pFBlock
->
uid
,
pReader
->
idStr
);
tsdbDebug
(
"vgId:%d, succeed to load block SMA for uid %"
PRIu64
", %s"
,
0
,
pFBlock
->
uid
,
pReader
->
idStr
);
return
code
;
return
code
;
}
}
...
@@ -4353,6 +4354,7 @@ static SSDataBlock* doRetrieveDataBlock(STsdbReader* pReader) {
...
@@ -4353,6 +4354,7 @@ static SSDataBlock* doRetrieveDataBlock(STsdbReader* pReader) {
terrno
=
TSDB_CODE_INVALID_PARA
;
terrno
=
TSDB_CODE_INVALID_PARA
;
tsdbError
(
"failed to locate the uid:%"
PRIu64
" in query table uid list, total tables:%d, %s"
,
pBlockInfo
->
uid
,
tsdbError
(
"failed to locate the uid:%"
PRIu64
" in query table uid list, total tables:%d, %s"
,
pBlockInfo
->
uid
,
taosHashGetSize
(
pReader
->
status
.
pTableMap
),
pReader
->
idStr
);
taosHashGetSize
(
pReader
->
status
.
pTableMap
),
pReader
->
idStr
);
taosThreadMutexUnlock
(
&
pReader
->
readerMutex
);
return
NULL
;
return
NULL
;
}
}
...
@@ -4360,6 +4362,7 @@ static SSDataBlock* doRetrieveDataBlock(STsdbReader* pReader) {
...
@@ -4360,6 +4362,7 @@ static SSDataBlock* doRetrieveDataBlock(STsdbReader* pReader) {
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tBlockDataDestroy
(
&
pStatus
->
fileBlockData
);
tBlockDataDestroy
(
&
pStatus
->
fileBlockData
);
terrno
=
code
;
terrno
=
code
;
taosThreadMutexUnlock
(
&
pReader
->
readerMutex
);
return
NULL
;
return
NULL
;
}
}
...
@@ -4369,6 +4372,8 @@ static SSDataBlock* doRetrieveDataBlock(STsdbReader* pReader) {
...
@@ -4369,6 +4372,8 @@ static SSDataBlock* doRetrieveDataBlock(STsdbReader* pReader) {
return
pReader
->
pResBlock
;
return
pReader
->
pResBlock
;
}
}
void
tsdbReleaseDataBlock
(
STsdbReader
*
pReader
)
{
taosThreadMutexUnlock
(
&
pReader
->
readerMutex
);
}
SSDataBlock
*
tsdbRetrieveDataBlock
(
STsdbReader
*
pReader
,
SArray
*
pIdList
)
{
SSDataBlock
*
tsdbRetrieveDataBlock
(
STsdbReader
*
pReader
,
SArray
*
pIdList
)
{
if
(
pReader
->
type
==
TIMEWINDOW_RANGE_EXTERNAL
)
{
if
(
pReader
->
type
==
TIMEWINDOW_RANGE_EXTERNAL
)
{
if
(
pReader
->
step
==
EXTERNAL_ROWS_PREV
)
{
if
(
pReader
->
step
==
EXTERNAL_ROWS_PREV
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录