diff --git a/src/vnode/tsdb/inc/tsdbMeta.h b/src/vnode/tsdb/inc/tsdbMeta.h index 27072a300344fbd47c90105472e59a167ce94618..9ab39171a6ebce27bed7a60d1d6f9f4a76797149 100644 --- a/src/vnode/tsdb/inc/tsdbMeta.h +++ b/src/vnode/tsdb/inc/tsdbMeta.h @@ -4,10 +4,53 @@ #include "tsdb.h" -typedef struct STable +typedef enum { + TSDB_TABLE_NORMAL, + TSDB_TABLE_STABLE, + TSDB_TABLE_SUPER +} TSDB_TABLE_TYPE; + +// Below is the struct definition of super table +// TODO: May merge all table definitions +typedef struct _super_table { + int64_t uid; + char *tableName; + + int64_t createdTime; + + // TODO: try to merge the two schema into one + SSchema *pSchema; + SSchema *pTagSchema; + + // A index created for all tables created using this super table + SSkipList * pIndex; +} SSTable; + +// Normal table struct definition, table not +// created from super table +typedef struct SNTable { - STableId tid; + tsdb_id_t tableId; + int64_t uid; char *tableName; + + int64_t createdTime; + SSchema *pSchema +} SNTable; + +// Table created from super table +typedef struct STable { + tsdb_id_t tableId; + int64_t uid; + char *tableName; + + int64_t createdTime; + + // super table UID + int64_t stableUid; + + // Tag values for this table + char *pTagVal; } STable; #define TSDB_GET_TABLE_ID(pTable) (((STable *)pTable)->tid).tableId diff --git a/src/vnode/tsdb/src/tsdb.c b/src/vnode/tsdb/src/tsdb.c index 911ee3bd9475b9978fef0456e2805c3ed04d85d4..9d9fd64b0670e252425d2c36354f35c64361535e 100644 --- a/src/vnode/tsdb/src/tsdb.c +++ b/src/vnode/tsdb/src/tsdb.c @@ -34,6 +34,10 @@ typedef struct STSDBRepo */ void *pSTableDict; + /* File Store + */ + void *pFileStore; + pthread_mutext_t tsdbMutex; } STSDBRepo; diff --git a/src/vnode/tsdb/src/tsdbMeta.c b/src/vnode/tsdb/src/tsdbMeta.c index 2d13a2218df28e6b433cac6ed7b229138dc1cea9..c2a52c5026a35fea6c6404dbe4a384bcc7ec8736 100644 --- a/src/vnode/tsdb/src/tsdbMeta.c +++ b/src/vnode/tsdb/src/tsdbMeta.c @@ -1,6 +1,2 @@ #include "tsdb.h" -typedef struct STable -{ - /* data */ -};