more
This commit is contained in:
parent
3198baec27
commit
2ad90daa5f
|
@ -4,10 +4,53 @@
|
||||||
|
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
|
|
||||||
typedef struct STable
|
typedef enum {
|
||||||
{
|
TSDB_TABLE_NORMAL,
|
||||||
STableId tid;
|
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;
|
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
|
||||||
|
{
|
||||||
|
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;
|
} STable;
|
||||||
|
|
||||||
#define TSDB_GET_TABLE_ID(pTable) (((STable *)pTable)->tid).tableId
|
#define TSDB_GET_TABLE_ID(pTable) (((STable *)pTable)->tid).tableId
|
||||||
|
|
|
@ -34,6 +34,10 @@ typedef struct STSDBRepo
|
||||||
*/
|
*/
|
||||||
void *pSTableDict;
|
void *pSTableDict;
|
||||||
|
|
||||||
|
/* File Store
|
||||||
|
*/
|
||||||
|
void *pFileStore;
|
||||||
|
|
||||||
pthread_mutext_t tsdbMutex;
|
pthread_mutext_t tsdbMutex;
|
||||||
|
|
||||||
} STSDBRepo;
|
} STSDBRepo;
|
||||||
|
|
|
@ -1,6 +1,2 @@
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
|
|
||||||
typedef struct STable
|
|
||||||
{
|
|
||||||
/* data */
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in New Issue