diff --git a/src/vnode/tsdb/inc/tsdb.h b/src/vnode/tsdb/inc/tsdb.h index ed6bb044c6c4f7c70f01a8ebedef9f034194df93..5c458989bc19e847080dedac28aaf2512c6d9e06 100644 --- a/src/vnode/tsdb/inc/tsdb.h +++ b/src/vnode/tsdb/inc/tsdb.h @@ -101,8 +101,6 @@ SDataRow tsdbGetSubmitBlkNext(SSubmitBlkIter *pIter); #define TSDB_SUBMIT_MSG_HEAD_SIZE sizeof(SSubmitMsg) -struct STsdbRepo; - // SSubmitMsg Iterator typedef struct { int32_t totalLen; @@ -328,7 +326,7 @@ SArray *tsdbGetTableList(tsdb_query_handle_t *pQueryHandle); * @param pTagCond. tag query condition * */ -SArray *tsdbQueryTableList(struct STsdbRepo* tsdb, int64_t uid, const wchar_t *pTagCond, size_t len); +SArray *tsdbQueryTableList(tsdb_repo_t* tsdb, int64_t uid, const wchar_t *pTagCond, size_t len); #ifdef __cplusplus } diff --git a/src/vnode/tsdb/inc/tsdbCache.h b/src/vnode/tsdb/inc/tsdbCache.h deleted file mode 100644 index 3e9eabc90d0eb2b177e7da19ef6af892f064c23d..0000000000000000000000000000000000000000 --- a/src/vnode/tsdb/inc/tsdbCache.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -#if !defined(_TD_TSDBCACHE_H_) -#define _TD_TSDBCACHE_H_ - -#include - -#include "taosdef.h" -#include "tlist.h" -#include "tsdb.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define TSDB_DEFAULT_CACHE_BLOCK_SIZE 16 * 1024 * 1024 /* 16M */ - -typedef struct { - int blockId; - int offset; - int remain; - int padding; - char data[]; -} STsdbCacheBlock; - -typedef struct { - int64_t index; - SList * memPool; -} STsdbCachePool; - -typedef struct { - TSKEY keyFirst; - TSKEY keyLast; - int64_t numOfPoints; - SList * list; -} SCacheMem; - -typedef struct { - int maxBytes; - int cacheBlockSize; - int totalCacheBlocks; - STsdbCachePool pool; - STsdbCacheBlock *curBlock; - SCacheMem * mem; - SCacheMem * imem; - tsdb_repo_t * pRepo; -} STsdbCache; - -STsdbCache *tsdbInitCache(int maxBytes, int cacheBlockSize, tsdb_repo_t *pRepo); -void tsdbFreeCache(STsdbCache *pCache); -void * tsdbAllocFromCache(STsdbCache *pCache, int bytes, TSKEY key); - -#ifdef __cplusplus -} -#endif - -#endif // _TD_TSDBCACHE_H_ diff --git a/src/vnode/tsdb/inc/tsdbFile.h b/src/vnode/tsdb/inc/tsdbMain.h similarity index 52% rename from src/vnode/tsdb/inc/tsdbFile.h rename to src/vnode/tsdb/inc/tsdbMain.h index 6c42d4aa155addfd1daa8d9d98319dec9bff748d..1fd3a9912523445cdb98df3a71915bb4759c0038 100644 --- a/src/vnode/tsdb/inc/tsdbFile.h +++ b/src/vnode/tsdb/inc/tsdbMain.h @@ -12,20 +12,160 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -#if !defined(_TD_TSDB_FILE_H_) -#define _TD_TSDB_FILE_H_ +#ifndef _TD_TSDB_MAIN_H_ +#define _TD_TSDB_MAIN_H_ -#include - -#include "dataformat.h" -#include "taosdef.h" -#include "tglobalcfg.h" #include "tsdb.h" +#include "tlist.h" +#include "tglobalcfg.h" +#include "tskiplist.h" +#include "tutil.h" #ifdef __cplusplus extern "C" { #endif +// ------------------------------ TSDB META FILE INTERFACES ------------------------------ +#define TSDB_META_FILE_NAME "META" +#define TSDB_META_HASH_FRACTION 1.1 + +typedef int (*iterFunc)(void *, void *cont, int contLen); +typedef void (*afterFunc)(void *); + +typedef struct { + int fd; // File descriptor + int nDel; // number of deletions + int tombSize; // deleted size + int64_t size; // Total file size + void * map; // Map from uid ==> position + iterFunc iFunc; + afterFunc aFunc; + void * appH; +} SMetaFile; + +SMetaFile *tsdbInitMetaFile(char *rootDir, int32_t maxTables, iterFunc iFunc, afterFunc aFunc, void *appH); +int32_t tsdbInsertMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t contLen); +int32_t tsdbDeleteMetaRecord(SMetaFile *mfh, int64_t uid); +int32_t tsdbUpdateMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t contLen); +void tsdbCloseMetaFile(SMetaFile *mfh); + +// ------------------------------ TSDB META INTERFACES ------------------------------ +#define IS_CREATE_STABLE(pCfg) ((pCfg)->tagValues != NULL) + +typedef struct { + TSKEY keyFirst; + TSKEY keyLast; + int32_t numOfPoints; + void * pData; +} SMemTable; + +// ---------- TSDB TABLE DEFINITION +typedef struct STable { + int8_t type; + STableId tableId; + int64_t superUid; // Super table UID + int32_t sversion; + STSchema * schema; + STSchema * tagSchema; + SDataRow tagVal; + SMemTable * mem; + SMemTable * imem; + void * pIndex; // For TSDB_SUPER_TABLE, it is the skiplist index + void * eventHandler; // TODO + void * streamHandler; // TODO + struct STable *next; // TODO: remove the next +} STable; + +void * tsdbEncodeTable(STable *pTable, int *contLen); +STable *tsdbDecodeTable(void *cont, int contLen); +void * tsdbFreeEncode(void *cont); + +// ---------- TSDB META HANDLE DEFINITION +typedef struct { + int32_t maxTables; // Max number of tables + + int32_t nTables; // Tables created + + STable **tables; // table array + + STable *superList; // super table list TODO: change it to list container + + void *map; // table map of (uid ===> table) + + SMetaFile *mfh; // meta file handle + int maxRowBytes; + int maxCols; +} STsdbMeta; + +STsdbMeta *tsdbInitMeta(const char *rootDir, int32_t maxTables); +int32_t tsdbFreeMeta(STsdbMeta *pMeta); +STSchema * tsdbGetTableSchema(STsdbMeta *pMeta, STable *pTable); + +// ---- Operation on STable +#define TSDB_TABLE_ID(pTable) ((pTable)->tableId) +#define TSDB_TABLE_UID(pTable) ((pTable)->uid) +#define TSDB_TABLE_NAME(pTable) ((pTable)->tableName) +#define TSDB_TABLE_TYPE(pTable) ((pTable)->type) +#define TSDB_TABLE_SUPER_TABLE_UID(pTable) ((pTable)->stableUid) +#define TSDB_TABLE_IS_SUPER_TABLE(pTable) (TSDB_TABLE_TYPE(pTable) == TSDB_SUPER_TABLE) +#define TSDB_TABLE_TAG_VALUE(pTable) ((pTable)->pTagVal) +#define TSDB_TABLE_CACHE_DATA(pTable) ((pTable)->content.pData) +#define TSDB_SUPER_TABLE_INDEX(pTable) ((pTable)->content.pIndex) + +// ---- Operation on SMetaHandle +#define TSDB_NUM_OF_TABLES(pHandle) ((pHandle)->numOfTables) +#define TSDB_NUM_OF_SUPER_TABLES(pHandle) ((pHandle)->numOfSuperTables) +#define TSDB_TABLE_OF_ID(pHandle, id) ((pHandle)->pTables)[id] +#define TSDB_GET_TABLE_OF_NAME(pHandle, name) /* TODO */ + +STsdbMeta* tsdbGetMeta(tsdb_repo_t* pRepo); + +int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg); +int32_t tsdbDropTableImpl(STsdbMeta *pMeta, STableId tableId); +STable *tsdbIsValidTableToInsert(STsdbMeta *pMeta, STableId tableId); +// int32_t tsdbInsertRowToTableImpl(SSkipListNode *pNode, STable *pTable); +STable *tsdbGetTableByUid(STsdbMeta *pMeta, int64_t uid); +char *getTupleKey(const void * data); + +// ------------------------------ TSDB CACHE INTERFACES ------------------------------ +#define TSDB_DEFAULT_CACHE_BLOCK_SIZE 16 * 1024 * 1024 /* 16M */ + +typedef struct { + int blockId; + int offset; + int remain; + int padding; + char data[]; +} STsdbCacheBlock; + +typedef struct { + int64_t index; + SList * memPool; +} STsdbCachePool; + +typedef struct { + TSKEY keyFirst; + TSKEY keyLast; + int64_t numOfPoints; + SList * list; +} SCacheMem; + +typedef struct { + int maxBytes; + int cacheBlockSize; + int totalCacheBlocks; + STsdbCachePool pool; + STsdbCacheBlock *curBlock; + SCacheMem * mem; + SCacheMem * imem; + tsdb_repo_t * pRepo; +} STsdbCache; + +STsdbCache *tsdbInitCache(int maxBytes, int cacheBlockSize, tsdb_repo_t *pRepo); +void tsdbFreeCache(STsdbCache *pCache); +void * tsdbAllocFromCache(STsdbCache *pCache, int bytes, TSKEY key); + +// ------------------------------ TSDB FILE INTERFACES ------------------------------ #define TSDB_FILE_HEAD_SIZE 512 #define TSDB_FILE_DELIMITER 0xF00AFA0F @@ -174,11 +314,41 @@ int tsdbLoadDataBlock(SFile *pFile, SCompBlock *pStartBlock, int numOfBlocks, SD SFileGroup *tsdbSearchFGroup(STsdbFileH *pFileH, int fid); -// TODO: need an API to merge all sub-block data into one - void tsdbGetKeyRangeOfFileId(int32_t daysPerFile, int8_t precision, int32_t fileId, TSKEY *minKey, TSKEY *maxKey); + +// TSDB repository definition +typedef struct _tsdb_repo { + char *rootDir; + // TSDB configuration + STsdbCfg config; + + // The meter meta handle of this TSDB repository + STsdbMeta *tsdbMeta; + + // The cache Handle + STsdbCache *tsdbCache; + + // The TSDB file handle + STsdbFileH *tsdbFileH; + + // Disk tier handle for multi-tier storage + void *diskTier; + + pthread_mutex_t mutex; + + int commit; + pthread_t commitThread; + + // A limiter to monitor the resources used by tsdb + void *limiter; + + int8_t state; + +} STsdbRepo; + + #ifdef __cplusplus } #endif -#endif // _TD_TSDB_FILE_H_ +#endif \ No newline at end of file diff --git a/src/vnode/tsdb/inc/tsdbMeta.h b/src/vnode/tsdb/inc/tsdbMeta.h deleted file mode 100644 index aa25e0844456f6ebf8bea6fc40eacc179ffd9d7f..0000000000000000000000000000000000000000 --- a/src/vnode/tsdb/inc/tsdbMeta.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -#if !defined(_TSDB_META_H_) -#define _TSDB_META_H_ - -#include - -#include "tsdb.h" -#include "dataformat.h" -#include "tskiplist.h" -#include "tsdbMetaFile.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// #include "taosdef.h" - -// Initially, there are 4 tables -#define TSDB_INIT_NUMBER_OF_SUPER_TABLE 4 - -#define IS_CREATE_STABLE(pCfg) ((pCfg)->tagValues != NULL) - -typedef struct { - TSKEY keyFirst; - TSKEY keyLast; - int32_t numOfPoints; - void * pData; -} SMemTable; - -// ---------- TSDB TABLE DEFINITION -typedef struct STable { - int8_t type; - STableId tableId; - int64_t superUid; // Super table UID - int32_t sversion; - STSchema * schema; - STSchema * tagSchema; - SDataRow tagVal; - SMemTable * mem; - SMemTable * imem; - void * pIndex; // For TSDB_SUPER_TABLE, it is the skiplist index - void * eventHandler; // TODO - void * streamHandler; // TODO - struct STable *next; // TODO: remove the next -} STable; - -void * tsdbEncodeTable(STable *pTable, int *contLen); -STable *tsdbDecodeTable(void *cont, int contLen); -void * tsdbFreeEncode(void *cont); - -// ---------- TSDB META HANDLE DEFINITION -typedef struct { - int32_t maxTables; // Max number of tables - - int32_t nTables; // Tables created - - STable **tables; // table array - - STable *superList; // super table list TODO: change it to list container - - void *map; // table map of (uid ===> table) - - SMetaFile *mfh; // meta file handle - int maxRowBytes; - int maxCols; -} STsdbMeta; - -STsdbMeta *tsdbInitMeta(const char *rootDir, int32_t maxTables); -int32_t tsdbFreeMeta(STsdbMeta *pMeta); -STSchema * tsdbGetTableSchema(STsdbMeta *pMeta, STable *pTable); - -// ---- Operation on STable -#define TSDB_TABLE_ID(pTable) ((pTable)->tableId) -#define TSDB_TABLE_UID(pTable) ((pTable)->uid) -#define TSDB_TABLE_NAME(pTable) ((pTable)->tableName) -#define TSDB_TABLE_TYPE(pTable) ((pTable)->type) -#define TSDB_TABLE_SUPER_TABLE_UID(pTable) ((pTable)->stableUid) -#define TSDB_TABLE_IS_SUPER_TABLE(pTable) (TSDB_TABLE_TYPE(pTable) == TSDB_SUPER_TABLE) -#define TSDB_TABLE_TAG_VALUE(pTable) ((pTable)->pTagVal) -#define TSDB_TABLE_CACHE_DATA(pTable) ((pTable)->content.pData) -#define TSDB_SUPER_TABLE_INDEX(pTable) ((pTable)->content.pIndex) - -// ---- Operation on SMetaHandle -#define TSDB_NUM_OF_TABLES(pHandle) ((pHandle)->numOfTables) -#define TSDB_NUM_OF_SUPER_TABLES(pHandle) ((pHandle)->numOfSuperTables) -#define TSDB_TABLE_OF_ID(pHandle, id) ((pHandle)->pTables)[id] -#define TSDB_GET_TABLE_OF_NAME(pHandle, name) /* TODO */ - -STsdbMeta* tsdbGetMeta(tsdb_repo_t* pRepo); - -int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg); -int32_t tsdbDropTableImpl(STsdbMeta *pMeta, STableId tableId); -STable *tsdbIsValidTableToInsert(STsdbMeta *pMeta, STableId tableId); -// int32_t tsdbInsertRowToTableImpl(SSkipListNode *pNode, STable *pTable); -STable *tsdbGetTableByUid(STsdbMeta *pMeta, int64_t uid); -char *getTupleKey(const void * data); - -#ifdef __cplusplus -} -#endif - -#endif // _TSDB_META_H_ \ No newline at end of file diff --git a/src/vnode/tsdb/inc/tsdbMetaFile.h b/src/vnode/tsdb/inc/tsdbMetaFile.h deleted file mode 100644 index a0cf2a005cd549acd4500bd20f811d3b1afcbd3d..0000000000000000000000000000000000000000 --- a/src/vnode/tsdb/inc/tsdbMetaFile.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TSDB_META_FILE_ -#define _TSDB_META_FILE_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define TSDB_META_FILE_NAME "META" -#define TSDB_META_HASH_FRACTION 1.1 - -typedef int (*iterFunc)(void *, void *cont, int contLen); -typedef void (*afterFunc)(void *); - -typedef struct { - int fd; // File descriptor - int nDel; // number of deletions - int tombSize; // deleted size - int64_t size; // Total file size - void * map; // Map from uid ==> position - iterFunc iFunc; - afterFunc aFunc; - void * appH; -} SMetaFile; - -SMetaFile *tsdbInitMetaFile(char *rootDir, int32_t maxTables, iterFunc iFunc, afterFunc aFunc, void *appH); -int32_t tsdbInsertMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t contLen); -int32_t tsdbDeleteMetaRecord(SMetaFile *mfh, int64_t uid); -int32_t tsdbUpdateMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t contLen); -void tsdbCloseMetaFile(SMetaFile *mfh); - -#ifdef __cplusplus -} -#endif - -#endif // _TSDB_META_FILE_ \ No newline at end of file diff --git a/src/vnode/tsdb/src/tsdbCache.c b/src/vnode/tsdb/src/tsdbCache.c index d64b98d49dbcd7c7f76a7fe4c914a975c82c4658..1ca1128d8c6c43bc96d0f821be6e464103b199a4 100644 --- a/src/vnode/tsdb/src/tsdbCache.c +++ b/src/vnode/tsdb/src/tsdbCache.c @@ -15,7 +15,7 @@ #include #include "tsdb.h" -#include "tsdbCache.h" +#include "tsdbMain.h" static int tsdbAllocBlockFromPool(STsdbCache *pCache); static void tsdbFreeBlockList(SList *list); diff --git a/src/vnode/tsdb/src/tsdbFile.c b/src/vnode/tsdb/src/tsdbFile.c index d6964112e7fef975aaf0b34c67faefe268fdab4e..208ebf16531b7cb36052369bbe92be81dec14656 100644 --- a/src/vnode/tsdb/src/tsdbFile.c +++ b/src/vnode/tsdb/src/tsdbFile.c @@ -23,7 +23,7 @@ #include #include "tutil.h" -#include "tsdbFile.h" +#include "tsdbMain.h" const char *tsdbFileSuffix[] = { ".head", // TSDB_FILE_TYPE_HEAD diff --git a/src/vnode/tsdb/src/tsdbMain.c b/src/vnode/tsdb/src/tsdbMain.c index 6510c0294024f9ff08aba279822f488a20a0576c..cb69ff452885ca702a829958a9767edb437cdb6c 100644 --- a/src/vnode/tsdb/src/tsdbMain.c +++ b/src/vnode/tsdb/src/tsdbMain.c @@ -14,11 +14,7 @@ // #include "taosdef.h" // #include "disk.h" #include "tsdb.h" -#include "tsdbCache.h" -#include "tsdbFile.h" -#include "tsdbMeta.h" -#include "tutil.h" -#include "tskiplist.h" +#include "tsdbMain.h" #define TSDB_DEFAULT_PRECISION TSDB_PRECISION_MILLI // default precision #define IS_VALID_PRECISION(precision) (((precision) >= TSDB_PRECISION_MILLI) && ((precision) <= TSDB_PRECISION_NANO)) @@ -50,35 +46,6 @@ enum { TSDB_REPO_STATE_ACTIVE, TSDB_REPO_STATE_CLOSED, TSDB_REPO_STATE_CONFIGURING }; -typedef struct _tsdb_repo { - char *rootDir; - // TSDB configuration - STsdbCfg config; - - // The meter meta handle of this TSDB repository - STsdbMeta *tsdbMeta; - - // The cache Handle - STsdbCache *tsdbCache; - - // The TSDB file handle - STsdbFileH *tsdbFileH; - - // Disk tier handle for multi-tier storage - void *diskTier; - - pthread_mutex_t mutex; - - int commit; - pthread_t commitThread; - - // A limiter to monitor the resources used by tsdb - void *limiter; - - int8_t state; - -} STsdbRepo; - static int32_t tsdbCheckAndSetDefaultCfg(STsdbCfg *pCfg); static int32_t tsdbSetRepoEnv(STsdbRepo *pRepo); static int32_t tsdbDestroyRepoEnv(STsdbRepo *pRepo); diff --git a/src/vnode/tsdb/src/tsdbMeta.c b/src/vnode/tsdb/src/tsdbMeta.c index 12e2dbcb56cba5a070fff65bcb3b0a790501ac36..254119880f3a1408aa8c0367084ed263551c483a 100644 --- a/src/vnode/tsdb/src/tsdbMeta.c +++ b/src/vnode/tsdb/src/tsdbMeta.c @@ -4,9 +4,8 @@ #include "tskiplist.h" #include "tsdb.h" #include "taosdef.h" -#include "tsdbMeta.h" #include "hash.h" -#include "tsdbCache.h" +#include "tsdbMain.h" #define TSDB_SUPER_TABLE_SL_LEVEL 5 // TODO: may change here #define TSDB_META_FILE_NAME "META" diff --git a/src/vnode/tsdb/src/tsdbMetaFile.c b/src/vnode/tsdb/src/tsdbMetaFile.c index 2a32283c06dd50cf3637745816379e07f51f3b84..767be6affe7a487759ca6ee773d8905ed6d414dd 100644 --- a/src/vnode/tsdb/src/tsdbMetaFile.c +++ b/src/vnode/tsdb/src/tsdbMetaFile.c @@ -16,7 +16,7 @@ #include "taosdef.h" #include "hash.h" -#include "tsdbMetaFile.h" +#include "tsdbMain.h" #define TSDB_META_FILE_VERSION_MAJOR 1 #define TSDB_META_FILE_VERSION_MINOR 0 diff --git a/src/vnode/tsdb/src/tsdbRead.c b/src/vnode/tsdb/src/tsdbRead.c index 2919b2cf9e9229ecc7bf558cb484833d5dc2cb28..d4b6c2e8b6684748b91033cad8dbbbfe8bd8fd17 100644 --- a/src/vnode/tsdb/src/tsdbRead.c +++ b/src/vnode/tsdb/src/tsdbRead.c @@ -21,8 +21,7 @@ #include "../../../query/inc/qast.h" #include "../../../query/inc/tsqlfunction.h" #include "tsdb.h" -#include "tsdbFile.h" -#include "tsdbMeta.h" +#include "tsdbMain.h" #define EXTRA_BYTES 2 #define PRIMARY_TSCOL_REQUIRED(c) (((SColumnInfoEx *)taosArrayGet(c, 0))->info.colId == PRIMARYKEY_TIMESTAMP_COL_INDEX) @@ -112,7 +111,7 @@ enum { }; typedef struct STsdbQueryHandle { - struct STsdbRepo* pTsdb; + STsdbRepo* pTsdb; int8_t model; // access model, single table model or multi-table model SQueryFilePos cur; // current position SQueryFilePos start; // the start position, used for secondary/third iteration @@ -809,7 +808,7 @@ tsdb_query_handle_t *tsdbQueryFromTagConds(STsdbQueryCond *pCond, int16_t stable SArray *tsdbGetTableList(tsdb_query_handle_t *pQueryHandle) {} -static SArray* createTableIdArrayList(struct STsdbRepo* tsdb, int64_t uid) { +static SArray* createTableIdArrayList(STsdbRepo* tsdb, int64_t uid) { STable* pTable = tsdbGetTableByUid(tsdbGetMeta(tsdb), uid); assert(pTable != NULL); //assert pTable is a super table @@ -1118,7 +1117,8 @@ static int32_t doQueryTableList(STable* pSTable, SArray* pRes, const char* pCond return TSDB_CODE_SUCCESS; } -SArray *tsdbQueryTableList(struct STsdbRepo* tsdb, int64_t uid, const wchar_t *pTagCond, size_t len) { +// SArray *tsdbQueryTableList(struct STsdbRepo* tsdb, int64_t uid, const wchar_t *pTagCond, size_t len) { +SArray *tsdbQueryTableList(tsdb_repo_t* tsdb, int64_t uid, const wchar_t *pTagCond, size_t len) { // no condition, all tables created according to the stable will involved in querying if (pTagCond == NULL || wcslen(pTagCond) == 0) { return createTableIdArrayList(tsdb, uid); diff --git a/src/vnode/tsdb/tests/tsdbTests.cpp b/src/vnode/tsdb/tests/tsdbTests.cpp index 9849ffe8fa7c8ec1b1fa160c8feff06371cb9c60..1df023d07eb59f1e7e08015256c1ef0961d7ff50 100644 --- a/src/vnode/tsdb/tests/tsdbTests.cpp +++ b/src/vnode/tsdb/tests/tsdbTests.cpp @@ -4,8 +4,7 @@ #include "tsdb.h" #include "dataformat.h" -#include "tsdbFile.h" -#include "tsdbMeta.h" +#include "tsdbMain.h" double getCurTime() { struct timeval tv;