未验证 提交 bea199ce 编写于 作者: H Hongze Cheng 提交者: GitHub

Merge pull request #6981 from taosdata/compress_float

change config name in taos.cfg
......@@ -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 curRange;
extern char Compressor[];
#endif
......
......@@ -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 curRange = 100; // range
char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESSOR
#endif
......@@ -1565,8 +1565,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 +1575,8 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg);
cfg.option = "intervals";
cfg.ptr = &intervals;
cfg.option = "range";
cfg.ptr = &curRange;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG;
cfg.minValue = 0;
......
......@@ -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++;
......
......@@ -85,7 +85,7 @@ int tsCompressInit(){
if(lossyFloat == false && lossyDouble == false)
return 0;
tdszInit(fPrecision, dPrecision, maxIntervals, intervals, Compressor);
tdszInit(fPrecision, dPrecision, maxRange, curRange, Compressor);
if(lossyFloat)
uInfo("lossy compression float is opened. ");
if(lossyDouble)
......
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册