Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7c32e099
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看板
提交
7c32e099
编写于
8月 06, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more work
上级
43dec55f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
32 deletion
+28
-32
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
+26
-30
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
7c32e099
...
...
@@ -253,12 +253,12 @@ int32_t tsdbDataFReaderClose(SDataFReader **ppReader);
int32_t
tsdbReadBlockIdx
(
SDataFReader
*
pReader
,
SArray
*
aBlockIdx
);
int32_t
tsdbReadBlock
(
SDataFReader
*
pReader
,
SBlockIdx
*
pBlockIdx
,
SMapData
*
pMapData
);
int32_t
tsdbReadBlockL
(
SDataFReader
*
pReader
,
SArray
*
aBlockL
);
int32_t
tsdbReadBlockSma
(
SDataFReader
*
pReader
,
SBlock
*
pBlock
,
SArray
*
aColumnDataAgg
);
int32_t
tsdbReadColData
(
SDataFReader
*
pReader
,
SBlockIdx
*
pBlockIdx
,
SBlock
*
pBlock
,
int16_t
*
aColId
,
int32_t
nCol
,
SBlockData
*
pBlockData
,
uint8_t
**
ppBuf1
,
uint8_t
**
ppBuf2
);
int32_t
tsdbReadBlockData
(
SDataFReader
*
pReader
,
SBlockIdx
*
pBlockIdx
,
SBlock
*
pBlock
,
SBlockData
*
pBlockData
,
uint8_t
**
ppBuf1
,
uint8_t
**
ppBuf2
);
int32_t
tsdbReadBlockSma
(
SDataFReader
*
pReader
,
SBlock
*
pBlock
,
SArray
*
aColumnDataAgg
,
uint8_t
**
ppBuf
);
int32_t
tsdbReadDataBlock
(
SDataFReader
*
pReader
,
SBlock
*
pBlock
,
SBlockData
*
pBlockData
,
uint8_t
**
ppBuf1
,
uint8_t
**
ppBuf2
);
int32_t
tsdbReadLastBlock
(
SDataFReader
*
pReader
,
SBlockL
*
pBlockL
,
SBlockData
*
pBlockData
,
uint8_t
**
ppBuf1
,
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
7c32e099
...
...
@@ -2806,7 +2806,7 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS
SBlockLoadSuppInfo
*
pSup
=
&
pReader
->
suppInfo
;
if
(
tBlockHasSma
(
pBlock
))
{
code
=
tsdbReadBlockSma
(
pReader
->
pFileReader
,
pBlock
,
pSup
->
pColAgg
,
NULL
);
code
=
tsdbReadBlockSma
(
pReader
->
pFileReader
,
pBlock
,
pSup
->
pColAgg
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tsdbDebug
(
"vgId:%d, failed to load block SMA for uid %"
PRIu64
", code:%s, %s"
,
0
,
pFBlock
->
uid
,
tstrerror
(
code
),
pReader
->
idStr
);
...
...
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
浏览文件 @
7c32e099
...
...
@@ -829,6 +829,7 @@ _err:
return
code
;
}
#if 0
static int32_t tsdbReadBlockCol(uint8_t *pBuf, int32_t szBlockCol, SDiskDataHdr *pHdr, SArray *aBlockCol) {
int32_t code = 0;
int32_t n = 0;
...
...
@@ -862,6 +863,7 @@ static int32_t tsdbReadBlockCol(uint8_t *pBuf, int32_t szBlockCol, SDiskDataHdr
_err:
return code;
}
#endif
static
int32_t
tsdbReadDataArray
(
uint8_t
*
pInput
,
int32_t
szInput
,
int32_t
nEle
,
int8_t
type
,
int8_t
cmprAlg
,
uint8_t
**
ppOut
,
uint8_t
**
ppBuf
)
{
...
...
@@ -1349,30 +1351,21 @@ _err:
return
code
;
}
int32_t
tsdbReadBlockSma
(
SDataFReader
*
pReader
,
SBlock
*
pBlock
,
SArray
*
aColumnDataAgg
,
uint8_t
**
ppBuf
)
{
int32_t
code
=
0
;
#if 0
TdFilePtr pFD = pReader->pSmaFD;
int64_t offset = pBlock->aSubBlock[0].sOffset;
int64_t size = pBlock->aSubBlock[0].nSma * sizeof(SColumnDataAgg) + sizeof(TSCKSUM);
uint8_t *pBuf = NULL;
int64_t n;
int32_t
tsdbReadBlockSma
(
SDataFReader
*
pReader
,
SBlock
*
pBlock
,
SArray
*
aColumnDataAgg
)
{
int32_t
code
=
0
;
SSmaInfo
*
pSmaInfo
=
&
pBlock
->
smaInfo
;
ASSERT(
tBlockHasSma(pBlock)
);
ASSERT
(
pSmaInfo
->
size
>
0
);
if (!ppBuf) ppBuf = &pBuf;
code = tRealloc(ppBuf, size);
if (code) goto _err;
taosArrayClear
(
aColumnDataAgg
);
// lseek
n = taosLSeekFile(pFD, offset, SEEK_SET);
if (n < 0) {
code = TAOS_SYSTEM_ERROR(errno);
goto _err;
}
// alloc
int32_t
size
=
pSmaInfo
->
size
+
sizeof
(
TSCKSUM
);
code
=
tRealloc
(
&
pReader
->
pBuf1
,
size
);
if
(
code
)
goto
_err
;
// read
n = taosReadFile(pFD, *ppBuf
, size);
int64_t
n
=
taosReadFile
(
pReader
->
pSmaFD
,
pReader
->
pBuf1
,
size
);
if
(
n
<
0
)
{
code
=
TAOS_SYSTEM_ERROR
(
errno
);
goto
_err
;
...
...
@@ -1382,27 +1375,27 @@ int32_t tsdbReadBlockSma(SDataFReader *pReader, SBlock *pBlock, SArray *aColumnD
}
// check
if (!taosCheckChecksumWhole(
*ppBuf
, size)) {
if
(
!
taosCheckChecksumWhole
(
pReader
->
pBuf1
,
size
))
{
code
=
TSDB_CODE_FILE_CORRUPTED
;
goto
_err
;
}
// decode
taosArrayClear(aColumnDataAgg);
for (int32_t iSma = 0; iSma < pBlock->aSubBlock[0].nSma; iSma++) {
if (taosArrayPush(aColumnDataAgg, &((SColumnDataAgg *)(*ppBuf))[iSma]) == NULL) {
n
=
0
;
while
(
n
<
pSmaInfo
->
size
)
{
SColumnDataAgg
sma
;
n
+=
tGetColumnDataAgg
(
pReader
->
pBuf1
+
n
,
&
sma
);
if
(
taosArrayPush
(
aColumnDataAgg
,
&
sma
)
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_err
;
}
}
tFree(pBuf);
return
code
;
_err:
tsdbError("vgId:%d, read block sma failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code));
tFree(pBuf);
#endif
tsdbError
(
"vgId:%d tsdb read block sma failed since %s"
,
TD_VID
(
pReader
->
pTsdb
->
pVnode
),
tstrerror
(
code
));
return
code
;
}
...
...
@@ -1912,10 +1905,12 @@ _err:
int32_t
tsdbWriteBlockData
(
SDataFWriter
*
pWriter
,
SBlockData
*
pBlockData
,
SBlockInfo
*
pBlkInfo
,
SSmaInfo
*
pSmaInfo
,
int8_t
cmprAlg
,
int8_t
toLast
)
{
int32_t
code
=
0
;
TdFilePtr
pFD
=
toLast
?
pWriter
->
pLastFD
:
pWriter
->
pDataFD
;
SDiskData
*
pDiskData
=
&
pWriter
->
dData
;
int32_t
code
=
0
;
TdFilePtr
pFD
=
toLast
?
pWriter
->
pLastFD
:
pWriter
->
pDataFD
;
ASSERT
(
pBlockData
->
nRow
>
0
);
// ================= DATA ====================
#if 0
// convert
code = tBlockToDiskData(pBlockData, pDiskData, cmprAlg);
...
...
@@ -1993,6 +1988,7 @@ _exit:
return
code
;
_err:
tsdbError
(
"vgId:%d tsdb write block data failed since %s"
,
TD_VID
(
pWriter
->
pTsdb
->
pVnode
),
tstrerror
(
code
));
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录