提交 06db5c54 编写于 作者: S slguan

super table sdb

上级 95f748ca
...@@ -150,17 +150,13 @@ typedef struct SSuperTableObj { ...@@ -150,17 +150,13 @@ typedef struct SSuperTableObj {
int32_t vgId; int32_t vgId;
int64_t createdTime; int64_t createdTime;
int32_t sversion; int32_t sversion;
int32_t numOfTags; int32_t numOfTables;
int32_t numOfMeters;
int32_t numOfColumns; int32_t numOfColumns;
int32_t schemaSize; int32_t numOfTags;
int8_t reserved[7]; int8_t reserved[7];
int8_t updateEnd[1]; int8_t updateEnd[1];
pthread_rwlock_t rwLock;
int16_t nextColId; int16_t nextColId;
SSchema *schema;
int8_t *schema;
} SSuperTableObj; } SSuperTableObj;
typedef struct { typedef struct {
...@@ -244,7 +240,6 @@ typedef struct _db_obj { ...@@ -244,7 +240,6 @@ typedef struct _db_obj {
char reserved[16]; char reserved[16];
char updateEnd[1]; char updateEnd[1];
STabObj * pMetric;
struct _db_obj *prev, *next; struct _db_obj *prev, *next;
SVgObj * pHead; // empty vgroup first SVgObj * pHead; // empty vgroup first
SVgObj * pTail; // empty vgroup end SVgObj * pTail; // empty vgroup end
......
...@@ -31,7 +31,7 @@ void mgmtCleanUpSuperTables(); ...@@ -31,7 +31,7 @@ void mgmtCleanUpSuperTables();
int32_t mgmtCreateSuperTable(SDbObj *pDb, SCreateTableMsg *pCreate); int32_t mgmtCreateSuperTable(SDbObj *pDb, SCreateTableMsg *pCreate);
int32_t mgmtDropSuperTable(SDbObj *pDb, SSuperTableObj *pTable); int32_t mgmtDropSuperTable(SDbObj *pDb, SSuperTableObj *pTable);
SSuperTableObj* mgmtGetSuperTable(char *tableId); SSuperTableObj* mgmtGetSuperTable(char *tableId);
int32_t mgmtFindTagCol(SSuperTableObj *pTable, const char *tagName); int32_t mgmtFindSuperTableTagIndex(SSuperTableObj *pTable, const char *tagName);
int32_t mgmtAddSuperTableTag(SSuperTableObj *pTable, SSchema schema[], int32_t ntags); int32_t mgmtAddSuperTableTag(SSuperTableObj *pTable, SSchema schema[], int32_t ntags);
int32_t mgmtDropSuperTableTag(SSuperTableObj *pTable, char *tagName); int32_t mgmtDropSuperTableTag(SSuperTableObj *pTable, char *tagName);
int32_t mgmtModifySuperTableTagNameByName(SSuperTableObj *pTable, char *oldTagName, char *newTagName); int32_t mgmtModifySuperTableTagNameByName(SSuperTableObj *pTable, char *oldTagName, char *newTagName);
...@@ -40,9 +40,6 @@ int32_t mgmtDropSuperTableColumnByName(SSuperTableObj *pTable, char *col ...@@ -40,9 +40,6 @@ int32_t mgmtDropSuperTableColumnByName(SSuperTableObj *pTable, char *col
SSchema* mgmtGetSuperTableSchema(SSuperTableObj *pTable); SSchema* mgmtGetSuperTableSchema(SSuperTableObj *pTable);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -36,10 +36,9 @@ int32_t mgmtAlterTable(SDbObj *pDb, SAlterTableMsg *pAlter); ...@@ -36,10 +36,9 @@ int32_t mgmtAlterTable(SDbObj *pDb, SAlterTableMsg *pAlter);
int32_t mgmtGetTableMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn); int32_t mgmtGetTableMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn);
int32_t mgmtRetrieveTables(SShowObj *pShow, char *data, int32_t rows, SConnObj *pConn); int32_t mgmtRetrieveTables(SShowObj *pShow, char *data, int32_t rows, SConnObj *pConn);
void mgmtCleanUpMeters(); void mgmtCleanUpMeters();
SSchema *mgmtGetTableSchema(STabObj *pTable); // get schema for a meter
int32_t mgmtAddMeterIntoMetric(STabObj *pMetric, STabObj *pTable); int32_t mgmtAddMeterIntoMetric(SSuperTableObj *pMetric, SChildTableObj *pTable);
int32_t mgmtRemoveMeterFromMetric(STabObj *pMetric, STabObj *pTable); int32_t mgmtRemoveMeterFromMetric(SSuperTableObj *pMetric, SChildTableObj *pTable);
int32_t mgmtGetSuperTableMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn); int32_t mgmtGetSuperTableMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn);
int32_t mgmtRetrieveSuperTables(SShowObj *pShow, char *data, int32_t rows, SConnObj *pConn); int32_t mgmtRetrieveSuperTables(SShowObj *pShow, char *data, int32_t rows, SConnObj *pConn);
......
...@@ -323,7 +323,7 @@ SChildTableObj* mgmtGetChildTable(char *tableId) { ...@@ -323,7 +323,7 @@ SChildTableObj* mgmtGetChildTable(char *tableId) {
} }
int32_t mgmtModifyChildTableTagValueByName(SChildTableObj *pTable, char *tagName, char *nContent) { int32_t mgmtModifyChildTableTagValueByName(SChildTableObj *pTable, char *tagName, char *nContent) {
// int col = mgmtFindTagCol(pTable->superTable, tagName); // int col = mgmtFindSuperTableTagIndex(pTable->superTable, tagName);
// if (col < 0 || col > pTable->superTable->numOfTags) { // if (col < 0 || col > pTable->superTable->numOfTags) {
// return TSDB_CODE_APP_ERROR; // return TSDB_CODE_APP_ERROR;
// } // }
......
...@@ -86,7 +86,6 @@ int32_t mgmtInitDbs() { ...@@ -86,7 +86,6 @@ int32_t mgmtInitDbs() {
pDb->numOfMetrics = 0; pDb->numOfMetrics = 0;
pDb->vgStatus = TSDB_VG_STATUS_READY; pDb->vgStatus = TSDB_VG_STATUS_READY;
pDb->vgTimer = NULL; pDb->vgTimer = NULL;
pDb->pMetric = NULL;
pAcct = mgmtGetAcct(pDb->cfg.acct); pAcct = mgmtGetAcct(pDb->cfg.acct);
if (pAcct != NULL) if (pAcct != NULL)
mgmtAddDbIntoAcct(pAcct, pDb); mgmtAddDbIntoAcct(pAcct, pDb);
...@@ -265,12 +264,12 @@ bool mgmtCheckDropDbFinished(SDbObj *pDb) { ...@@ -265,12 +264,12 @@ bool mgmtCheckDropDbFinished(SDbObj *pDb) {
void mgmtDropDbFromSdb(SDbObj *pDb) { void mgmtDropDbFromSdb(SDbObj *pDb) {
while (pDb->pHead) mgmtDropVgroup(pDb, pDb->pHead); while (pDb->pHead) mgmtDropVgroup(pDb, pDb->pHead);
STabObj *pMetric = pDb->pMetric; // SSuperTableObj *pMetric = pDb->pSTable;
while (pMetric) { // while (pMetric) {
STabObj *pNext = pMetric->next; // SSuperTableObj *pNext = pMetric->next;
mgmtDropTable(pDb, pMetric->meterId, 0); // mgmtDropTable(pDb, pMetric->meterId, 0);
pMetric = pNext; // pMetric = pNext;
} // }
mPrint("db:%s all meters drop finished", pDb->name); mPrint("db:%s all meters drop finished", pDb->name);
sdbDeleteRow(tsDbSdb, pDb); sdbDeleteRow(tsDbSdb, pDb);
...@@ -734,7 +733,6 @@ void *mgmtDbActionInsert(void *row, char *str, int32_t size, int32_t *ssize) { ...@@ -734,7 +733,6 @@ void *mgmtDbActionInsert(void *row, char *str, int32_t size, int32_t *ssize) {
pDb->numOfVgroups = 0; pDb->numOfVgroups = 0;
pDb->numOfTables = 0; pDb->numOfTables = 0;
pDb->vgTimer = NULL; pDb->vgTimer = NULL;
pDb->pMetric = NULL;
mgmtAddDbIntoAcct(pAcct, pDb); mgmtAddDbIntoAcct(pAcct, pDb);
return NULL; return NULL;
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册