From 7f56ba6056a936dfd74c6c55ef868b9744c79d4b Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 4 Sep 2020 15:09:04 +0800 Subject: [PATCH] TD-1027 --- CMakeLists.txt | 1 + cmake/define.inc | 4 ++++ src/tsdb/inc/tsdbMain.h | 20 ++++++++++++++++++++ src/tsdb/src/tsdbScan.c | 24 +++++++++++++++++++++++- 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fee2e548a..946ceb95ab 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ ENDIF () SET(TD_ACCOUNT FALSE) SET(TD_ADMIN FALSE) SET(TD_GRANT FALSE) +SET(TD_TSDB_PLUGINS FALSE) SET(TD_COVER FALSE) SET(TD_MEM_CHECK FALSE) diff --git a/cmake/define.inc b/cmake/define.inc index 0a25dd9ee7..6dd604057c 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -13,6 +13,10 @@ IF (TD_GRANT) ADD_DEFINITIONS(-D_GRANT) ENDIF () +IF (TD_TSDB_PLUGINS) + ADD_DEFINITIONS(-D_TSDB_PLUGINS) +ENDIF () + IF (TD_GODLL) ADD_DEFINITIONS(-D_TD_GO_DLL_) ENDIF () diff --git a/src/tsdb/inc/tsdbMain.h b/src/tsdb/inc/tsdbMain.h index ede0b33d01..256b8189f8 100644 --- a/src/tsdb/inc/tsdbMain.h +++ b/src/tsdb/inc/tsdbMain.h @@ -320,6 +320,16 @@ typedef struct { void* compBuffer; // Buffer for temperary compress/decompress purpose } SRWHelper; +// ------------------ tsdbScan.c +typedef struct { + SFileGroup fGroup; + int numOfIdx; + SCompIdx* pCompIdx; + SCompInfo* pCompInfo; + void* pBuf; + FILE* tLogStream; +} STsdbScanHandle; + // Operations // ------------------ tsdbMeta.c #define TSDB_INIT_NTABLES 1024 @@ -552,6 +562,16 @@ STsdbMeta* tsdbGetMeta(TSDB_REPO_T* pRepo); STsdbFileH* tsdbGetFile(TSDB_REPO_T* pRepo); int tsdbCheckCommit(STsdbRepo* pRepo); +// ------------------ tsdbScan.c +int tsdbScanFGroup(STsdbScanHandle* pScanHandle, char* rootDir, int fid); +STsdbScanHandle* tsdbNewScanHandle(); +void tsdbSetScanLogStream(STsdbScanHandle* pScanHandle, FILE* fLogStream); +int tsdbSetAndOpenScanFile(STsdbScanHandle* pScanHandle, char* rootDir, int fid); +int tsdbScanSCompIdx(STsdbScanHandle* pScanHandle); +int tsdbScanSCompBlock(STsdbScanHandle* pScanHandle, int idx); +int tsdbCloseScanFile(STsdbScanHandle* pScanHandle); +void tsdbFreeScanHandle(STsdbScanHandle* pScanHandle); + #ifdef __cplusplus } #endif diff --git a/src/tsdb/src/tsdbScan.c b/src/tsdb/src/tsdbScan.c index 6dea4a4e57..98fe1fd444 100644 --- a/src/tsdb/src/tsdbScan.c +++ b/src/tsdb/src/tsdbScan.c @@ -11,4 +11,26 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - */ \ No newline at end of file + */ + +#include "tsdbMain.h" + +#ifndef _TSDB_PLUGINS + +int tsdbScanFGroup(STsdbScanHandle* pScanHandle, char* rootDir, int fid) { return 0; } + +STsdbScanHandle* tsdbNewScanHandle() { return NULL; } + +void tsdbSetScanLogStream(STsdbScanHandle* pScanHandle, FILE* fLogStream) {} + +int tsdbSetAndOpenScanFile(STsdbScanHandle* pScanHandle, char* rootDir, int fid) { return 0 } + +int tsdbScanSCompIdx(STsdbScanHandle* pScanHandle) { return 0; } + +int tsdbScanSCompBlock(STsdbScanHandle* pScanHandle, int idx) { return 0; } + +int tsdbCloseScanFile(STsdbScanHandle* pScanHandle) { return 0; } + +void tsdbFreeScanHandle(STsdbScanHandle* pScanHandle) {} + +#endif \ No newline at end of file -- GitLab