Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9d6a264e
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
9d6a264e
编写于
5月 28, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
9d031f4d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
133 addition
and
56 deletion
+133
-56
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
+10
-14
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
+1
-1
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
+9
-6
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
+4
-2
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
+57
-26
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
+2
-2
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
+50
-5
未找到文件。
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
浏览文件 @
9d6a264e
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
*/
*/
#include "tsdbDef.h"
#include "tsdbDef.h"
#include "tsdbFSet.h"
#ifndef _TSDB_DATA_FILE_RW_H
#ifndef _TSDB_DATA_FILE_RW_H
#define _TSDB_DATA_FILE_RW_H
#define _TSDB_DATA_FILE_RW_H
...
@@ -26,24 +27,19 @@ extern "C" {
...
@@ -26,24 +27,19 @@ extern "C" {
typedef
struct
SDataFileReader
SDataFileReader
;
typedef
struct
SDataFileReader
SDataFileReader
;
typedef
struct
SDataFileReaderConfig
SDataFileReaderConfig
;
typedef
struct
SDataFileReaderConfig
SDataFileReaderConfig
;
int32_t
tsdbDataFileReaderOpen
(
const
char
*
fname
,
const
SDataFileReaderConfig
*
config
,
SDataFileReader
**
reader
);
int32_t
tsdbDataFileReaderClose
(
SDataFileReader
*
reader
);
// SDataFileWriter =============================================
// SDataFileWriter =============================================
typedef
struct
SDataFileWriter
SDataFileWriter
;
typedef
struct
SDataFileWriter
SDataFileWriter
;
typedef
struct
SDataFileWriterConfig
SDataFileWriterConfig
;
typedef
struct
SDataFileWriterConfig
{
STsdb
*
tsdb
;
}
SDataFileWriterConfig
;
int32_t
tsdbDataFileWriterOpen
(
const
SDataFileWriterConfig
*
config
,
SDataFileWriter
**
writer
);
int32_t
tsdbDataFileWriterOpen
(
const
SDataFileWriterConfig
*
config
,
SDataFileWriter
**
writer
);
int32_t
tsdbDataFileWriterClose
(
SDataFileWriter
*
writer
);
int32_t
tsdbDataFileWriterClose
(
SDataFileWriter
*
*
writer
,
bool
abort
,
STFileOp
op
[
/*TSDB_FTYPE_MAX*/
]
);
int32_t
tsdbDataFileWriteTSData
(
SDataFileWriter
*
writer
,
SBlockData
*
bData
);
int32_t
tsdbDataFileWriteTSData
(
SDataFileWriter
*
writer
,
SBlockData
*
bData
);
int32_t
tsdbDataFileWriteTSDataBlock
(
SDataFileWriter
*
writer
,
SBlockData
*
bData
);
// int32_t tsdbDataFileWriteDelData(SDataFileWriter *writer, SBlockData *bData);
struct
SDataFileReaderConfig
{
STsdb
*
pTsdb
;
// TODO
};
struct
SDataFileWriterConfig
{
STsdb
*
pTsdb
;
// TODO
};
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
浏览文件 @
9d6a264e
...
@@ -34,7 +34,7 @@ typedef struct SSttSegReader SSttSegReader;
...
@@ -34,7 +34,7 @@ typedef struct SSttSegReader SSttSegReader;
typedef
TARRAY2
(
SSttSegReader
*
)
TSttSegReaderArray
;
typedef
TARRAY2
(
SSttSegReader
*
)
TSttSegReaderArray
;
// SSttFileReader
// SSttFileReader
int32_t
tsdbSttFReaderOpen
(
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
);
int32_t
tsdbSttFReaderOpen
(
const
char
*
fname
,
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
);
int32_t
tsdbSttFReaderClose
(
SSttFileReader
**
reader
);
int32_t
tsdbSttFReaderClose
(
SSttFileReader
**
reader
);
int32_t
tsdbSttFReaderGetSegReader
(
SSttFileReader
*
reader
,
const
TSttSegReaderArray
**
readerArray
);
int32_t
tsdbSttFReaderGetSegReader
(
SSttFileReader
*
reader
,
const
TSttSegReaderArray
**
readerArray
);
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
浏览文件 @
9d6a264e
...
@@ -24,8 +24,9 @@ extern "C" {
...
@@ -24,8 +24,9 @@ extern "C" {
// SDelBlock ----------
// SDelBlock ----------
#define DEL_RECORD_NUM_ELEM 5
typedef
union
{
typedef
union
{
int64_t
aData
[
5
];
int64_t
aData
[
DEL_RECORD_NUM_ELEM
];
struct
{
struct
{
int64_t
suid
;
int64_t
suid
;
int64_t
uid
;
int64_t
uid
;
...
@@ -36,7 +37,7 @@ typedef union {
...
@@ -36,7 +37,7 @@ typedef union {
}
SDelRecord
;
}
SDelRecord
;
typedef
union
{
typedef
union
{
TARRAY2
(
int64_t
)
aData
[
5
];
TARRAY2
(
int64_t
)
aData
[
DEL_RECORD_NUM_ELEM
];
struct
{
struct
{
TARRAY2
(
int64_t
)
suid
[
1
];
TARRAY2
(
int64_t
)
suid
[
1
];
TARRAY2
(
int64_t
)
uid
[
1
];
TARRAY2
(
int64_t
)
uid
[
1
];
...
@@ -48,11 +49,12 @@ typedef union {
...
@@ -48,11 +49,12 @@ typedef union {
typedef
struct
SDelBlk
{
typedef
struct
SDelBlk
{
int32_t
nRow
;
int32_t
nRow
;
int32_t
size
[
DEL_RECORD_NUM_ELEM
];
TABLEID
minTid
;
TABLEID
minTid
;
TABLEID
maxTid
;
TABLEID
maxTid
;
int64_t
minVer
;
int64_t
minVer
;
int64_t
maxVer
;
int64_t
maxVer
;
SFDataPtr
dp
;
SFDataPtr
dp
[
1
]
;
}
SDelBlk
;
}
SDelBlk
;
#define DEL_BLOCK_SIZE(db) TARRAY2_SIZE((db)->suid)
#define DEL_BLOCK_SIZE(db) TARRAY2_SIZE((db)->suid)
...
@@ -65,8 +67,9 @@ int32_t tDelBlockEncode(SDelBlock *delBlock, void *buf, int32_t size);
...
@@ -65,8 +67,9 @@ int32_t tDelBlockEncode(SDelBlock *delBlock, void *buf, int32_t size);
int32_t
tDelBlockDecode
(
const
void
*
buf
,
SDelBlock
*
delBlock
);
int32_t
tDelBlockDecode
(
const
void
*
buf
,
SDelBlock
*
delBlock
);
// STbStatisBlock ----------
// STbStatisBlock ----------
#define STATIS_RECORD_NUM_ELEM 9
typedef
union
{
typedef
union
{
int64_t
aData
[
9
];
int64_t
aData
[
STATIS_RECORD_NUM_ELEM
];
struct
{
struct
{
int64_t
suid
;
int64_t
suid
;
int64_t
uid
;
int64_t
uid
;
...
@@ -81,7 +84,7 @@ typedef union {
...
@@ -81,7 +84,7 @@ typedef union {
}
STbStatisRecord
;
}
STbStatisRecord
;
typedef
union
{
typedef
union
{
TARRAY2
(
int64_t
)
aData
[
9
];
TARRAY2
(
int64_t
)
aData
[
STATIS_RECORD_NUM_ELEM
];
struct
{
struct
{
TARRAY2
(
int64_t
)
suid
[
1
];
TARRAY2
(
int64_t
)
suid
[
1
];
TARRAY2
(
int64_t
)
uid
[
1
];
TARRAY2
(
int64_t
)
uid
[
1
];
...
@@ -97,7 +100,7 @@ typedef union {
...
@@ -97,7 +100,7 @@ typedef union {
typedef
struct
STbStatisBlk
{
typedef
struct
STbStatisBlk
{
int32_t
numRec
;
int32_t
numRec
;
int32_t
size
[
9
];
int32_t
size
[
STATIS_RECORD_NUM_ELEM
];
TABLEID
minTid
;
TABLEID
minTid
;
TABLEID
maxTid
;
TABLEID
maxTid
;
int64_t
minVer
;
int64_t
minVer
;
...
...
source/dnode/vnode/src/tsdb/dev/tsdbCommit.c
浏览文件 @
9d6a264e
...
@@ -272,8 +272,10 @@ static int32_t commit_fset_end(SCommitter *pCommitter) {
...
@@ -272,8 +272,10 @@ static int32_t commit_fset_end(SCommitter *pCommitter) {
code
=
tsdbSttFWriterClose
(
&
pCommitter
->
pWriter
,
0
,
&
op
);
code
=
tsdbSttFWriterClose
(
&
pCommitter
->
pWriter
,
0
,
&
op
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
TARRAY2_APPEND
(
&
pCommitter
->
opArray
,
op
);
if
(
op
.
optype
!=
TSDB_FOP_NONE
)
{
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
TARRAY2_APPEND
(
&
pCommitter
->
opArray
,
op
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
_exit:
_exit:
if
(
code
)
{
if
(
code
)
{
...
...
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
浏览文件 @
9d6a264e
...
@@ -22,53 +22,84 @@ struct SDataFileReader {
...
@@ -22,53 +22,84 @@ struct SDataFileReader {
// SDataFileWriter =============================================
// SDataFileWriter =============================================
struct
SDataFileWriter
{
struct
SDataFileWriter
{
SDataFileWriterConfig
config
[
1
];
struct
{
bool
opened
;
}
ctx
[
1
];
// TODO
// TODO
};
};
int32_t
tsdbDataFileWriterOpen
(
const
SDataFileWriterConfig
*
config
,
SDataFileWriter
**
ppWriter
)
{
int32_t
tsdbDataFileWriterOpen
(
const
SDataFileWriterConfig
*
config
,
SDataFileWriter
**
writer
)
{
int32_t
code
=
0
;
writer
[
0
]
=
taosMemoryCalloc
(
1
,
sizeof
(
SDataFileWriter
));
int32_t
lino
=
0
;
if
(
!
writer
[
0
])
return
TSDB_CODE_OUT_OF_MEMORY
;
int32_t
vid
=
TD_VID
(
config
->
pTsdb
->
pVnode
);
writer
[
0
]
->
ctx
->
opened
=
false
;
// TODO
return
0
;
_exit:
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
return
code
;
}
}
int32_t
tsdbDataFileWriterClose
(
SDataFileWriter
*
pWriter
)
{
static
int32_t
tsdbDataFileWriterCloseCommit
(
SDataFileWriter
*
writer
)
{
// TODO
return
0
;
}
static
int32_t
tsdbDataFileWriterCloseAbort
(
SDataFileWriter
*
writer
)
{
// TODO
return
0
;
}
static
int32_t
tsdbDataFileWriterDoClose
(
SDataFileWriter
*
writer
)
{
// TODO
return
0
;
}
static
int32_t
tsdbDataFileWriterCloseImpl
(
SDataFileWriter
*
writer
,
bool
abort
,
STFileOp
op
[
/*TSDB_FTYPE_MAX*/
])
{
int32_t
code
=
0
;
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
0
;
// TODO: TD_VID(config->pTsdb->pVnode);
int32_t
vid
=
TD_VID
(
writer
->
config
->
tsdb
->
pVnode
);
// TODO
if
(
!
writer
->
ctx
->
opened
)
{
for
(
int32_t
i
=
0
;
i
<
TSDB_FTYPE_MAX
;
++
i
)
op
[
i
].
optype
=
TSDB_FOP_NONE
;
}
else
{
if
(
abort
)
{
code
=
tsdbDataFileWriterCloseAbort
(
writer
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
else
{
code
=
tsdbDataFileWriterCloseCommit
(
writer
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
tsdbDataFileWriterDoClose
(
writer
);
}
taosMemoryFree
(
writer
);
_exit:
_exit:
if
(
code
)
{
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
}
return
code
;
return
code
;
}
}
int32_t
tsdbDataFileWriterClose
(
SDataFileWriter
**
writer
,
bool
abort
,
STFileOp
op
[
/*TSDB_FTYPE_MAX*/
])
{
int32_t
tsdbDataFileWriteTSData
(
SDataFileWriter
*
pWriter
,
SBlockData
*
pBlockData
)
{
int32_t
code
=
tsdbDataFileWriterCloseImpl
(
writer
[
0
],
abort
,
op
);
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
0
;
// TODO: TD_VID(config->pTsdb->pVnode);
// TODO
_exit:
if
(
code
)
{
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
return
code
;
}
else
{
writer
[
0
]
=
NULL
;
return
0
;
}
}
return
code
;
}
}
int32_t
tsdbDataFileWriteTSDataBlock
(
SDataFileWriter
*
pWriter
,
SBlockData
*
pBlockData
)
{
static
int32_t
tsdbDataFileWriterDoOpen
(
SDataFileWriter
*
writer
)
{
// TODO
return
0
;
}
int32_t
tsdbDataFileWriteTSData
(
SDataFileWriter
*
writer
,
SBlockData
*
bData
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
0
;
// TODO: TD_VID(config->pTsdb->pVnode);
int32_t
vid
=
TD_VID
(
writer
->
config
->
tsdb
->
pVnode
);
// TODO
if
(
!
writer
->
ctx
->
opened
)
{
code
=
tsdbDataFileWriterDoOpen
(
writer
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
_exit:
_exit:
if
(
code
)
{
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
}
return
code
;
return
code
;
}
}
\ No newline at end of file
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
浏览文件 @
9d6a264e
...
@@ -202,7 +202,7 @@ static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
...
@@ -202,7 +202,7 @@ static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
.
tsdb
=
merger
->
tsdb
,
.
tsdb
=
merger
->
tsdb
,
// TODO
// TODO
};
};
code
=
tsdbSttFReaderOpen
(
&
config
,
&
reader
);
code
=
tsdbSttFReaderOpen
(
fobj
->
fname
,
&
config
,
&
reader
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
TARRAY2_APPEND
(
&
merger
->
sttReaderArr
,
reader
);
code
=
TARRAY2_APPEND
(
&
merger
->
sttReaderArr
,
reader
);
...
@@ -259,7 +259,7 @@ static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
...
@@ -259,7 +259,7 @@ static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
// open data file writer
// open data file writer
if
(
merger
->
ctx
.
toData
)
{
if
(
merger
->
ctx
.
toData
)
{
SDataFileWriterConfig
config
=
{
SDataFileWriterConfig
config
=
{
.
pT
sdb
=
merger
->
tsdb
,
.
t
sdb
=
merger
->
tsdb
,
// TODO
// TODO
};
};
code
=
tsdbDataFileWriterOpen
(
&
config
,
&
merger
->
dataWriter
);
code
=
tsdbDataFileWriterOpen
(
&
config
,
&
merger
->
dataWriter
);
...
...
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
浏览文件 @
9d6a264e
...
@@ -84,7 +84,7 @@ static int32_t tsdbSttSegReaderClose(SSttSegReader **reader) {
...
@@ -84,7 +84,7 @@ static int32_t tsdbSttSegReaderClose(SSttSegReader **reader) {
return
0
;
return
0
;
}
}
int32_t
tsdbSttFReaderOpen
(
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
)
{
int32_t
tsdbSttFReaderOpen
(
const
char
*
fname
,
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
config
->
tsdb
->
pVnode
);
int32_t
vid
=
TD_VID
(
config
->
tsdb
->
pVnode
);
...
@@ -95,8 +95,6 @@ int32_t tsdbSttFReaderOpen(const SSttFileReaderConfig *config, SSttFileReader **
...
@@ -95,8 +95,6 @@ int32_t tsdbSttFReaderOpen(const SSttFileReaderConfig *config, SSttFileReader **
reader
[
0
]
->
config
[
0
]
=
config
[
0
];
reader
[
0
]
->
config
[
0
]
=
config
[
0
];
// open file
// open file
char
fname
[
TSDB_FILENAME_LEN
];
tsdbTFileName
(
config
->
tsdb
,
config
->
file
,
fname
);
code
=
tsdbOpenFile
(
fname
,
config
->
szPage
,
TD_FILE_READ
,
&
reader
[
0
]
->
fd
);
code
=
tsdbOpenFile
(
fname
,
config
->
szPage
,
TD_FILE_READ
,
&
reader
[
0
]
->
fd
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
@@ -221,13 +219,60 @@ int32_t tsdbSttFReadSttBlock(SSttSegReader *reader, const SSttBlk *sttBlk, SBloc
...
@@ -221,13 +219,60 @@ int32_t tsdbSttFReadSttBlock(SSttSegReader *reader, const SSttBlk *sttBlk, SBloc
int32_t
tsdbSttFReadDelBlock
(
SSttSegReader
*
reader
,
const
SDelBlk
*
delBlk
,
SDelBlock
*
dData
)
{
int32_t
tsdbSttFReadDelBlock
(
SSttSegReader
*
reader
,
const
SDelBlk
*
delBlk
,
SDelBlock
*
dData
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
// TODO
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
reader
->
reader
->
config
->
tsdb
->
pVnode
);
tDelBlockClear
(
dData
);
code
=
tRealloc
(
&
reader
->
reader
->
config
->
aBuf
[
0
],
delBlk
->
dp
->
size
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
tsdbReadFile
(
reader
->
reader
->
fd
,
delBlk
->
dp
->
offset
,
reader
->
reader
->
config
->
aBuf
[
0
],
delBlk
->
dp
->
size
);
if
(
code
)
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
int64_t
size
=
0
;
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
dData
->
aData
);
++
i
)
{
code
=
tsdbDecmprData
(
reader
->
reader
->
config
->
aBuf
[
0
]
+
size
,
delBlk
->
size
[
i
],
TSDB_DATA_TYPE_BIGINT
,
TWO_STAGE_COMP
,
NULL
,
0
,
NULL
);
// TODO
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
size
+=
delBlk
->
size
[
i
];
}
ASSERT
(
size
==
delBlk
->
dp
->
size
);
_exit:
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d, reason:%s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
return
code
;
return
code
;
}
}
int32_t
tsdbSttFReadStatisBlock
(
SSttSegReader
*
reader
,
const
STbStatisBlk
*
statisBlk
,
STbStatisBlock
*
sData
)
{
int32_t
tsdbSttFReadStatisBlock
(
SSttSegReader
*
reader
,
const
STbStatisBlk
*
statisBlk
,
STbStatisBlock
*
sData
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
// TODO
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
reader
->
reader
->
config
->
tsdb
->
pVnode
);
tStatisBlockClear
(
sData
);
code
=
tRealloc
(
&
reader
->
reader
->
config
->
aBuf
[
0
],
statisBlk
->
dp
->
size
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
tsdbReadFile
(
reader
->
reader
->
fd
,
statisBlk
->
dp
->
offset
,
reader
->
reader
->
config
->
aBuf
[
0
],
statisBlk
->
dp
->
size
);
if
(
code
)
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
int64_t
size
=
0
;
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
sData
->
aData
);
++
i
)
{
code
=
tsdbDecmprData
(
reader
->
reader
->
config
->
aBuf
[
0
]
+
size
,
statisBlk
->
size
[
i
],
TSDB_DATA_TYPE_BIGINT
,
TWO_STAGE_COMP
,
NULL
,
0
,
NULL
);
// TODO
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
size
+=
statisBlk
->
size
[
i
];
}
ASSERT
(
size
==
statisBlk
->
dp
->
size
);
_exit:
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d, reason:%s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
return
code
;
return
code
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录