From 2ad90daa5fddffe5d24dabff756cbf45476e18c6 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 6 Feb 2020 16:42:39 +0800 Subject: [PATCH] more --- src/vnode/tsdb/inc/tsdbMeta.h | 47 +++++++++++++++++++++++++++++++++-- src/vnode/tsdb/src/tsdb.c | 4 +++ src/vnode/tsdb/src/tsdbMeta.c | 4 --- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/vnode/tsdb/inc/tsdbMeta.h b/src/vnode/tsdb/inc/tsdbMeta.h index 27072a3003..9ab39171a6 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 911ee3bd94..9d9fd64b06 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 2d13a2218d..c2a52c5026 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 */ -}; -- GitLab