remove global variables
This commit is contained in:
parent
e9a5ee3a5f
commit
76d69529c8
|
@ -23,13 +23,7 @@ extern "C" {
|
|||
#include "tdef.h"
|
||||
|
||||
// common
|
||||
extern int32_t tsShellActivityTimer;
|
||||
extern uint32_t tsMaxTmrCtrl;
|
||||
extern float tsNumOfThreadsPerCore;
|
||||
extern int32_t tsNumOfCommitThreads;
|
||||
extern float tsRatioOfQueryCores;
|
||||
extern int8_t tsDaylight;
|
||||
extern int8_t tsEnableCoreFile;
|
||||
extern int32_t tsCompressMsgSize;
|
||||
extern int32_t tsCompressColData;
|
||||
extern int32_t tsMaxNumOfDistinctResults;
|
||||
|
|
|
@ -26,7 +26,6 @@ typedef void *tmr_h;
|
|||
typedef void (*TAOS_TMR_CALLBACK)(void *, void *);
|
||||
|
||||
extern int taosTmrThreads;
|
||||
extern uint32_t tsMaxTmrCtrl;
|
||||
|
||||
#define MSECONDS_PER_TICK 5
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ void* openTransporter(const char *user, const char *auth, int32_t numOfThread) {
|
|||
rpcInit.sessions = cfgGetItem(tscCfg, "maxConnections")->i32;
|
||||
rpcInit.connType = TAOS_CONN_CLIENT;
|
||||
rpcInit.user = (char *)user;
|
||||
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||
rpcInit.idleTime = cfgGetItem(tscCfg, "shellActivityTimer")->i32 * 1000;
|
||||
rpcInit.ckey = "key";
|
||||
rpcInit.spi = 1;
|
||||
rpcInit.secret = (char *)auth;
|
||||
|
|
|
@ -29,12 +29,7 @@
|
|||
|
||||
|
||||
// common
|
||||
int32_t tsShellActivityTimer = 3; // second
|
||||
float tsNumOfThreadsPerCore = 1.0f;
|
||||
int32_t tsNumOfCommitThreads = 4;
|
||||
float tsRatioOfQueryCores = 1.0f;
|
||||
int8_t tsDaylight = 0;
|
||||
int8_t tsEnableCoreFile = 0;
|
||||
int32_t tsMaxBinaryDisplayWidth = 30;
|
||||
int8_t tsEnableSlaveQuery = 1;
|
||||
int8_t tsEnableAdjustMaster = 1;
|
||||
|
@ -286,17 +281,6 @@ static void doInitGlobalConfig(void) {
|
|||
cfg.unitType = TAOS_CFG_UTYPE_NONE;
|
||||
taosAddConfigOption(cfg);
|
||||
|
||||
// timer
|
||||
cfg.option = "maxTmrCtrl";
|
||||
cfg.ptr = &tsMaxTmrCtrl;
|
||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
|
||||
cfg.minValue = 8;
|
||||
cfg.maxValue = 2048;
|
||||
cfg.ptrLength = 0;
|
||||
cfg.unitType = TAOS_CFG_UTYPE_NONE;
|
||||
taosAddConfigOption(cfg);
|
||||
|
||||
cfg.option = "minSlidingTime";
|
||||
cfg.ptr = &tsMinSlidingTime;
|
||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||
|
@ -490,17 +474,6 @@ static void doInitGlobalConfig(void) {
|
|||
cfg.unitType = TAOS_CFG_UTYPE_NONE;
|
||||
taosAddConfigOption(cfg);
|
||||
|
||||
cfg.option = "enableCoreFile";
|
||||
cfg.ptr = &tsEnableCoreFile;
|
||||
cfg.valType = TAOS_CFG_VTYPE_INT8;
|
||||
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG;
|
||||
cfg.minValue = 0;
|
||||
cfg.maxValue = 1;
|
||||
cfg.ptrLength = 0;
|
||||
cfg.unitType = TAOS_CFG_UTYPE_NONE;
|
||||
taosAddConfigOption(cfg);
|
||||
|
||||
|
||||
cfg.option = "maxBinaryDisplayWidth";
|
||||
cfg.ptr = &tsMaxBinaryDisplayWidth;
|
||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||
|
|
|
@ -132,7 +132,8 @@ do { \
|
|||
} while (0)
|
||||
|
||||
int32_t getMaximumIdleDurationSec() {
|
||||
return tsShellActivityTimer * 2;
|
||||
// todo
|
||||
return 6; //tsShellActivityTimer * 2;
|
||||
}
|
||||
|
||||
static int32_t getExprFunctionId(SExprInfo *pExprInfo) {
|
||||
|
@ -5301,10 +5302,12 @@ SOperatorInfo* createExchangeOperatorInfo(const SArray* pSources, const SArray*
|
|||
rpcInit.label = "EX";
|
||||
rpcInit.numOfThreads = 1;
|
||||
rpcInit.cfp = qProcessFetchRsp;
|
||||
// todo
|
||||
rpcInit.sessions = 50000; //tsMaxConnections;
|
||||
rpcInit.connType = TAOS_CONN_CLIENT;
|
||||
rpcInit.user = (char *)"root";
|
||||
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||
// todo
|
||||
rpcInit.idleTime = 6; //tsShellActivityTimer * 1000;
|
||||
rpcInit.ckey = "key";
|
||||
rpcInit.spi = 1;
|
||||
rpcInit.secret = (char *)"dcc5bed04851fec854c035b2e40263b6";
|
||||
|
|
|
@ -85,7 +85,9 @@ static void* pTaskQueue = NULL;
|
|||
|
||||
int32_t initTaskQueue() {
|
||||
double factor = 4.0;
|
||||
int32_t numOfThreads = TMAX((int)(tsNumOfCores * tsNumOfThreadsPerCore / factor), 2);
|
||||
// todo
|
||||
// int32_t numOfThreads = TMAX((int)(tsNumOfCores * tsNumOfThreadsPerCore / factor), 2);
|
||||
int32_t numOfThreads = TMAX((int)(tsNumOfCores * 1.0f / factor), 2);
|
||||
|
||||
int32_t queueSize = 25000; //tsMaxConnections * 2;
|
||||
pTaskQueue = taosInitScheduler(queueSize, numOfThreads, "tsc");
|
||||
|
|
|
@ -97,7 +97,7 @@ int main(int argc, char *argv[]) {
|
|||
rpcInit.label = "APP";
|
||||
rpcInit.numOfThreads = 1;
|
||||
rpcInit.sessions = 100;
|
||||
rpcInit.idleTime = tsShellActivityTimer*1000;
|
||||
rpcInit.idleTime = 3000; //tsShellActivityTimer*1000;
|
||||
rpcInit.user = "michael";
|
||||
rpcInit.secret = secret;
|
||||
rpcInit.ckey = "key";
|
||||
|
|
Loading…
Reference in New Issue