chore: more code

This commit is contained in:
kailixu 2023-07-17 09:19:24 +08:00
parent 3ab2ad20b4
commit 0e6b982682
5 changed files with 13 additions and 3 deletions

View File

@ -34,6 +34,7 @@ extern char tsFirst[];
extern char tsSecond[]; extern char tsSecond[];
extern char tsLocalFqdn[]; extern char tsLocalFqdn[];
extern char tsLocalEp[]; extern char tsLocalEp[];
extern char tsVersionName[];
extern uint16_t tsServerPort; extern uint16_t tsServerPort;
extern int32_t tsVersion; extern int32_t tsVersion;
extern int32_t tsStatusInterval; extern int32_t tsStatusInterval;

View File

@ -1,4 +1,8 @@
aux_source_directory(src COMMON_SRC) aux_source_directory(src COMMON_SRC)
IF (TD_ENTERPRISE)
LIST(APPEND COMMON_SRC ${TD_ENTERPRISE_DIR}/src/plugins/common/src/tglobal.c)
ENDIF()
add_library(common STATIC ${COMMON_SRC}) add_library(common STATIC ${COMMON_SRC})
if (DEFINED GRANT_CFG_INCLUDE_DIR) if (DEFINED GRANT_CFG_INCLUDE_DIR)

View File

@ -34,6 +34,7 @@ char tsFirst[TSDB_EP_LEN] = {0};
char tsSecond[TSDB_EP_LEN] = {0}; char tsSecond[TSDB_EP_LEN] = {0};
char tsLocalFqdn[TSDB_FQDN_LEN] = {0}; char tsLocalFqdn[TSDB_FQDN_LEN] = {0};
char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port
char tsVersionName[16] = "community";
uint16_t tsServerPort = 6030; uint16_t tsServerPort = 6030;
int32_t tsVersion = 30000000; int32_t tsVersion = 30000000;
int32_t tsStatusInterval = 1; // second int32_t tsStatusInterval = 1; // second
@ -938,6 +939,12 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
return 0; return 0;
} }
#ifndef TD_ENTERPRISE
static int32_t taosSetReleaseCfg(SConfig *pCfg) { return 0; }
#else
int32_t taosSetReleaseCfg(SConfig *pCfg);
#endif
void taosLocalCfgForbiddenToChange(char *name, bool *forbidden) { void taosLocalCfgForbiddenToChange(char *name, bool *forbidden) {
int32_t len = strlen(name); int32_t len = strlen(name);
char lowcaseName[CFG_NAME_MAX_LEN + 1] = {0}; char lowcaseName[CFG_NAME_MAX_LEN + 1] = {0};
@ -1444,6 +1451,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
if (taosSetClientCfg(tsCfg)) return -1; if (taosSetClientCfg(tsCfg)) return -1;
if (taosUpdateServerCfg(tsCfg)) return -1; if (taosUpdateServerCfg(tsCfg)) return -1;
if (taosSetServerCfg(tsCfg)) return -1; if (taosSetServerCfg(tsCfg)) return -1;
if (taosSetReleaseCfg(tsCfg)) return -1;
if (taosSetTfsCfg(tsCfg) != 0) return -1; if (taosSetTfsCfg(tsCfg) != 0) return -1;
} }
taosSetSystemCfg(tsCfg); taosSetSystemCfg(tsCfg);

View File

@ -40,7 +40,6 @@
goto _exit; \ goto _exit; \
} while (0) } while (0)
extern char tsVersionName[16];
static SDnode globalDnode = {0}; static SDnode globalDnode = {0};
static const char *dmOS[10] = {"Ubuntu", "CentOS Linux", "Red Hat", "Debian GNU", "CoreOS", static const char *dmOS[10] = {"Ubuntu", "CentOS Linux", "Red Hat", "Debian GNU", "CoreOS",
"FreeBSD", "openSUSE", "SLES", "Fedora", "MacOS"}; "FreeBSD", "openSUSE", "SLES", "Fedora", "MacOS"};
@ -72,7 +71,6 @@ static int32_t dmInitMonitor() {
DM_INIT_MON(); DM_INIT_MON();
dInfo("%s:%d stName is %s", __func__, __LINE__, stName);
if (STR_STR_CMP(stName, STR_STR_SIGN)) { if (STR_STR_CMP(stName, STR_STR_SIGN)) {
DM_ERR_RTN(0); DM_ERR_RTN(0);
} }

View File

@ -20,7 +20,6 @@
#define CLUSTER_VER_NUMBE 1 #define CLUSTER_VER_NUMBE 1
#define CLUSTER_RESERVE_SIZE 60 #define CLUSTER_RESERVE_SIZE 60
char tsVersionName[16] = "community";
int64_t tsExpireTime = 0; int64_t tsExpireTime = 0;
static SSdbRaw *mndClusterActionEncode(SClusterObj *pCluster); static SSdbRaw *mndClusterActionEncode(SClusterObj *pCluster);