fix(config): remove the dval from struct SConfigItem.
This commit is contained in:
parent
443da287f6
commit
4f1a5423cb
|
@ -194,7 +194,7 @@ extern int64_t tsWalFsyncDataSizeLimit;
|
|||
extern int32_t tsTransPullupInterval;
|
||||
extern int32_t tsMqRebalanceInterval;
|
||||
extern int32_t tsStreamCheckpointInterval;
|
||||
extern double tsSinkDataRate;
|
||||
extern float tsSinkDataRate;
|
||||
extern int32_t tsStreamNodeCheckInterval;
|
||||
extern int32_t tsTtlUnit;
|
||||
extern int32_t tsTtlPushIntervalSec;
|
||||
|
|
|
@ -65,7 +65,6 @@ typedef struct SConfigItem {
|
|||
union {
|
||||
bool bval;
|
||||
float fval;
|
||||
double dval;
|
||||
int32_t i32;
|
||||
int64_t i64;
|
||||
char *str;
|
||||
|
@ -104,7 +103,6 @@ int32_t cfgAddBool(SConfig *pCfg, const char *name, bool defaultVal, int8_t scop
|
|||
int32_t cfgAddInt32(SConfig *pCfg, const char *name, int32_t defaultVal, int64_t minval, int64_t maxval, int8_t scope);
|
||||
int32_t cfgAddInt64(SConfig *pCfg, const char *name, int64_t defaultVal, int64_t minval, int64_t maxval, int8_t scope);
|
||||
int32_t cfgAddFloat(SConfig *pCfg, const char *name, float defaultVal, float minval, float maxval, int8_t scope);
|
||||
int32_t cfgAddDouble(SConfig *pCfg, const char *name, double defaultVal, double minval, double maxval, int8_t scope);
|
||||
int32_t cfgAddString(SConfig *pCfg, const char *name, const char *defaultVal, int8_t scope);
|
||||
int32_t cfgAddDir(SConfig *pCfg, const char *name, const char *defaultVal, int8_t scope);
|
||||
int32_t cfgAddLocale(SConfig *pCfg, const char *name, const char *defaultVal, int8_t scope);
|
||||
|
|
|
@ -245,7 +245,7 @@ int32_t tsTtlBatchDropNum = 10000; // number of tables dropped per batch
|
|||
int32_t tsTransPullupInterval = 2;
|
||||
int32_t tsMqRebalanceInterval = 2;
|
||||
int32_t tsStreamCheckpointInterval = 300;
|
||||
double tsSinkDataRate = 2.0;
|
||||
float tsSinkDataRate = 2.0;
|
||||
int32_t tsStreamNodeCheckInterval = 30;
|
||||
int32_t tsTtlUnit = 86400;
|
||||
int32_t tsTtlPushIntervalSec = 10;
|
||||
|
@ -650,13 +650,13 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
if (cfgAddBool(pCfg, "disableStream", tsDisableStream, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddInt64(pCfg, "streamBufferSize", tsStreamBufferSize, 0, INT64_MAX, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddInt64(pCfg, "checkpointInterval", tsStreamCheckpointInterval, 60, 1200, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddDouble(pCfg, "streamSinkDataRate", tsSinkDataRate, 0.1, 5, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddFloat(pCfg, "streamSinkDataRate", tsSinkDataRate, 0.1, 5, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
|
||||
if (cfgAddInt32(pCfg, "cacheLazyLoadThreshold", tsCacheLazyLoadThreshold, 0, 100000, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
|
||||
if (cfgAddString(pCfg, "lossyColumns", tsLossyColumns, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddFloat(pCfg, "fPrecision", tsFPrecision, 0.0f, 100000.0f, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddDouble(pCfg, "dPrecision", tsDPrecision, 0.0f, 1000000.0f, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddFloat(pCfg, "dPrecision", tsDPrecision, 0.0f, 1000000.0f, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "maxRange", tsMaxRange, 0, 65536, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "curRange", tsCurRange, 0, 65536, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "ifAdtFse", tsIfAdtFse, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
|
@ -1081,7 +1081,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
|
||||
tstrncpy(tsLossyColumns, cfgGetItem(pCfg, "lossyColumns")->str, sizeof(tsLossyColumns));
|
||||
tsFPrecision = cfgGetItem(pCfg, "fPrecision")->fval;
|
||||
tsDPrecision = cfgGetItem(pCfg, "dPrecision")->dval;
|
||||
tsDPrecision = cfgGetItem(pCfg, "dPrecision")->fval;
|
||||
tsMaxRange = cfgGetItem(pCfg, "maxRange")->i32;
|
||||
tsCurRange = cfgGetItem(pCfg, "curRange")->i32;
|
||||
tsIfAdtFse = cfgGetItem(pCfg, "ifAdtFse")->bval;
|
||||
|
@ -1090,7 +1090,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
tsDisableStream = cfgGetItem(pCfg, "disableStream")->bval;
|
||||
tsStreamBufferSize = cfgGetItem(pCfg, "streamBufferSize")->i64;
|
||||
tsStreamCheckpointInterval = cfgGetItem(pCfg, "checkpointInterval")->i32;
|
||||
tsSinkDataRate = cfgGetItem(pCfg, "streamSinkDataRate")->dval;
|
||||
tsSinkDataRate = cfgGetItem(pCfg, "streamSinkDataRate")->fval;
|
||||
|
||||
tsFilterScalarMode = cfgGetItem(pCfg, "filterScalarMode")->bval;
|
||||
tsMaxStreamBackendCache = cfgGetItem(pCfg, "maxStreamBackendCache")->i32;
|
||||
|
|
|
@ -416,16 +416,6 @@ int32_t cfgAddFloat(SConfig *pCfg, const char *name, float defaultVal, float min
|
|||
return cfgAddItem(pCfg, &item, name);
|
||||
}
|
||||
|
||||
int32_t cfgAddDouble(SConfig *pCfg, const char *name, double defaultVal, double minval, double maxval, int8_t scope) {
|
||||
if (defaultVal < minval || defaultVal > maxval) {
|
||||
terrno = TSDB_CODE_OUT_OF_RANGE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
SConfigItem item = {.dtype = CFG_DTYPE_DOUBLE, .dval = defaultVal, .fmin = minval, .fmax = maxval, .scope = scope};
|
||||
return cfgAddItem(pCfg, &item, name);
|
||||
}
|
||||
|
||||
int32_t cfgAddString(SConfig *pCfg, const char *name, const char *defaultVal, int8_t scope) {
|
||||
SConfigItem item = {.dtype = CFG_DTYPE_STRING, .scope = scope};
|
||||
item.str = taosStrdup(defaultVal);
|
||||
|
@ -631,6 +621,7 @@ void cfgDumpCfg(SConfig *pCfg, bool tsc, bool dump) {
|
|||
uInfo("%s %s %" PRId64, src, name, pItem->i64);
|
||||
}
|
||||
break;
|
||||
case CFG_DTYPE_DOUBLE:
|
||||
case CFG_DTYPE_FLOAT:
|
||||
if (dump) {
|
||||
printf("%s %s %.2f\n", src, name, pItem->fval);
|
||||
|
@ -638,13 +629,6 @@ void cfgDumpCfg(SConfig *pCfg, bool tsc, bool dump) {
|
|||
uInfo("%s %s %.2f", src, name, pItem->fval);
|
||||
}
|
||||
break;
|
||||
case CFG_DTYPE_DOUBLE:
|
||||
if (dump) {
|
||||
printf("%s %s %.2f\n", src, name, pItem->dval);
|
||||
} else {
|
||||
uInfo("%s %s %.2f", src, name, pItem->dval);
|
||||
}
|
||||
break;
|
||||
case CFG_DTYPE_STRING:
|
||||
case CFG_DTYPE_DIR:
|
||||
case CFG_DTYPE_LOCALE:
|
||||
|
|
Loading…
Reference in New Issue