From d4f4ac1d899d0c8235a75db45e5c67a05addadb2 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 31 May 2023 17:49:08 +0800 Subject: [PATCH] more code --- .../vnode/src/tsdb/dev/inc/tsdbSttFileRW.h | 18 ++++++++--------- source/dnode/vnode/src/tsdb/dev/tsdbIter.c | 4 ++-- source/dnode/vnode/src/tsdb/dev/tsdbMerge.c | 6 +++--- .../dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c | 20 +++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h b/source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h index faa63310e9..6c5c832fe4 100644 --- a/source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h +++ b/source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h @@ -35,18 +35,18 @@ typedef TARRAY2(SSttFileReader *) TSttFileReaderArray; typedef TARRAY2(SSttSegReader *) TSttSegReaderArray; // SSttFileReader -int32_t tsdbSttFReaderOpen(const char *fname, const SSttFileReaderConfig *config, SSttFileReader **reader); -int32_t tsdbSttFReaderClose(SSttFileReader **reader); -int32_t tsdbSttFReaderGetSegReader(SSttFileReader *reader, const TSttSegReaderArray **readerArray); +int32_t tsdbSttFileReaderOpen(const char *fname, const SSttFileReaderConfig *config, SSttFileReader **reader); +int32_t tsdbSttFileReaderClose(SSttFileReader **reader); +int32_t tsdbSttFileReaderGetSegReader(SSttFileReader *reader, const TSttSegReaderArray **readerArray); // SSttSegReader -int32_t tsdbSttFReadSttBlk(SSttSegReader *reader, const TSttBlkArray **sttBlkArray); -int32_t tsdbSttFReadDelBlk(SSttSegReader *reader, const TDelBlkArray **delBlkArray); -int32_t tsdbSttFReadStatisBlk(SSttSegReader *reader, const TStatisBlkArray **statisBlkArray); +int32_t tsdbSttFileReadSttBlk(SSttSegReader *reader, const TSttBlkArray **sttBlkArray); +int32_t tsdbSttFileReadDelBlk(SSttSegReader *reader, const TDelBlkArray **delBlkArray); +int32_t tsdbSttFileReadStatisBlk(SSttSegReader *reader, const TStatisBlkArray **statisBlkArray); -int32_t tsdbSttFReadSttBlock(SSttSegReader *reader, const SSttBlk *sttBlk, SBlockData *bData); -int32_t tsdbSttFReadDelBlock(SSttSegReader *reader, const SDelBlk *delBlk, SDelBlock *dData); -int32_t tsdbSttFReadStatisBlock(SSttSegReader *reader, const STbStatisBlk *statisBlk, STbStatisBlock *sData); +int32_t tsdbSttFileReadSttBlock(SSttSegReader *reader, const SSttBlk *sttBlk, SBlockData *bData); +int32_t tsdbSttFileReadDelBlock(SSttSegReader *reader, const SDelBlk *delBlk, SDelBlock *dData); +int32_t tsdbSttFileReadStatisBlock(SSttSegReader *reader, const STbStatisBlk *statisBlk, STbStatisBlock *sData); struct SSttFileReaderConfig { STsdb *tsdb; diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbIter.c b/source/dnode/vnode/src/tsdb/dev/tsdbIter.c index 436139083f..c56a8f7032 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbIter.c +++ b/source/dnode/vnode/src/tsdb/dev/tsdbIter.c @@ -77,7 +77,7 @@ static int32_t tsdbSttIterNext(STsdbIter *iter, const TABLEID *tbid) { continue; } - int32_t code = tsdbSttFReadSttBlock(iter->stt->reader, sttBlk, iter->stt->bData); + int32_t code = tsdbSttFileReadSttBlock(iter->stt->reader, sttBlk, iter->stt->bData); if (code) return code; iter->stt->iRow = 0; @@ -200,7 +200,7 @@ _exit: static int32_t tsdbSttIterOpen(STsdbIter *iter) { int32_t code; - code = tsdbSttFReadSttBlk(iter->stt->reader, &iter->stt->sttBlkArray); + code = tsdbSttFileReadSttBlk(iter->stt->reader, &iter->stt->sttBlkArray); if (code) return code; if (TARRAY2_SIZE(iter->stt->sttBlkArray) == 0) { diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbMerge.c b/source/dnode/vnode/src/tsdb/dev/tsdbMerge.c index 281e7b8e01..3310502359 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbMerge.c +++ b/source/dnode/vnode/src/tsdb/dev/tsdbMerge.c @@ -229,7 +229,7 @@ static int32_t tsdbMergeFileSetBeginOpenReader(SMerger *merger) { .szPage = merger->szPage, .file[0] = merger->ctx->fobj->f[0], }}; - code = tsdbSttFReaderOpen(merger->ctx->fobj->fname, config, &reader); + code = tsdbSttFileReaderOpen(merger->ctx->fobj->fname, config, &reader); TSDB_CHECK_CODE(code, lino, _exit); code = TARRAY2_APPEND(merger->sttReaderArr, reader); @@ -253,7 +253,7 @@ static int32_t tsdbMergeFileSetBeginOpenIter(SMerger *merger) { TARRAY2_FOREACH(merger->sttReaderArr, sttReader) { const TSttSegReaderArray *segReaderArr; - code = tsdbSttFReaderGetSegReader(sttReader, &segReaderArr); + code = tsdbSttFileReaderGetSegReader(sttReader, &segReaderArr); TSDB_CHECK_CODE(code, lino, _exit); SSttSegReader *segReader; @@ -450,7 +450,7 @@ static int32_t tsdbMergeFileSetEndCloseIter(SMerger *merger) { } static int32_t tsdbMergeFileSetEndCloseReader(SMerger *merger) { - TARRAY2_CLEAR(merger->sttReaderArr, tsdbSttFReaderClose); + TARRAY2_CLEAR(merger->sttReaderArr, tsdbSttFileReaderClose); return 0; } diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c b/source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c index ed094298fd..af4ba579c7 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c +++ b/source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c @@ -84,7 +84,7 @@ static int32_t tsdbSttSegReaderClose(SSttSegReader **reader) { return 0; } -int32_t tsdbSttFReaderOpen(const char *fname, const SSttFileReaderConfig *config, SSttFileReader **reader) { +int32_t tsdbSttFileReaderOpen(const char *fname, const SSttFileReaderConfig *config, SSttFileReader **reader) { int32_t code = 0; int32_t lino = 0; int32_t vid = TD_VID(config->tsdb->pVnode); @@ -117,12 +117,12 @@ int32_t tsdbSttFReaderOpen(const char *fname, const SSttFileReaderConfig *config _exit: if (code) { tsdbError("vgId:%d %s failed at line %d since %s", vid, __func__, lino, tstrerror(code)); - tsdbSttFReaderClose(reader); + tsdbSttFileReaderClose(reader); } return code; } -int32_t tsdbSttFReaderClose(SSttFileReader **reader) { +int32_t tsdbSttFileReaderClose(SSttFileReader **reader) { tsdbCloseFile(&reader[0]->fd); TARRAY2_CLEAR_FREE(reader[0]->readerArray, tsdbSttSegReaderClose); taosMemoryFree(reader[0]); @@ -130,13 +130,13 @@ int32_t tsdbSttFReaderClose(SSttFileReader **reader) { return 0; } -int32_t tsdbSttFReaderGetSegReader(SSttFileReader *reader, const TSttSegReaderArray **readerArray) { +int32_t tsdbSttFileReaderGetSegReader(SSttFileReader *reader, const TSttSegReaderArray **readerArray) { readerArray[0] = reader->readerArray; return 0; } // SSttFSegReader -int32_t tsdbSttFReadStatisBlk(SSttSegReader *reader, const TStatisBlkArray **statisBlkArray) { +int32_t tsdbSttFileReadStatisBlk(SSttSegReader *reader, const TStatisBlkArray **statisBlkArray) { if (!reader->ctx.statisBlkLoaded) { if (reader->footer->statisBlkPtr->size > 0) { ASSERT(reader->footer->statisBlkPtr->size % sizeof(STbStatisBlk) == 0); @@ -161,7 +161,7 @@ int32_t tsdbSttFReadStatisBlk(SSttSegReader *reader, const TStatisBlkArray **sta return 0; } -int32_t tsdbSttFReadDelBlk(SSttSegReader *reader, const TDelBlkArray **delBlkArray) { +int32_t tsdbSttFileReadDelBlk(SSttSegReader *reader, const TDelBlkArray **delBlkArray) { if (!reader->ctx.delBlkLoaded) { if (reader->footer->delBlkPtr->size > 0) { ASSERT(reader->footer->delBlkPtr->size % sizeof(SDelBlk) == 0); @@ -186,7 +186,7 @@ int32_t tsdbSttFReadDelBlk(SSttSegReader *reader, const TDelBlkArray **delBlkArr return 0; } -int32_t tsdbSttFReadSttBlk(SSttSegReader *reader, const TSttBlkArray **sttBlkArray) { +int32_t tsdbSttFileReadSttBlk(SSttSegReader *reader, const TSttBlkArray **sttBlkArray) { if (!reader->ctx.sttBlkLoaded) { if (reader->footer->sttBlkPtr->size > 0) { ASSERT(reader->footer->sttBlkPtr->size % sizeof(SSttBlk) == 0); @@ -211,13 +211,13 @@ int32_t tsdbSttFReadSttBlk(SSttSegReader *reader, const TSttBlkArray **sttBlkArr return 0; } -int32_t tsdbSttFReadSttBlock(SSttSegReader *reader, const SSttBlk *sttBlk, SBlockData *bData) { +int32_t tsdbSttFileReadSttBlock(SSttSegReader *reader, const SSttBlk *sttBlk, SBlockData *bData) { int32_t code = 0; // TODO return code; } -int32_t tsdbSttFReadDelBlock(SSttSegReader *reader, const SDelBlk *delBlk, SDelBlock *dData) { +int32_t tsdbSttFileReadDelBlock(SSttSegReader *reader, const SDelBlk *delBlk, SDelBlock *dData) { int32_t code = 0; int32_t lino = 0; int32_t vid = TD_VID(reader->reader->config->tsdb->pVnode); @@ -246,7 +246,7 @@ _exit: return code; } -int32_t tsdbSttFReadStatisBlock(SSttSegReader *reader, const STbStatisBlk *statisBlk, STbStatisBlock *sData) { +int32_t tsdbSttFileReadStatisBlock(SSttSegReader *reader, const STbStatisBlk *statisBlk, STbStatisBlock *sData) { int32_t code = 0; int32_t lino = 0; int32_t vid = TD_VID(reader->reader->config->tsdb->pVnode); -- GitLab