• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #3798

31 Mar 2025 10:39AM UTC coverage: 9.424% (-20.9%) from 30.372%
#3798

push

travis-ci

happyguoxy
test:add test cases

21549 of 307601 branches covered (7.01%)

Branch coverage included in aggregate %.

36084 of 303967 relevant lines covered (11.87%)

58620.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/source/dnode/mgmt/mgmt_qnode/src/qmInt.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http:www.gnu.org/licenses/>.
14
 */
15

16
#define _DEFAULT_SOURCE
17
#include "qmInt.h"
18
#include "libs/function/tudf.h"
19

20
static int32_t qmRequire(const SMgmtInputOpt *pInput, bool *required) {
×
21
  return dmReadFile(pInput->path, pInput->name, required);
×
22
}
23

24
static void qmInitOption(SQnodeMgmt *pMgmt, SQnodeOpt *pOption) { pOption->msgCb = pMgmt->msgCb; }
×
25

26
static void qmClose(SQnodeMgmt *pMgmt) {
×
27
  if (pMgmt->pQnode != NULL) {
×
28
    qmStopWorker(pMgmt);
×
29
    qndClose(pMgmt->pQnode);
×
30
    pMgmt->pQnode = NULL;
×
31
  }
32

33
  taosMemoryFree(pMgmt);
×
34
}
×
35

36
static int32_t qndOpenWrapper(SQnodeOpt *pOption, SQnode **pQnode) {
×
37
  int32_t code = qndOpen(pOption, pQnode);
×
38
  return code;
×
39
}
40
static int32_t qmOpen(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
×
41
  int32_t     code = 0;
×
42
  SQnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SQnodeMgmt));
×
43
  if (pMgmt == NULL) {
×
44
    return terrno;
×
45
  }
46

47
  pMgmt->pData = pInput->pData;
×
48
  pMgmt->path = pInput->path;
×
49
  pMgmt->name = pInput->name;
×
50
  pMgmt->msgCb = pInput->msgCb;
×
51
  pMgmt->msgCb.putToQueueFp = (PutToQueueFp)qmPutRpcMsgToQueue;
×
52
  pMgmt->msgCb.qsizeFp = (GetQueueSizeFp)qmGetQueueSize;
×
53
  pMgmt->msgCb.mgmt = pMgmt;
×
54

55
  SQnodeOpt option = {0};
×
56
  qmInitOption(pMgmt, &option);
×
57

58
  code = qndOpenWrapper(&option, &pMgmt->pQnode);
×
59
  if (code != 0) {
×
60
    dError("failed to open qnode since %s", tstrerror(code));
×
61
    qmClose(pMgmt);
×
62
    return code;
×
63
  }
64
  tmsgReportStartup("qnode-impl", "initialized");
×
65

66
  if ((code = udfcOpen()) != 0) {
×
67
    dError("qnode can not open udfc");
×
68
    qmClose(pMgmt);
×
69
    return code;
×
70
  }
71

72
  if ((code = qmStartWorker(pMgmt)) != 0) {
×
73
    dError("failed to start qnode worker since %s", tstrerror(code));
×
74
    qmClose(pMgmt);
×
75
    return code;
×
76
  }
77
  tmsgReportStartup("qnode-worker", "initialized");
×
78

79
  pOutput->pMgmt = pMgmt;
×
80
  return code;
×
81
}
82

83
SMgmtFunc qmGetMgmtFunc() {
×
84
  SMgmtFunc mgmtFunc = {0};
×
85
  mgmtFunc.openFp = qmOpen;
×
86
  mgmtFunc.closeFp = (NodeCloseFp)qmClose;
×
87
  mgmtFunc.createFp = (NodeCreateFp)qmProcessCreateReq;
×
88
  mgmtFunc.dropFp = (NodeDropFp)qmProcessDropReq;
×
89
  mgmtFunc.requiredFp = qmRequire;
×
90
  mgmtFunc.getHandlesFp = qmGetMsgHandles;
×
91

92
  return mgmtFunc;
×
93
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc