solve memory problem
This commit is contained in:
parent
5dc96f9de2
commit
1ab4f2c443
|
@ -102,9 +102,8 @@ static void vtBuildCreateStbReq(tb_uid_t suid, char *tbname, SRpcMsg **ppMsg) {
|
||||||
static void vtBuildCreateCtbReq(tb_uid_t suid, char *tbname, SRpcMsg **ppMsg) {
|
static void vtBuildCreateCtbReq(tb_uid_t suid, char *tbname, SRpcMsg **ppMsg) {
|
||||||
SRpcMsg *pMsg;
|
SRpcMsg *pMsg;
|
||||||
int tz;
|
int tz;
|
||||||
SKVRow pTag;
|
SKVRow pTag = vtCreateBasicTag();
|
||||||
|
|
||||||
pTag = vtCreateBasicTag();
|
|
||||||
SVnodeReq vCreateCTbReq = VNODE_INIT_CREATE_CTB_REQ(tbname, UINT32_MAX, UINT32_MAX, suid, pTag);
|
SVnodeReq vCreateCTbReq = VNODE_INIT_CREATE_CTB_REQ(tbname, UINT32_MAX, UINT32_MAX, suid, pTag);
|
||||||
|
|
||||||
tz = vnodeBuildReq(NULL, &vCreateCTbReq, TSDB_MSG_TYPE_CREATE_TABLE);
|
tz = vnodeBuildReq(NULL, &vCreateCTbReq, TSDB_MSG_TYPE_CREATE_TABLE);
|
||||||
|
@ -126,17 +125,33 @@ static void vtBuildCreateNtbReq(char *tbname, SRpcMsg **ppMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vtBuildSubmitReq(SRpcMsg **ppMsg) {
|
static void vtBuildSubmitReq(SRpcMsg **ppMsg) {
|
||||||
SRpcMsg *pMsg;
|
SRpcMsg * pMsg;
|
||||||
void * pBuf;
|
SSubmitMsg *pSubmitMsg;
|
||||||
int tz = 0;
|
SSubmitBlk *pSubmitBlk;
|
||||||
|
int tz = 1024; // TODO
|
||||||
|
|
||||||
pMsg = (SRpcMsg *)malloc(sizeof(*pMsg) + tz);
|
pMsg = (SRpcMsg *)malloc(sizeof(*pMsg) + tz);
|
||||||
pMsg->msgType = TSDB_MSG_TYPE_SUBMIT;
|
pMsg->msgType = TSDB_MSG_TYPE_SUBMIT;
|
||||||
pMsg->contLen = tz;
|
pMsg->contLen = tz;
|
||||||
pMsg->pCont = POINTER_SHIFT(pMsg, sizeof(*pMsg));
|
pMsg->pCont = POINTER_SHIFT(pMsg, sizeof(*pMsg));
|
||||||
|
|
||||||
pBuf = pMsg->pCont;
|
// For submit msg header
|
||||||
vnodeBuildReq(&pBuf, NULL /*TODO*/, TSDB_MSG_TYPE_SUBMIT);
|
pSubmitMsg = (SSubmitMsg *)(pMsg->pCont);
|
||||||
|
// pSubmitMsg->header.contLen = 0;
|
||||||
|
// pSubmitMsg->header.vgId = 0;
|
||||||
|
// pSubmitMsg->length = 0;
|
||||||
|
pSubmitMsg->numOfBlocks = 1;
|
||||||
|
|
||||||
|
// For submit blk
|
||||||
|
pSubmitBlk = (SSubmitBlk *)(pSubmitMsg->blocks);
|
||||||
|
pSubmitBlk->uid = 0;
|
||||||
|
pSubmitBlk->tid = 0;
|
||||||
|
pSubmitBlk->padding = 0;
|
||||||
|
pSubmitBlk->sversion = 0;
|
||||||
|
pSubmitBlk->dataLen = 0;
|
||||||
|
pSubmitBlk->numOfRows = 0;
|
||||||
|
|
||||||
|
// For row batch
|
||||||
|
|
||||||
*ppMsg = pMsg;
|
*ppMsg = pMsg;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue