提交 955b89f3 编写于 作者: S Shengliang Guan

rpc config

上级 e321edbe
......@@ -84,13 +84,7 @@ typedef struct SRpcInit {
void *parent;
} SRpcInit;
typedef struct {
int32_t rpcTimer;
int32_t rpcMaxTime;
int32_t sver;
} SRpcCfg;
int32_t rpcInit(SRpcCfg *pCfg);
int32_t rpcInit();
void rpcCleanup();
void *rpcOpen(const SRpcInit *pRpc);
void rpcClose(void *);
......
......@@ -225,11 +225,7 @@ void taos_init_imp(void) {
initMsgHandleFp();
initQueryModuleMsgHandle();
SRpcCfg rpcCfg = {0};
rpcCfg.rpcTimer = cfgGetItem(tscCfg, "rpcTimer")->i32;
rpcCfg.rpcMaxTime = cfgGetItem(tscCfg, "rpcMaxTime")->i32;
rpcCfg.sver = 30000000;
rpcInit(&rpcCfg);
rpcInit();
SCatalogCfg cfg = {.maxDBCacheNum = 100, .maxTblCacheNum = 100};
catalogInit(&cfg);
......
......@@ -270,8 +270,7 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) {
taosBlockSIGPIPE();
taosResolveCRC();
SRpcCfg rpcCfg = {.rpcTimer = pCfg->rpcTimer, .rpcMaxTime = pCfg->rpcMaxTime, .sver = pCfg->sver};
if (rpcInit(&rpcCfg) != 0) {
if (rpcInit() != 0) {
dError("failed to init rpc since %s", terrstr());
dndCleanup();
return -1;
......
......@@ -42,8 +42,6 @@ int tsRpcMaxRetry;
int tsRpcHeadSize;
int tsRpcOverhead;
int32_t tsRpcForceTcp = 1; // disable this, means query, show command use udp protocol as default
SHashObj *tsFqdnHash;
#ifndef USE_UV
......@@ -146,10 +144,6 @@ typedef struct SRpcConn {
static int tsRpcRefId = -1;
static int32_t tsRpcNum = 0;
int32_t tsRpcTimer = 300;
int32_t tsRpcMaxTime = 600; // seconds;
uint32_t tsVersion = 0;
// static pthread_once_t tsRpcInit = PTHREAD_ONCE_INIT;
// server:0 client:1 tcp:2 udp:0
......@@ -229,9 +223,7 @@ static void rpcInitImp(void) {
tsFqdnHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
}
int32_t rpcInit(SRpcCfg *pCfg) {
tsRpcTimer = pCfg->rpcTimer;
tsRpcMaxTime = pCfg->rpcMaxTime;
int32_t rpcInit() {
pthread_once(&tsRpcInitOnce, rpcInitImp);
return 0;
}
......
......@@ -112,7 +112,7 @@ void rpcSendRedirectRsp(void* thandle, const SEpSet* pEpSet) {
int rpcReportProgress(void* pConn, char* pCont, int contLen) { return -1; }
void rpcCancelRequest(int64_t rid) { return; }
int32_t rpcInit(SRpcCfg* pCfg) {
int32_t rpcInit() {
// impl later
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册