From bf8c64d3daeff907362805e06b492bb2ff04f340 Mon Sep 17 00:00:00 2001 From: tickduan <417921451@qq.com> Date: Thu, 22 Jul 2021 16:20:18 +0800 Subject: [PATCH] change config name --- src/common/inc/tglobal.h | 4 ++-- src/common/src/tglobal.c | 22 ++++++++-------------- src/mnode/src/mnodeDnode.c | 1 + src/util/src/tcompression.c | 2 +- src/util/src/tconfig.c | 3 +++ 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 30bbaaae73..19120bcad1 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -210,8 +210,8 @@ extern int32_t debugFlag; extern char lossyColumns[]; extern double fPrecision; extern double dPrecision; -extern uint32_t maxIntervals; -extern uint32_t intervals; +extern uint32_t maxRange; +extern uint32_t range; extern char Compressor[]; #endif diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index d4c52c9d1f..2acc5359a2 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -252,8 +252,8 @@ char lossyColumns[32] = ""; // "float|double" means all float and double column // below option can take effect when tsLossyColumns not empty double fPrecision = 1E-8; // float column precision double dPrecision = 1E-16; // double column precision -uint32_t maxIntervals = 500; // max intervals -uint32_t intervals = 100; // intervals +uint32_t maxRange = 500; // max range +uint32_t range = 100; // range char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESSOR #endif @@ -312,13 +312,7 @@ bool taosCfgDynamicOptions(char *msg) { int32_t cfgLen = (int32_t)strlen(cfg->option); if (cfgLen != olen) continue; - if (strncasecmp(option, cfg->option, olen) != 0) continue; - if (cfg->valType == TAOS_CFG_VTYPE_INT32) { - *((int32_t *)cfg->ptr) = vint; - } else { - *((int8_t *)cfg->ptr) = (int8_t)vint; - } - +y if (strncasecmp(cfg->option, "monitor", olen) == 0) { if (1 == vint) { if (monStartSystemFp) { @@ -1533,7 +1527,7 @@ static void doInitGlobalConfig(void) { #ifdef TD_TSZ // lossy compress - cfg.option = "lossyColumns"; + cfg.option = "lossyColumns"; cfg.ptr = lossyColumns; cfg.valType = TAOS_CFG_VTYPE_STRING; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG; @@ -1565,8 +1559,8 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "maxIntervals"; - cfg.ptr = &maxIntervals; + cfg.option = "maxRange"; + cfg.ptr = &maxRange; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG; cfg.minValue = 0; @@ -1575,8 +1569,8 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "intervals"; - cfg.ptr = &intervals; + cfg.option = "range"; + cfg.ptr = ⦥ cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG; cfg.minValue = 0; diff --git a/src/mnode/src/mnodeDnode.c b/src/mnode/src/mnodeDnode.c index 5a0743dd1b..02cf1c782c 100644 --- a/src/mnode/src/mnodeDnode.c +++ b/src/mnode/src/mnodeDnode.c @@ -1146,6 +1146,7 @@ static int32_t mnodeRetrieveConfigs(SShowObj *pShow, char *data, int32_t rows, v numOfRows++; break; case TAOS_CFG_VTYPE_FLOAT: + case TAOS_CFG_VTYPE_DOUBLE: t = snprintf(varDataVal(pWrite), TSDB_CFG_VALUE_LEN, "%f", *((float *)cfg->ptr)); varDataSetLen(pWrite, t); numOfRows++; diff --git a/src/util/src/tcompression.c b/src/util/src/tcompression.c index a11f6a2f3d..e8a1f4c8ab 100644 --- a/src/util/src/tcompression.c +++ b/src/util/src/tcompression.c @@ -85,7 +85,7 @@ int tsCompressInit(){ if(lossyFloat == false && lossyDouble == false) return 0; - tdszInit(fPrecision, dPrecision, maxIntervals, intervals, Compressor); + tdszInit(fPrecision, dPrecision, maxRange, range, Compressor); if(lossyFloat) uInfo("lossy compression float is opened. "); if(lossyDouble) diff --git a/src/util/src/tconfig.c b/src/util/src/tconfig.c index ea83debfdc..5a3dc3f9bc 100644 --- a/src/util/src/tconfig.c +++ b/src/util/src/tconfig.c @@ -484,6 +484,9 @@ void taosPrintGlobalCfg() { case TAOS_CFG_VTYPE_FLOAT: uInfo(" %s:%s%f%s", cfg->option, blank, *((float *)cfg->ptr), tsGlobalUnit[cfg->unitType]); break; + case TAOS_CFG_VTYPE_DOUBLE: + uInfo(" %s:%s%f%s", cfg->option, blank, *((double *)cfg->ptr), tsGlobalUnit[cfg->unitType]); + break; case TAOS_CFG_VTYPE_STRING: case TAOS_CFG_VTYPE_IPSTR: case TAOS_CFG_VTYPE_DIRECTORY: