Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e53540b5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e53540b5
编写于
2月 23, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rpc config
上级
10a21ba8
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
40 addition
and
51 deletion
+40
-51
include/common/tglobal.h
include/common/tglobal.h
+0
-15
include/dnode/mgmt/dnode.h
include/dnode/mgmt/dnode.h
+2
-0
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+8
-2
source/client/src/clientCfg.c
source/client/src/clientCfg.c
+5
-7
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+5
-1
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+1
-1
source/client/test/tmqTest.cpp
source/client/test/tmqTest.cpp
+1
-1
source/common/src/tglobal.c
source/common/src/tglobal.c
+0
-19
source/dnode/mgmt/daemon/src/dmnCfg.c
source/dnode/mgmt/daemon/src/dmnCfg.c
+5
-0
source/dnode/mgmt/impl/src/dndEnv.c
source/dnode/mgmt/impl/src/dndEnv.c
+2
-1
source/dnode/mgmt/impl/test/sut/src/sut.cpp
source/dnode/mgmt/impl/test/sut/src/sut.cpp
+2
-0
source/libs/transport/src/rpcMain.c
source/libs/transport/src/rpcMain.c
+6
-3
source/os/src/osEnv.c
source/os/src/osEnv.c
+3
-1
未找到文件。
include/common/tglobal.h
浏览文件 @
e53540b5
...
...
@@ -55,23 +55,8 @@ extern float tsStreamComputDelayRatio; // the delayed computing ration of the
extern
int32_t
tsProjectExecInterval
;
extern
int64_t
tsMaxRetentWindow
;
// system info
extern
uint32_t
tsVersion
;
// lossy
extern
char
tsLossyColumns
[];
extern
double
tsFPrecision
;
extern
double
tsDPrecision
;
extern
uint32_t
tsMaxRange
;
extern
uint32_t
tsCurRange
;
extern
char
tsCompressor
[];
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
void
taosInitGlobalCfg
();
int32_t
taosCfgDynamicOptions
(
char
*
msg
);
bool
taosCheckBalanceCfgOptions
(
const
char
*
option
,
int32_t
*
vnodeId
,
int32_t
*
dnodeId
);
void
taosAddDataDir
(
int
index
,
char
*
v1
,
int
level
,
int
primary
);
...
...
include/dnode/mgmt/dnode.h
浏览文件 @
e53540b5
...
...
@@ -32,6 +32,8 @@ typedef struct {
uint16_t
numOfCommitThreads
;
bool
enableTelem
;
bool
printAuth
;
int32_t
rpcTimer
;
int32_t
rpcMaxTime
;
char
timezone
[
TSDB_TIMEZONE_LEN
];
char
locale
[
TSDB_LOCALE_LEN
];
char
charset
[
TSDB_LOCALE_LEN
];
...
...
include/libs/transport/trpc.h
浏览文件 @
e53540b5
...
...
@@ -81,9 +81,15 @@ typedef struct SRpcInit {
void
*
parent
;
}
SRpcInit
;
int32_t
rpcInit
();
typedef
struct
{
int32_t
rpcTimer
;
int32_t
rpcMaxTime
;
int32_t
sver
;
}
SRpcCfg
;
int32_t
rpcInit
(
SRpcCfg
*
pCfg
);
void
rpcCleanup
();
void
*
rpcOpen
(
const
SRpcInit
*
pRpc
);
void
*
rpcOpen
(
const
SRpcInit
*
pRpc
);
void
rpcClose
(
void
*
);
void
*
rpcMallocCont
(
int
contLen
);
void
rpcFreeCont
(
void
*
pCont
);
...
...
source/client/src/clientCfg.c
浏览文件 @
e53540b5
...
...
@@ -17,7 +17,7 @@
#include "clientInt.h"
#include "ulog.h"
// todo refact
// todo refact
SConfig
*
tscCfg
;
static
int32_t
tscLoadCfg
(
SConfig
*
pConfig
,
const
char
*
inputCfgDir
,
const
char
*
envFile
,
const
char
*
apolloUrl
)
{
...
...
@@ -125,7 +125,7 @@ static int32_t tscAddEpCfg(SConfig *pCfg) {
return
-
1
;
}
if
(
cfgAddString
(
pCfg
,
"fqdn"
,
defaultFqdn
)
!=
0
)
return
-
1
;
int32_t
defaultServerPort
=
6030
;
if
(
cfgAddInt32
(
pCfg
,
"serverPort"
,
defaultServerPort
,
1
,
65056
)
!=
0
)
return
-
1
;
...
...
@@ -142,11 +142,10 @@ static int32_t tscAddEpCfg(SConfig *pCfg) {
static
int32_t
tscAddCfg
(
SConfig
*
pCfg
)
{
if
(
tscAddEpCfg
(
pCfg
)
!=
0
)
return
-
1
;
// if (cfgAddString(pCfg, "buildinfo", buildinfo) != 0) return -1;
// if (cfgAddString(pCfg, "gitinfo", gitinfo) != 0) return -1;
// if (cfgAddString(pCfg, "version", version) != 0) return -1;
// if (cfgAddDir(pCfg, "dataDir", tsDataDir) != 0) return -1;
if
(
cfgAddTimezone
(
pCfg
,
"timezone"
,
""
)
!=
0
)
return
-
1
;
if
(
cfgAddLocale
(
pCfg
,
"locale"
,
""
)
!=
0
)
return
-
1
;
...
...
@@ -160,7 +159,8 @@ static int32_t tscAddCfg(SConfig *pCfg) {
if
(
cfgAddFloat
(
pCfg
,
"numOfThreadsPerCore"
,
1
,
0
,
10
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"ratioOfQueryCores"
,
1
,
0
,
5
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"shellActivityTimer"
,
3
,
1
,
120
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"rpcTimer"
,
300
,
100
,
3000
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"rpcMaxTime"
,
600
,
100
,
7200
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxConnections"
,
50000
,
1
,
100000
)
!=
0
)
return
-
1
;
return
0
;
}
...
...
@@ -169,8 +169,6 @@ int32_t tscCheckCfg(SConfig *pCfg) {
bool
enableCore
=
cfgGetItem
(
pCfg
,
"enableCoreFile"
)
->
bval
;
taosSetCoreDump
(
enableCore
);
return
0
;
}
...
...
source/client/src/clientEnv.c
浏览文件 @
e53540b5
...
...
@@ -223,7 +223,11 @@ void taos_init_imp(void) {
initMsgHandleFp
();
initQueryModuleMsgHandle
();
rpcInit
();
SRpcCfg
rpcCfg
=
{
0
};
rpcCfg
.
rpcTimer
=
cfgGetItem
(
tscCfg
,
"rpcTimer"
)
->
i32
;
rpcCfg
.
rpcMaxTime
=
cfgGetItem
(
tscCfg
,
"rpcMaxTime"
)
->
i32
;
rpcCfg
.
sver
=
30000000
;
rpcInit
(
&
rpcCfg
);
SCatalogCfg
cfg
=
{.
maxDBCacheNum
=
100
,
.
maxTblCacheNum
=
100
};
catalogInit
(
&
cfg
);
...
...
source/client/test/clientTests.cpp
浏览文件 @
e53540b5
...
...
@@ -49,7 +49,7 @@ int main(int argc, char** argv) {
}
TEST
(
testCase
,
driverInit_Test
)
{
taosInitGlobalCfg
();
//
taosInitGlobalCfg();
// taos_init();
}
...
...
source/client/test/tmqTest.cpp
浏览文件 @
e53540b5
...
...
@@ -34,7 +34,7 @@ int main(int argc, char** argv) {
}
TEST
(
testCase
,
driverInit_Test
)
{
taosInitGlobalCfg
();
//
taosInitGlobalCfg();
// taos_init();
}
...
...
source/common/src/tglobal.c
浏览文件 @
e53540b5
...
...
@@ -118,23 +118,6 @@ bool tsdbForceKeepFile = false;
*/
int64_t
tsTickPerDay
[]
=
{
86400000L
,
86400000000L
,
86400000000000L
};
// system info
int32_t
tsTotalMemoryMB
=
0
;
uint32_t
tsVersion
=
0
;
//
// lossy compress 6
//
char
tsLossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty
// can close lossy compress.
// below option can take effect when tsLossyColumns not empty
double
tsFPrecision
=
1E-8
;
// float column precision
double
tsDPrecision
=
1E-16
;
// double column precision
uint32_t
tsMaxRange
=
500
;
// max range
uint32_t
tsCurRange
=
100
;
// range
char
tsCompressor
[
32
]
=
"ZSTD_COMPRESSOR"
;
// ZSTD_COMPRESSOR or GZIP_COMPRESSOR
int32_t
(
*
monStartSystemFp
)()
=
NULL
;
void
(
*
monStopSystemFp
)()
=
NULL
;
void
(
*
monExecuteSQLFp
)(
char
*
sql
)
=
NULL
;
...
...
@@ -529,8 +512,6 @@ static void doInitGlobalConfig(void) {
#endif
}
void
taosInitGlobalCfg
()
{
pthread_once
(
&
tsInitGlobalCfgOnce
,
doInitGlobalConfig
);
}
/*
* alter dnode 1 balance "vnode:1-dnode:2"
*/
...
...
source/dnode/mgmt/daemon/src/dmnCfg.c
浏览文件 @
e53540b5
...
...
@@ -80,6 +80,9 @@ static int32_t dmnAddDnodeCfg(SConfig *pCfg) {
if
(
cfgAddFloat
(
pCfg
,
"ratioOfQueryCores"
,
1
,
0
,
5
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxShellConns"
,
50000
,
10
,
50000000
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"shellActivityTimer"
,
3
,
1
,
120
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"rpcTimer"
,
300
,
100
,
3000
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"rpcMaxTime"
,
600
,
100
,
7200
)
!=
0
)
return
-
1
;
return
0
;
}
...
...
@@ -184,6 +187,8 @@ SDnodeEnvCfg dmnGetEnvCfg(SConfig *pCfg) {
envCfg
.
numOfCores
=
cfgGetItem
(
pCfg
,
"numOfCores"
)
->
i32
;
envCfg
.
numOfCommitThreads
=
(
uint16_t
)
cfgGetItem
(
pCfg
,
"numOfCommitThreads"
)
->
i32
;
envCfg
.
enableTelem
=
cfgGetItem
(
pCfg
,
"telemetryReporting"
)
->
bval
;
envCfg
.
rpcMaxTime
=
cfgGetItem
(
pCfg
,
"rpcMaxTime"
)
->
i32
;
envCfg
.
rpcTimer
=
cfgGetItem
(
pCfg
,
"rpcTimer"
)
->
i32
;
return
envCfg
;
}
...
...
source/dnode/mgmt/impl/src/dndEnv.c
浏览文件 @
e53540b5
...
...
@@ -270,7 +270,8 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) {
taosBlockSIGPIPE
();
taosResolveCRC
();
if
(
rpcInit
()
!=
0
)
{
SRpcCfg
rpcCfg
=
{.
rpcTimer
=
pCfg
->
rpcTimer
,
.
rpcMaxTime
=
pCfg
->
rpcMaxTime
,
.
sver
=
pCfg
->
sver
};
if
(
rpcInit
(
&
rpcCfg
)
!=
0
)
{
dError
(
"failed to init rpc since %s"
,
terrstr
());
dndCleanup
();
return
-
1
;
...
...
source/dnode/mgmt/impl/test/sut/src/sut.cpp
浏览文件 @
e53540b5
...
...
@@ -43,6 +43,8 @@ void Testbase::Init(const char* path, int16_t port) {
SDnodeEnvCfg
cfg
=
{
0
};
cfg
.
numOfCommitThreads
=
1
;
cfg
.
numOfCores
=
1
;
cfg
.
rpcMaxTime
=
600
;
cfg
.
rpcTimer
=
300
;
dndInit
(
&
cfg
);
char
fqdn
[]
=
"localhost"
;
...
...
source/libs/transport/src/rpcMain.c
浏览文件 @
e53540b5
...
...
@@ -146,8 +146,9 @@ typedef struct SRpcConn {
static
int
tsRpcRefId
=
-
1
;
static
int32_t
tsRpcNum
=
0
;
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
uint32_t
tsVersion
=
0
;
// static pthread_once_t tsRpcInit = PTHREAD_ONCE_INIT;
...
...
@@ -228,7 +229,9 @@ static void rpcInitImp(void) {
tsFqdnHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_ENTRY_LOCK
);
}
int32_t
rpcInit
(
void
)
{
int32_t
rpcInit
(
SRpcCfg
*
pCfg
)
{
tsRpcTimer
=
pCfg
->
rpcTimer
;
tsRpcMaxTime
=
pCfg
->
rpcMaxTime
;
pthread_once
(
&
tsRpcInitOnce
,
rpcInitImp
);
return
0
;
}
...
...
source/os/src/osEnv.c
浏览文件 @
e53540b5
...
...
@@ -82,6 +82,8 @@ char tsDataDir[PATH_MAX] = "/var/lib/taos";
char
tsLogDir
[
PATH_MAX
]
=
"/var/log/taos"
;
char
tsTempDir
[
PATH_MAX
]
=
"/tmp/"
;
void
osInit
()
{}
void
osInit
()
{
srand
(
taosSafeRand
());
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录