more code
This commit is contained in:
parent
a72c49495b
commit
a16fcc5dea
|
@ -4546,8 +4546,8 @@ int32_t tSerializeSCompactVgroupsReq(void *buf, int32_t bufLen, SCompactVgroupsR
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
for (int32_t i = 0; i < taosArrayGetSize(pReq->vgroupIds); ++i) {
|
for (int32_t i = 0; i < taosArrayGetSize(pReq->vgroupIds); ++i) {
|
||||||
int32_t vgid = *(int32_t *)taosArrayGet(pReq->vgroupIds, i);
|
int64_t vgid = *(int64_t *)taosArrayGet(pReq->vgroupIds, i);
|
||||||
code = tEncodeI32(&encoder, vgid);
|
code = tEncodeI64v(&encoder, vgid);
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4588,15 +4588,15 @@ int32_t tDeserializeSCompactVgroupsReq(void *buf, int32_t bufLen, SCompactVgroup
|
||||||
code = tDecodeI32(&decoder, &vgidNum);
|
code = tDecodeI32(&decoder, &vgidNum);
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
pReq->vgroupIds = taosArrayInit(vgidNum, sizeof(int32_t));
|
pReq->vgroupIds = taosArrayInit(vgidNum, sizeof(int64_t));
|
||||||
if (NULL == pReq->vgroupIds) {
|
if (NULL == pReq->vgroupIds) {
|
||||||
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < vgidNum; ++i) {
|
for (int32_t i = 0; i < vgidNum; ++i) {
|
||||||
int32_t vgid;
|
int64_t vgid;
|
||||||
|
|
||||||
code = tDecodeI32(&decoder, &vgid);
|
code = tDecodeI64v(&decoder, &vgid);
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
if (taosArrayPush(pReq->vgroupIds, &vgid) == NULL) {
|
if (taosArrayPush(pReq->vgroupIds, &vgid) == NULL) {
|
||||||
|
|
|
@ -2117,6 +2117,7 @@ _err:
|
||||||
|
|
||||||
SNode* createCompactVgroupsStmt(SAstCreateContext* pCxt, SNodeList* vgidList, SNode* pStart, SNode* pEnd) {
|
SNode* createCompactVgroupsStmt(SAstCreateContext* pCxt, SNodeList* vgidList, SNode* pStart, SNode* pEnd) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
CHECK_NAME(checkDbName(pCxt, NULL, true));
|
||||||
SCompactVgroupsStmt* pStmt = NULL;
|
SCompactVgroupsStmt* pStmt = NULL;
|
||||||
pCxt->errCode = nodesMakeNode(QUERY_NODE_COMPACT_VGROUPS_STMT, (SNode**)&pStmt);
|
pCxt->errCode = nodesMakeNode(QUERY_NODE_COMPACT_VGROUPS_STMT, (SNode**)&pStmt);
|
||||||
CHECK_MAKE_NODE(pStmt);
|
CHECK_MAKE_NODE(pStmt);
|
||||||
|
|
|
@ -860,7 +860,6 @@ static int32_t collectMetaKeyFromCompactDatabase(SCollectMetaKeyCxt* pCxt, SComp
|
||||||
|
|
||||||
static int32_t collectMetaKeyFromCompactVgroups(SCollectMetaKeyCxt* pCxt, SCompactVgroupsStmt* pStmt) {
|
static int32_t collectMetaKeyFromCompactVgroups(SCollectMetaKeyCxt* pCxt, SCompactVgroupsStmt* pStmt) {
|
||||||
// TODO
|
// TODO
|
||||||
ASSERT(0);
|
|
||||||
return 0;
|
return 0;
|
||||||
// return reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache);
|
// return reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10436,9 +10436,32 @@ static int32_t translateCompactDb(STranslateContext* pCxt, SCompactDatabaseStmt*
|
||||||
static int32_t translateVgroupList(STranslateContext* pCxt, SNodeList* vgroupList, SArray** ppVgroups) {
|
static int32_t translateVgroupList(STranslateContext* pCxt, SNodeList* vgroupList, SArray** ppVgroups) {
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
|
|
||||||
// TODO
|
int32_t numOfVgroups = LIST_LENGTH(vgroupList);
|
||||||
ASSERT(0);
|
|
||||||
|
|
||||||
|
(*ppVgroups) = taosArrayInit(numOfVgroups, sizeof(int64_t));
|
||||||
|
if (NULL == *ppVgroups) {
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
|
|
||||||
|
SNode* pNode = NULL;
|
||||||
|
FOREACH(pNode, vgroupList) {
|
||||||
|
SValueNode* pVal = (SValueNode*)pNode;
|
||||||
|
if (DEAL_RES_ERROR == translateValue(pCxt, pVal)) {
|
||||||
|
code = TSDB_CODE_VND_INVALID_VGROUP_ID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t vgroupId = getBigintFromValueNode(pVal);
|
||||||
|
if (NULL == taosArrayPush(*ppVgroups, &vgroupId)) {
|
||||||
|
code = terrno;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (code) {
|
||||||
|
taosArrayDestroy(*ppVgroups);
|
||||||
|
*ppVgroups = NULL;
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue