tglobal.h 3.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 20 21
#include "tarray.h"
#include "tdef.h"

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

S
Shengliang Guan 已提交
26
// cluster
S
Shengliang Guan 已提交
27 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;
extern bool     tsEnableTelemetryReporting;
S
Shengliang Guan 已提交
35

S
Shengliang Guan 已提交
36
// common
S
Shengliang Guan 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
extern int32_t tsRpcTimer;
extern int32_t tsRpcMaxTime;
extern bool    tsRpcForceTcp;  // all commands go to tcp protocol if this is enabled
extern int32_t tsMaxConnections;
extern int32_t tsMaxShellConns;
extern int32_t tsShellActivityTimer;
extern int32_t tsMaxTmrCtrl;
extern float   tsRatioOfQueryCores;
extern int32_t tsCompressMsgSize;
extern int32_t tsCompressColData;
extern int32_t tsMaxNumOfDistinctResults;
extern int32_t tsCompatibleModel;
extern bool    tsEnableSlaveQuery;
extern bool    tsPrintAuth;
extern int64_t tsTickPerDay[3];
S
Shengliang Guan 已提交
52 53

// multi-process
S
Shengliang Guan 已提交
54
extern bool    tsMultiProcess;
S
Shengliang Guan 已提交
55 56 57 58 59
extern int32_t tsMnodeShmSize;
extern int32_t tsVnodeShmSize;
extern int32_t tsQnodeShmSize;
extern int32_t tsSnodeShmSize;
extern int32_t tsBnodeShmSize;
S
Shengliang Guan 已提交
60

S
Shengliang Guan 已提交
61 62 63 64 65
// queue & threads
extern int32_t tsNumOfRpcThreads;
extern int32_t tsNumOfCommitThreads;
extern int32_t tsNumOfTaskQueueThreads;

S
monitor  
Shengliang Guan 已提交
66 67 68 69 70
// monitor
extern bool     tsEnableMonitor;
extern int32_t  tsMonitorInterval;
extern char     tsMonitorFqdn[];
extern uint16_t tsMonitorPort;
S
monitor  
Shengliang Guan 已提交
71
extern int32_t  tsMonitorMaxLogs;
S
Shengliang Guan 已提交
72
extern bool     tsMonitorComp;
S
monitor  
Shengliang Guan 已提交
73

S
Shengliang Guan 已提交
74 75 76
// 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 已提交
77 78 79
extern bool    tsRetrieveBlockingModel;  // retrieve threads will be blocked
extern bool    tsKeepOriginalColumnName;
extern bool    tsDeadLockKillQuery;
H
Haojun Liao 已提交
80

S
Shengliang Guan 已提交
81
// client
82
extern int32_t tsMaxWildCardsLen;
83
extern int32_t tsMaxRegexStringLen;
S
Shengliang Guan 已提交
84 85 86 87 88
extern int32_t tsMaxNumOfOrderedResults;
extern int32_t tsMinSlidingTime;
extern int32_t tsMinIntervalTime;
extern int32_t tsMaxStreamComputDelay;
extern int32_t tsStreamCompStartDelay;
89
extern int32_t tsRetryStreamCompDelay;
S
Shengliang Guan 已提交
90 91 92
extern float   tsStreamComputDelayRatio;  // the delayed computing ration of the whole time window
extern int32_t tsProjectExecInterval;
extern int64_t tsMaxRetentWindow;
H
hzcheng 已提交
93

S
Shengliang Guan 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
// 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[];

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

S
Shengliang Guan 已提交
114
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char *envFile,
S
Shengliang Guan 已提交
115 116
                      const char *apolloUrl, SArray *pArgs, bool tsc);
int32_t taosInitCfg(const char *cfgDir, const char *envFile, const char *apolloUrl, SArray *pArgs, bool tsc);
S
Shengliang Guan 已提交
117 118
void    taosCleanupCfg();
void    taosCfgDynamicOptions(const char *option, const char *value);
S
TD-1767  
Shengliang Guan 已提交
119

S
Shengliang Guan 已提交
120 121
struct SConfig *taosGetCfg();

H
hzcheng 已提交
122 123 124 125
#ifdef __cplusplus
}
#endif

126
#endif /*_TD_COMMON_GLOBAL_H_*/