From 35f8e5681e3ce4c1215ff55693fc2bba942d1f20 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 17 Sep 2020 16:39:20 +0800 Subject: [PATCH] add scan interface --- src/inc/tsdb.h | 8 ++++++++ src/tsdb/inc/tsdbMain.h | 10 ---------- src/tsdb/src/tsdbScan.c | 19 ++++--------------- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/src/inc/tsdb.h b/src/inc/tsdb.h index 85f9b3bdc7..f7bab2fd73 100644 --- a/src/inc/tsdb.h +++ b/src/inc/tsdb.h @@ -314,6 +314,14 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle); */ void tsdbReportStat(void *repo, int64_t *totalPoints, int64_t *totalStorage, int64_t *compStorage); +// ------------------ tsdbScan.c +typedef void *STsdbScanH; + +STsdbScanH tsdbNewScanHandle(); +void tsdbFreeScanHandle(STsdbScanH pScanH); +void tsdbSetScanLogStream(STsdbScanH pScanH, FILE *fLogStream); +int tsdbScanFGroup(STsdbScanH pScanH, char *rootDir, int fid); + #ifdef __cplusplus } #endif diff --git a/src/tsdb/inc/tsdbMain.h b/src/tsdb/inc/tsdbMain.h index 256b8189f8..aa4ffabd0e 100644 --- a/src/tsdb/inc/tsdbMain.h +++ b/src/tsdb/inc/tsdbMain.h @@ -562,16 +562,6 @@ 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 91f6787874..0f0d4bf529 100644 --- a/src/tsdb/src/tsdbScan.c +++ b/src/tsdb/src/tsdbScan.c @@ -17,20 +17,9 @@ #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) {} +STsdbScanH tsdbNewScanHandle() { return NULL; } +void tsdbFreeScanHandle(STsdbScanH pScanHandle) {} +void tsdbSetScanLogStream(STsdbScanH pScanHandle, FILE *fLogStream) { return; } +int tsdbScanFGroup(STsdbScanH pScanHandle, char *rootDir, int fid) { return 0; } #endif \ No newline at end of file -- GitLab