refact more
This commit is contained in:
parent
788267b5b1
commit
79e23420b4
|
@ -464,10 +464,6 @@ struct SDelData {
|
|||
struct SDelIdx {
|
||||
tb_uid_t suid;
|
||||
tb_uid_t uid;
|
||||
TSKEY minKey;
|
||||
TSKEY maxKey;
|
||||
int64_t minVersion;
|
||||
int64_t maxVersion;
|
||||
int64_t offset;
|
||||
int64_t size;
|
||||
};
|
||||
|
|
|
@ -168,10 +168,6 @@ static int32_t tsdbCommitTableDel(SCommitter *pCommitter, STbData *pTbData, SDel
|
|||
delIdx.suid = pDelIdx->suid;
|
||||
delIdx.uid = pDelIdx->uid;
|
||||
}
|
||||
delIdx.minKey = TSKEY_MAX;
|
||||
delIdx.maxKey = TSKEY_MIN;
|
||||
delIdx.minVersion = INT64_MAX;
|
||||
delIdx.maxVersion = INT64_MIN;
|
||||
|
||||
// start
|
||||
tMapDataReset(&pCommitter->oDelDataMap);
|
||||
|
@ -189,11 +185,6 @@ static int32_t tsdbCommitTableDel(SCommitter *pCommitter, STbData *pTbData, SDel
|
|||
|
||||
code = tMapDataPutItem(&pCommitter->nDelDataMap, pDelData, tPutDelData);
|
||||
if (code) goto _err;
|
||||
|
||||
if (delIdx.minKey > pDelData->sKey) delIdx.minKey = pDelData->sKey;
|
||||
if (delIdx.maxKey < pDelData->eKey) delIdx.maxKey = pDelData->eKey;
|
||||
if (delIdx.minVersion > pDelData->version) delIdx.minVersion = pDelData->version;
|
||||
if (delIdx.maxVersion < pDelData->version) delIdx.maxVersion = pDelData->version;
|
||||
}
|
||||
|
||||
// memory
|
||||
|
@ -201,11 +192,6 @@ static int32_t tsdbCommitTableDel(SCommitter *pCommitter, STbData *pTbData, SDel
|
|||
for (; pDelData; pDelData = pDelData->pNext) {
|
||||
code = tMapDataPutItem(&pCommitter->nDelDataMap, pDelData, tPutDelData);
|
||||
if (code) goto _err;
|
||||
|
||||
if (delIdx.minKey > pDelData->sKey) delIdx.minKey = pDelData->sKey;
|
||||
if (delIdx.maxKey < pDelData->eKey) delIdx.maxKey = pDelData->eKey;
|
||||
if (delIdx.minVersion > pDelData->version) delIdx.minVersion = pDelData->version;
|
||||
if (delIdx.maxVersion < pDelData->version) delIdx.maxVersion = pDelData->version;
|
||||
}
|
||||
|
||||
ASSERT(pCommitter->nDelDataMap.nItem > 0);
|
||||
|
|
|
@ -571,10 +571,6 @@ int32_t tPutDelIdx(uint8_t *p, void *ph) {
|
|||
|
||||
n += tPutI64(p ? p + n : p, pDelIdx->suid);
|
||||
n += tPutI64(p ? p + n : p, pDelIdx->uid);
|
||||
n += tPutI64(p ? p + n : p, pDelIdx->minKey);
|
||||
n += tPutI64(p ? p + n : p, pDelIdx->maxKey);
|
||||
n += tPutI64v(p ? p + n : p, pDelIdx->minVersion);
|
||||
n += tPutI64v(p ? p + n : p, pDelIdx->maxVersion);
|
||||
n += tPutI64v(p ? p + n : p, pDelIdx->offset);
|
||||
n += tPutI64v(p ? p + n : p, pDelIdx->size);
|
||||
|
||||
|
@ -587,10 +583,6 @@ int32_t tGetDelIdx(uint8_t *p, void *ph) {
|
|||
|
||||
n += tGetI64(p + n, &pDelIdx->suid);
|
||||
n += tGetI64(p + n, &pDelIdx->uid);
|
||||
n += tGetI64(p + n, &pDelIdx->minKey);
|
||||
n += tGetI64(p + n, &pDelIdx->maxKey);
|
||||
n += tGetI64v(p + n, &pDelIdx->minVersion);
|
||||
n += tGetI64v(p + n, &pDelIdx->maxVersion);
|
||||
n += tGetI64v(p + n, &pDelIdx->offset);
|
||||
n += tGetI64v(p + n, &pDelIdx->size);
|
||||
|
||||
|
|
|
@ -304,18 +304,17 @@ void vnodeUpdateMetaRsp(SVnode *pVnode, STableMetaRsp *pMetaRsp) {
|
|||
pMetaRsp->precision = pVnode->config.tsdbCfg.precision;
|
||||
}
|
||||
|
||||
static int32_t vnodeProcessDropTtlTbReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp){
|
||||
|
||||
static int32_t vnodeProcessDropTtlTbReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp) {
|
||||
SArray *tbUids = taosArrayInit(8, sizeof(int64_t));
|
||||
if (tbUids == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
||||
int32_t t = ntohl(*(int32_t*)pReq);
|
||||
int32_t t = ntohl(*(int32_t *)pReq);
|
||||
vError("rec ttl time:%d", t);
|
||||
int32_t ret = metaTtlDropTable(pVnode->pMeta, t, tbUids);
|
||||
if(ret != 0){
|
||||
if (ret != 0) {
|
||||
goto end;
|
||||
}
|
||||
if(taosArrayGetSize(tbUids) > 0){
|
||||
if (taosArrayGetSize(tbUids) > 0) {
|
||||
tqUpdateTbUidList(pVnode->pTq, tbUids, false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue