diff --git a/src/vnode/cache/inc/cache.h b/src/vnode/cache/inc/cache.h new file mode 100644 index 0000000000000000000000000000000000000000..45b0e0c8007771dd4d0c27dd5a0e9c25026dc94e --- /dev/null +++ b/src/vnode/cache/inc/cache.h @@ -0,0 +1,14 @@ +#if !defined(_TD_CACHE_H_) +#define _TD_CACHE_H_ + +typedef void cache_pool_t; + +typedef struct SCacheBlock +{ + + SCacheBlock *next; +} SCacheBlock; + + + +#endif // _TD_CACHE_H_ diff --git a/src/vnode/tsdb/inc/tsdb.h b/src/vnode/tsdb/inc/tsdb.h index b52344145074b7410b33e57a48db2e6a42c98b5b..2117c951ca8b74d1d850d92fc2cd418146c32a76 100644 --- a/src/vnode/tsdb/inc/tsdb.h +++ b/src/vnode/tsdb/inc/tsdb.h @@ -1,3 +1,6 @@ +/************************************** + * FOR OUTSIDE USAGE + **************************************/ #if !defined(_TD_TSDB_H_) #define _TD_TSDB_H_ diff --git a/src/vnode/tsdb/inc/tsdbMeta.h b/src/vnode/tsdb/inc/tsdbMeta.h new file mode 100644 index 0000000000000000000000000000000000000000..27072a300344fbd47c90105472e59a167ce94618 --- /dev/null +++ b/src/vnode/tsdb/inc/tsdbMeta.h @@ -0,0 +1,16 @@ +/************************************ + * For internal usage + ************************************/ + +#include "tsdb.h" + +typedef struct STable +{ + STableId tid; + char *tableName; +} STable; + +#define TSDB_GET_TABLE_ID(pTable) (((STable *)pTable)->tid).tableId +#define TSDB_GET_TABLE_UID(pTable) (((STable *)pTable)->tid).uid + +#define TSDB_IS_SUPER_TABLE(pTable) diff --git a/src/vnode/tsdb/src/tsdb.c b/src/vnode/tsdb/src/tsdb.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..911ee3bd9475b9978fef0456e2805c3ed04d85d4 100644 --- a/src/vnode/tsdb/src/tsdb.c +++ b/src/vnode/tsdb/src/tsdb.c @@ -0,0 +1,42 @@ +#include +#include + +#include "tsdb.h" +#include "disk.h" +#include "cache.h" + +typedef struct STSDBRepo +{ + // TSDB configuration + STSDBcfg *pCfg; + + /* Disk tier handle for multi-tier storage + * + * The handle is responsible for dealing with object-oriented + * storage. + */ + SDiskTier *pDiskTier; + + /* Cache block list + */ + SCacheBlock *pCacheBloclList; + + /* Map from tableId-->STable + */ + STable *pTableList; + + /* Map from tableName->tableId + * TODO: may use dict + */ + void *pTableDict; + + /* Map from super tableName->table + */ + void *pSTableDict; + + pthread_mutext_t tsdbMutex; + +} STSDBRepo; + +#define TSDB_GET_TABLE_BY_ID(pRepo, sid) (((STSDBRepo *)pRepo)->pTableList)[sid] +#define TSDB_GET_TABLE_BY_NAME(pRepo, name) diff --git a/src/vnode/tsdb/src/tsdbMeta.c b/src/vnode/tsdb/src/tsdbMeta.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2d13a2218df28e6b433cac6ed7b229138dc1cea9 100644 --- a/src/vnode/tsdb/src/tsdbMeta.c +++ b/src/vnode/tsdb/src/tsdbMeta.c @@ -0,0 +1,6 @@ +#include "tsdb.h" + +typedef struct STable +{ + /* data */ +};