提交 11fb843d 编写于 作者: C Cary Xu

load data and aggrData

上级 174b0283
...@@ -165,7 +165,7 @@ typedef struct { ...@@ -165,7 +165,7 @@ typedef struct {
int32_t delimiter; // For recovery usage int32_t delimiter; // For recovery usage
int32_t numOfCols; // For recovery usage int32_t numOfCols; // For recovery usage
uint64_t uid; // For recovery usage uint64_t uid; // For recovery usage
SBlockCol cols[]; // latest definition SBlockCol cols[];
} SBlockData; } SBlockData;
typedef struct { typedef struct {
// int32_t delimiter; // For recovery usage // int32_t delimiter; // For recovery usage
...@@ -239,6 +239,7 @@ int tsdbLoadBlockInfo(SReadH *pReadh, void **pTarget, int32_t *extendedLen); ...@@ -239,6 +239,7 @@ int tsdbLoadBlockInfo(SReadH *pReadh, void **pTarget, int32_t *extendedLen);
int tsdbLoadBlockData(SReadH *pReadh, SBlock *pBlock, SBlockInfo *pBlockInfo); int tsdbLoadBlockData(SReadH *pReadh, SBlock *pBlock, SBlockInfo *pBlockInfo);
int tsdbLoadBlockDataCols(SReadH *pReadh, SBlock *pBlock, SBlockInfo *pBlkInfo, int16_t *colIds, int numOfColsIds); int tsdbLoadBlockDataCols(SReadH *pReadh, SBlock *pBlock, SBlockInfo *pBlkInfo, int16_t *colIds, int numOfColsIds);
int tsdbLoadBlockStatis(SReadH *pReadh, SBlock *pBlock); int tsdbLoadBlockStatis(SReadH *pReadh, SBlock *pBlock);
// int tsdbLoadBlockHead(SReadH *pReadh, SBlock *pBlock);
int tsdbEncodeSBlockIdx(void **buf, SBlockIdx *pIdx); int tsdbEncodeSBlockIdx(void **buf, SBlockIdx *pIdx);
void *tsdbDecodeSBlockIdx(void *buf, SBlockIdx *pIdx); void *tsdbDecodeSBlockIdx(void *buf, SBlockIdx *pIdx);
void tsdbGetBlockStatis(SReadH *pReadh, SDataStatis *pStatis, int numOfCols, SBlock *pBlock); void tsdbGetBlockStatis(SReadH *pReadh, SDataStatis *pStatis, int numOfCols, SBlock *pBlock);
......
...@@ -417,7 +417,7 @@ int tsdbLoadBlockDataCols(SReadH *pReadh, SBlock *pBlock, SBlockInfo *pBlkInfo, ...@@ -417,7 +417,7 @@ int tsdbLoadBlockDataCols(SReadH *pReadh, SBlock *pBlock, SBlockInfo *pBlkInfo,
return 0; return 0;
} }
static int tsdbLoadBlockStatisFromData(SReadH *pReadh, SBlock *pBlock) { static int tsdbLoadBlockStatisFromDFile(SReadH *pReadh, SBlock *pBlock) {
SDFile *pDFile = (pBlock->last) ? TSDB_READ_LAST_FILE(pReadh) : TSDB_READ_DATA_FILE(pReadh); SDFile *pDFile = (pBlock->last) ? TSDB_READ_LAST_FILE(pReadh) : TSDB_READ_DATA_FILE(pReadh);
if (tsdbSeekDFile(pDFile, pBlock->offset, SEEK_SET) < 0) { if (tsdbSeekDFile(pDFile, pBlock->offset, SEEK_SET) < 0) {
tsdbError("vgId:%d failed to load block statis part while seek file %s to offset %" PRId64 " since %s", tsdbError("vgId:%d failed to load block statis part while seek file %s to offset %" PRId64 " since %s",
...@@ -498,11 +498,23 @@ int tsdbLoadBlockStatis(SReadH *pReadh, SBlock *pBlock) { ...@@ -498,11 +498,23 @@ int tsdbLoadBlockStatis(SReadH *pReadh, SBlock *pBlock) {
ASSERT(pBlock->numOfSubBlocks <= 1); ASSERT(pBlock->numOfSubBlocks <= 1);
if (pBlock->blkVer == TSDB_SBLK_VER_0) { if (pBlock->blkVer == TSDB_SBLK_VER_0) {
return tsdbLoadBlockStatisFromData(pReadh, pBlock); return tsdbLoadBlockStatisFromDFile(pReadh, pBlock);
}
if (tsdbLoadBlockStatisFromDFile(pReadh, pBlock) < 0) {
return -1;
} }
return tsdbLoadBlockStatisFromAggr(pReadh, pBlock); return tsdbLoadBlockStatisFromAggr(pReadh, pBlock);
} }
// int tsdbLoadBlockHead(SReadH *pReadh, SBlock *pBlock) {
// ASSERT(pBlock->numOfSubBlocks <= 1);
// if (pBlock->blkVer >= TSDB_SBLK_VER_1) {
// return tsdbLoadBlockStatisFromDFile(pReadh, pBlock);
// }
// return 0;
// }
int tsdbEncodeSBlockIdx(void **buf, SBlockIdx *pIdx) { int tsdbEncodeSBlockIdx(void **buf, SBlockIdx *pIdx) {
int tlen = 0; int tlen = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册