diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fee2e548aaf66e0769a0da569c6d910969179ba..946ceb95aba3fefdcda62d6aa5f497a377e98124 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 0a25dd9ee71df0d16cdf921fde6a923529192421..6dd604057c06d504c881cf57018429c9694bc4b9 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 ede0b33d01d1e7735a5db469437aa572e19986ec..256b8189f8fc69345b27fdf702fb705d22ac3c10 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 6dea4a4e57392be988126c579648f39a8270b9bf..98fe1fd44436c65e6188a35908ba7a13d8fb46a2 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