Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
12a5458e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
12a5458e
编写于
7月 07, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adjust load data interface for read
上级
4630ba5d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
11 deletion
+13
-11
src/tsdb/inc/tsdbMain.h
src/tsdb/inc/tsdbMain.h
+3
-2
src/tsdb/src/tsdbRWHelper.c
src/tsdb/src/tsdbRWHelper.c
+9
-8
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+1
-1
未找到文件。
src/tsdb/inc/tsdbMain.h
浏览文件 @
12a5458e
...
...
@@ -437,8 +437,9 @@ int tsdbLoadCompIdx(SRWHelper* pHelper, void* target);
int
tsdbLoadCompInfo
(
SRWHelper
*
pHelper
,
void
*
target
);
int
tsdbLoadCompData
(
SRWHelper
*
phelper
,
SCompBlock
*
pcompblock
,
void
*
target
);
void
tsdbGetDataStatis
(
SRWHelper
*
pHelper
,
SDataStatis
*
pStatis
,
int
numOfCols
);
int
tsdbLoadBlockDataCols
(
SRWHelper
*
pHelper
,
SCompBlock
*
pCompBlock
,
int16_t
*
colIds
,
int
numOfColIds
);
int
tsdbLoadBlockData
(
SRWHelper
*
pHelper
,
SCompBlock
*
pCompBlock
);
int
tsdbLoadBlockDataCols
(
SRWHelper
*
pHelper
,
SCompBlock
*
pCompBlock
,
SCompInfo
*
pCompInfo
,
int16_t
*
colIds
,
int
numOfColIds
);
int
tsdbLoadBlockData
(
SRWHelper
*
pHelper
,
SCompBlock
*
pCompBlock
,
SCompInfo
*
pCompInfo
);
// ------------------ tsdbMain.c
#define REPO_ID(r) (r)->config.tsdbId
...
...
src/tsdb/src/tsdbRWHelper.c
浏览文件 @
12a5458e
...
...
@@ -318,7 +318,7 @@ int tsdbMoveLastBlockIfNeccessary(SRWHelper *pHelper) {
ASSERT
(
pCompBlock
->
last
);
if
(
pCompBlock
->
numOfSubBlocks
>
1
)
{
if
(
tsdbLoadBlockData
(
pHelper
,
blockAtIdx
(
pHelper
,
pIdx
->
numOfBlocks
-
1
))
<
0
)
return
-
1
;
if
(
tsdbLoadBlockData
(
pHelper
,
blockAtIdx
(
pHelper
,
pIdx
->
numOfBlocks
-
1
)
,
NULL
)
<
0
)
return
-
1
;
ASSERT
(
pHelper
->
pDataCols
[
0
]
->
numOfRows
>
0
&&
pHelper
->
pDataCols
[
0
]
->
numOfRows
<
pCfg
->
minRowsPerFileBlock
);
if
(
tsdbWriteBlockToFile
(
pHelper
,
&
(
pHelper
->
files
.
nLastF
),
pHelper
->
pDataCols
[
0
],
pHelper
->
pDataCols
[
0
]
->
numOfRows
,
&
compBlock
,
true
,
true
)
<
0
)
...
...
@@ -577,11 +577,12 @@ void tsdbGetDataStatis(SRWHelper *pHelper, SDataStatis *pStatis, int numOfCols)
}
}
int
tsdbLoadBlockDataCols
(
SRWHelper
*
pHelper
,
SCompBlock
*
pCompBlock
,
int16_t
*
colIds
,
int
numOfColIds
)
{
int
tsdbLoadBlockDataCols
(
SRWHelper
*
pHelper
,
SCompBlock
*
pCompBlock
,
SCompInfo
*
pCompInfo
,
int16_t
*
colIds
,
int
numOfColIds
)
{
ASSERT
(
pCompBlock
->
numOfSubBlocks
>=
1
);
// Must be super block
int
numOfSubBlocks
=
pCompBlock
->
numOfSubBlocks
;
if
(
numOfSubBlocks
>
1
)
pCompBlock
=
(
SCompBlock
*
)
POINTER_SHIFT
(
pHelper
->
pCompInfo
,
pCompBlock
->
offset
);
if
(
numOfSubBlocks
>
1
)
pCompBlock
=
(
SCompBlock
*
)
POINTER_SHIFT
((
pCompInfo
==
NULL
)
?
pHelper
->
pCompInfo
:
pCompInfo
,
pCompBlock
->
offset
);
tdResetDataCols
(
pHelper
->
pDataCols
[
0
]);
if
(
tsdbLoadBlockDataColsImpl
(
pHelper
,
pCompBlock
,
pHelper
->
pDataCols
[
0
],
colIds
,
numOfColIds
)
<
0
)
goto
_err
;
...
...
@@ -598,10 +599,10 @@ _err:
return
-
1
;
}
int
tsdbLoadBlockData
(
SRWHelper
*
pHelper
,
SCompBlock
*
pCompBlock
)
{
int
tsdbLoadBlockData
(
SRWHelper
*
pHelper
,
SCompBlock
*
pCompBlock
,
SCompInfo
*
pCompInfo
)
{
int
numOfSubBlock
=
pCompBlock
->
numOfSubBlocks
;
if
(
numOfSubBlock
>
1
)
pCompBlock
=
(
SCompBlock
*
)
POINTER_SHIFT
(
pHelper
->
pCompInfo
,
pCompBlock
->
offset
);
if
(
numOfSubBlock
>
1
)
pCompBlock
=
(
SCompBlock
*
)
POINTER_SHIFT
((
pCompInfo
==
NULL
)
?
pHelper
->
pCompInfo
:
pCompInfo
,
pCompBlock
->
offset
);
tdResetDataCols
(
pHelper
->
pDataCols
[
0
]);
if
(
tsdbLoadBlockDataImpl
(
pHelper
,
pCompBlock
,
pHelper
->
pDataCols
[
0
])
<
0
)
goto
_err
;
...
...
@@ -793,7 +794,7 @@ static int tsdbMergeDataWithBlock(SRWHelper *pHelper, int blkIdx, SDataCols *pDa
if
(
tsdbAddSubBlock
(
pHelper
,
&
compBlock
,
blkIdx
,
rowsWritten
)
<
0
)
goto
_err
;
}
else
{
// Load
if
(
tsdbLoadBlockData
(
pHelper
,
blockAtIdx
(
pHelper
,
blkIdx
))
<
0
)
goto
_err
;
if
(
tsdbLoadBlockData
(
pHelper
,
blockAtIdx
(
pHelper
,
blkIdx
)
,
NULL
)
<
0
)
goto
_err
;
ASSERT
(
pHelper
->
pDataCols
[
0
]
->
numOfRows
<=
blockAtIdx
(
pHelper
,
blkIdx
)
->
numOfRows
);
// Merge
if
(
tdMergeDataCols
(
pHelper
->
pDataCols
[
0
],
pDataCols
,
rowsWritten
)
<
0
)
goto
_err
;
...
...
@@ -849,7 +850,7 @@ static int tsdbMergeDataWithBlock(SRWHelper *pHelper, int blkIdx, SDataCols *pDa
if
(
tsdbAddSubBlock
(
pHelper
,
&
compBlock
,
blkIdx
,
rowsWritten
)
<
0
)
goto
_err
;
}
else
{
// Load-Merge-Write
// Load
if
(
tsdbLoadBlockData
(
pHelper
,
blockAtIdx
(
pHelper
,
blkIdx
))
<
0
)
goto
_err
;
if
(
tsdbLoadBlockData
(
pHelper
,
blockAtIdx
(
pHelper
,
blkIdx
)
,
NULL
)
<
0
)
goto
_err
;
if
(
blockAtIdx
(
pHelper
,
blkIdx
)
->
last
)
pHelper
->
hasOldLastBlock
=
false
;
rowsWritten
=
rows3
;
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
12a5458e
...
...
@@ -594,7 +594,7 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo
tdInitDataCols
(
pCheckInfo
->
pDataCols
,
tsdbGetTableSchema
(
pCheckInfo
->
pTableObj
));
if
(
tsdbLoadBlockData
(
&
(
pQueryHandle
->
rhelper
),
pBlock
)
==
0
)
{
if
(
tsdbLoadBlockData
(
&
(
pQueryHandle
->
rhelper
),
pBlock
,
pCheckInfo
->
pCompInfo
)
==
0
)
{
SDataBlockLoadInfo
*
pBlockLoadInfo
=
&
pQueryHandle
->
dataBlockLoadInfo
;
pBlockLoadInfo
->
fileGroup
=
pQueryHandle
->
pFileGroup
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录