From 799720ace3bba8526cefc813608b3c83a93e4874 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 21 Dec 2021 15:14:18 +0800 Subject: [PATCH] make compile --- include/dnode/vnode/vnode.h | 39 ++++++++++++++++--- .../dnode/vnode/impl/test/vnodeApiTests.cpp | 6 ++- source/dnode/vnode/tsdb/src/tsdbRecover.c | 14 ------- 3 files changed, 37 insertions(+), 22 deletions(-) delete mode 100644 source/dnode/vnode/tsdb/src/tsdbRecover.c diff --git a/include/dnode/vnode/vnode.h b/include/dnode/vnode/vnode.h index 081fcd7f7d..44feac87ab 100644 --- a/include/dnode/vnode/vnode.h +++ b/include/dnode/vnode/vnode.h @@ -170,14 +170,41 @@ typedef struct { char info[]; } SVnodeRsp; -#define VNODE_INIT_CREATE_STB_REQ(NAME, TTL, KEEP, SUID, PSCHEMA, PTAGSCHEMA) \ - { .ver = 0, .ctReq = META_INIT_STB_CFG(NAME, TTL, KEEP, SUID, PSCHEMA, PTAGSCHEMA) } +static FORCE_INLINE void vnodeSetCreateStbReq(SVnodeReq *pReq, char *name, uint32_t ttl, uint32_t keep, tb_uid_t suid, + STSchema *pSchema, STSchema *pTagSchema) { + pReq->ver = 0; + + pReq->ctReq.name = name; + pReq->ctReq.ttl = ttl; + pReq->ctReq.keep = keep; + pReq->ctReq.type = META_SUPER_TABLE; + pReq->ctReq.stbCfg.suid = suid; + pReq->ctReq.stbCfg.pSchema = pSchema; + pReq->ctReq.stbCfg.pTagSchema = pTagSchema; +} + +static FORCE_INLINE void vnodeSetCreateCtbReq(SVnodeReq *pReq, char *name, uint32_t ttl, uint32_t keep, tb_uid_t suid, + SKVRow pTag) { + pReq->ver = 0; -#define VNODE_INIT_CREATE_CTB_REQ(NAME, TTL, KEEP, SUID, PTAG) \ - { .ver = 0, .ctReq = META_INIT_CTB_CFG(NAME, TTL, KEEP, SUID, PTAG) } + pReq->ctReq.name = name; + pReq->ctReq.ttl = ttl; + pReq->ctReq.keep = keep; + pReq->ctReq.type = META_CHILD_TABLE; + pReq->ctReq.ctbCfg.suid = suid; + pReq->ctReq.ctbCfg.pTag = pTag; +} -#define VNODE_INIT_CREATE_NTB_REQ(NAME, TTL, KEEP, SUID, PSCHEMA) \ - { .ver = 0, .ctReq = META_INIT_NTB_CFG(NAME, TTL, KEEP, SUID, PSCHEMA) } +static FORCE_INLINE void vnodeSetCreateNtbReq(SVnodeReq *pReq, char *name, uint32_t ttl, uint32_t keep, + STSchema *pSchema) { + pReq->ver = 0; + + pReq->ctReq.name = name; + pReq->ctReq.ttl = ttl; + pReq->ctReq.keep = keep; + pReq->ctReq.type = META_NORMAL_TABLE; + pReq->ctReq.ntbCfg.pSchema = pSchema; +} int vnodeBuildReq(void **buf, const SVnodeReq *pReq, uint8_t type); void *vnodeParseReq(void *buf, SVnodeReq *pReq, uint8_t type); diff --git a/source/dnode/vnode/impl/test/vnodeApiTests.cpp b/source/dnode/vnode/impl/test/vnodeApiTests.cpp index cd920b3cf8..aa9fc741d9 100644 --- a/source/dnode/vnode/impl/test/vnodeApiTests.cpp +++ b/source/dnode/vnode/impl/test/vnodeApiTests.cpp @@ -81,7 +81,8 @@ static void vtBuildCreateStbReq(tb_uid_t suid, char *tbname, SRpcMsg **ppMsg) { pSchema = vtCreateBasicSchema(); pTagSchema = vtCreateBasicTagSchema(); - SVnodeReq vCreateSTbReq = VNODE_INIT_CREATE_STB_REQ(tbname, UINT32_MAX, UINT32_MAX, suid, pSchema, pTagSchema); + SVnodeReq vCreateSTbReq; + vnodeSetCreateStbReq(&vCreateSTbReq, tbname, UINT32_MAX, UINT32_MAX, suid, pSchema, pTagSchema); zs = vnodeBuildReq(NULL, &vCreateSTbReq, TSDB_MSG_TYPE_CREATE_TABLE); pMsg = (SRpcMsg *)malloc(sizeof(SRpcMsg) + zs); @@ -104,7 +105,8 @@ static void vtBuildCreateCtbReq(tb_uid_t suid, char *tbname, SRpcMsg **ppMsg) { int tz; SKVRow pTag = vtCreateBasicTag(); - SVnodeReq vCreateCTbReq = VNODE_INIT_CREATE_CTB_REQ(tbname, UINT32_MAX, UINT32_MAX, suid, pTag); + SVnodeReq vCreateCTbReq; + vnodeSetCreateCtbReq(&vCreateCTbReq, tbname, UINT32_MAX, UINT32_MAX, suid, pTag); tz = vnodeBuildReq(NULL, &vCreateCTbReq, TSDB_MSG_TYPE_CREATE_TABLE); pMsg = (SRpcMsg *)malloc(sizeof(SRpcMsg) + tz); diff --git a/source/dnode/vnode/tsdb/src/tsdbRecover.c b/source/dnode/vnode/tsdb/src/tsdbRecover.c deleted file mode 100644 index 6dea4a4e57..0000000000 --- a/source/dnode/vnode/tsdb/src/tsdbRecover.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ \ No newline at end of file -- GitLab