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

super table sdb

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