tglobal.h 4.9 KB
Newer Older
H
hzcheng 已提交
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/>.
 */

16 17
#ifndef _TD_COMMON_GLOBAL_H_
#define _TD_COMMON_GLOBAL_H_
H
Hongze Cheng 已提交
18

S
Shengliang Guan 已提交
19
#include "tarray.h"
20
#include "tconfig.h"
21
#include "tdef.h"
S
Shengliang Guan 已提交
22

H
hzcheng 已提交
23 24 25 26
#ifdef __cplusplus
extern "C" {
#endif

S
Shengliang Guan 已提交
27
// cluster
S
Shengliang Guan 已提交
28 29 30 31 32 33 34
extern char     tsFirst[];
extern char     tsSecond[];
extern char     tsLocalFqdn[];
extern char     tsLocalEp[];
extern uint16_t tsServerPort;
extern int32_t  tsVersion;
extern int32_t  tsStatusInterval;
35
extern int32_t  tsNumOfSupportVnodes;
S
Shengliang Guan 已提交
36

S
Shengliang Guan 已提交
37
// common
S
Shengliang Guan 已提交
38 39 40 41 42 43 44 45
extern int32_t tsMaxShellConns;
extern int32_t tsShellActivityTimer;
extern int32_t tsCompressMsgSize;
extern int32_t tsCompressColData;
extern int32_t tsMaxNumOfDistinctResults;
extern int32_t tsCompatibleModel;
extern bool    tsEnableSlaveQuery;
extern bool    tsPrintAuth;
46
extern int64_t tsTickPerMin[3];
S
Shengliang Guan 已提交
47

48 49
extern int32_t tsCountAlwaysReturnValue;

S
Shengliang Guan 已提交
50
// multi-process
51
extern int32_t tsMultiProcess;
S
Shengliang Guan 已提交
52 53 54 55 56
extern int32_t tsMnodeShmSize;
extern int32_t tsVnodeShmSize;
extern int32_t tsQnodeShmSize;
extern int32_t tsSnodeShmSize;
extern int32_t tsBnodeShmSize;
57
extern int32_t tsNumOfShmThreads;
S
Shengliang Guan 已提交
58

S
Shengliang Guan 已提交
59 60 61 62
// queue & threads
extern int32_t tsNumOfRpcThreads;
extern int32_t tsNumOfCommitThreads;
extern int32_t tsNumOfTaskQueueThreads;
S
Shengliang Guan 已提交
63
extern int32_t tsNumOfMnodeQueryThreads;
D
dapan1121 已提交
64
extern int32_t tsNumOfMnodeFetchThreads;
S
Shengliang Guan 已提交
65 66
extern int32_t tsNumOfMnodeReadThreads;
extern int32_t tsNumOfVnodeQueryThreads;
S
Shengliang Guan 已提交
67
extern int32_t tsNumOfVnodeStreamThreads;
S
Shengliang Guan 已提交
68 69 70
extern int32_t tsNumOfVnodeFetchThreads;
extern int32_t tsNumOfVnodeWriteThreads;
extern int32_t tsNumOfVnodeSyncThreads;
S
Shengliang Guan 已提交
71 72
extern int32_t tsNumOfQnodeQueryThreads;
extern int32_t tsNumOfQnodeFetchThreads;
S
Shengliang Guan 已提交
73 74
extern int32_t tsNumOfSnodeSharedThreads;
extern int32_t tsNumOfSnodeUniqueThreads;
75
extern int64_t tsRpcQueueMemoryAllowed;
S
Shengliang Guan 已提交
76

S
monitor  
Shengliang Guan 已提交
77 78 79 80 81
// monitor
extern bool     tsEnableMonitor;
extern int32_t  tsMonitorInterval;
extern char     tsMonitorFqdn[];
extern uint16_t tsMonitorPort;
S
monitor  
Shengliang Guan 已提交
82
extern int32_t  tsMonitorMaxLogs;
S
Shengliang Guan 已提交
83
extern bool     tsMonitorComp;
S
monitor  
Shengliang Guan 已提交
84

S
Shengliang Guan 已提交
85 86 87 88 89 90
// telem
extern bool     tsEnableTelem;
extern int32_t  tsTelemInterval;
extern char     tsTelemServer[];
extern uint16_t tsTelemPort;

S
Shengliang Guan 已提交
91 92 93
// query buffer management
extern int32_t tsQueryBufferSize;  // maximum allowed usage buffer size in MB for each data node during query processing
extern int64_t tsQueryBufferSizeBytes;   // maximum allowed usage buffer size in byte for each data node
S
Shengliang Guan 已提交
94 95 96
extern bool    tsRetrieveBlockingModel;  // retrieve threads will be blocked
extern bool    tsKeepOriginalColumnName;
extern bool    tsDeadLockKillQuery;
H
Haojun Liao 已提交
97

X
Xiaoyu Wang 已提交
98 99
// query client
extern int32_t tsQueryPolicy;
X
Xiaoyu Wang 已提交
100
extern int32_t tsQuerySmaOptimize;
X
Xiaoyu Wang 已提交
101

S
Shengliang Guan 已提交
102 103 104 105 106
// client
extern int32_t tsMinSlidingTime;
extern int32_t tsMinIntervalTime;
extern int32_t tsMaxStreamComputDelay;
extern int32_t tsStreamCompStartDelay;
107
extern int32_t tsRetryStreamCompDelay;
S
Shengliang Guan 已提交
108 109
extern float   tsStreamComputDelayRatio;  // the delayed computing ration of the whole time window
extern int64_t tsMaxRetentWindow;
H
hzcheng 已提交
110

S
Shengliang Guan 已提交
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
// build info
extern char version[];
extern char compatible_version[];
extern char gitinfo[];
extern char buildinfo[];

// lossy
extern char     tsLossyColumns[];
extern double   tsFPrecision;
extern double   tsDPrecision;
extern uint32_t tsMaxRange;
extern uint32_t tsCurRange;
extern char     tsCompressor[];

// tfs
extern int32_t  tsDiskCfgNum;
extern SDiskCfg tsDiskCfg[];

S
slzhou 已提交
129
// udf
130
extern bool tsStartUdfd;
S
slzhou 已提交
131

132 133
// schemaless
extern char tsSmlChildTableName[];
134
extern char tsSmlTagName[];
135
extern bool tsSmlDataFormat;
136

137 138 139
// internal
extern int32_t tsTransPullupInterval;
extern int32_t tsMqRebalanceInterval;
wmmhello's avatar
wmmhello 已提交
140
extern int32_t tsTtlUnit;
wmmhello's avatar
wmmhello 已提交
141
extern int32_t tsTtlPushInterval;
C
Cary Xu 已提交
142
extern int32_t tsGrantHBInterval;
143

H
hjxilinx 已提交
144 145
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)

146 147 148 149
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd,
                      const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc);
int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile, char *apolloUrl, SArray *pArgs,
                    bool tsc);
S
Shengliang Guan 已提交
150 151
void    taosCleanupCfg();
void    taosCfgDynamicOptions(const char *option, const char *value);
wafwerar's avatar
wafwerar 已提交
152
void    taosAddDataDir(int32_t index, char *v1, int32_t level, int32_t primary);
S
TD-1767  
Shengliang Guan 已提交
153

S
Shengliang Guan 已提交
154
struct SConfig *taosGetCfg();
155

S
Shengliang Guan 已提交
156 157
void    taosSetAllDebugFlag(int32_t flag);
void    taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal);
158
int32_t taosSetCfg(SConfig *pCfg, char *name);
S
Shengliang Guan 已提交
159

H
hzcheng 已提交
160 161 162 163
#ifdef __cplusplus
}
#endif

164
#endif /*_TD_COMMON_GLOBAL_H_*/