dnode.h 1.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * 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 <http://www.gnu.org/licenses/>.
 */

S
Shengliang Guan 已提交
16 17
#ifndef _TD_DNODE_H_
#define _TD_DNODE_H_
18

S
Shengliang Guan 已提交
19 20
#include "tdef.h"

21 22 23 24
#ifdef __cplusplus
extern "C" {
#endif

S
Shengliang Guan 已提交
25 26
/* ------------------------ TYPES EXPOSED ------------------------ */
typedef struct SDnode SDnode;
27

S
Shengliang Guan 已提交
28
typedef struct {
S
Shengliang Guan 已提交
29
  int32_t  sver;
S
Shengliang Guan 已提交
30 31
  int32_t  numOfCores;
  int32_t  numOfSupportVnodes;
S
Shengliang Guan 已提交
32
  int16_t  numOfCommitThreads;
S
Shengliang Guan 已提交
33
  int8_t   enableTelem;
S
Shengliang Guan 已提交
34 35 36 37 38
  int32_t  statusInterval;
  float    numOfThreadsPerCore;
  float    ratioOfQueryCores;
  int32_t  maxShellConns;
  int32_t  shellActivityTimer;
S
Shengliang Guan 已提交
39
  uint16_t serverPort;
S
Shengliang Guan 已提交
40 41 42 43 44 45 46
  char     dataDir[TSDB_FILENAME_LEN];
  char     localEp[TSDB_EP_LEN];
  char     localFqdn[TSDB_FQDN_LEN];
  char     firstEp[TSDB_EP_LEN];
  char     timezone[TSDB_TIMEZONE_LEN];
  char     locale[TSDB_LOCALE_LEN];
  char     charset[TSDB_LOCALE_LEN];
S
Shengliang Guan 已提交
47 48
  char     buildinfo[64];
  char     gitinfo[48];
S
Shengliang Guan 已提交
49 50
} SDnodeOpt;

S
Shengliang Guan 已提交
51 52 53 54
/* ------------------------ SDnode ------------------------ */
/**
 * @brief Initialize and start the dnode.
 *
S
Shengliang Guan 已提交
55
 * @param pOption Option of the dnode.
S
Shengliang Guan 已提交
56 57
 * @return SDnode* The dnode object.
 */
S
Shengliang Guan 已提交
58
SDnode *dndInit(SDnodeOpt *pOption);
S
Shengliang Guan 已提交
59 60

/**
61
 * @brief Stop and cleanup the dnode.
S
Shengliang Guan 已提交
62
 *
63
 * @param pDnode The dnode object to close.
S
Shengliang Guan 已提交
64
 */
65
void dndCleanup(SDnode *pDnode);
S
Shengliang Guan 已提交
66

67 68 69 70
#ifdef __cplusplus
}
#endif

S
Shengliang Guan 已提交
71
#endif /*_TD_DNODE_H_*/