Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8b4e85dd
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看板
提交
8b4e85dd
编写于
12月 02, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1843
上级
98e3defb
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
342 addition
and
325 deletion
+342
-325
src/dnode/inc/dnodeStep.h
src/dnode/inc/dnodeStep.h
+30
-0
src/dnode/src/dnodePeer.c
src/dnode/src/dnodePeer.c
+3
-0
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+19
-0
src/dnode/src/dnodeStep.c
src/dnode/src/dnodeStep.c
+45
-0
src/inc/dnode.h
src/inc/dnode.h
+2
-0
src/inc/taosdef.h
src/inc/taosdef.h
+3
-0
src/inc/taosmsg.h
src/inc/taosmsg.h
+9
-4
src/kit/shell/inc/shell.h
src/kit/shell/inc/shell.h
+0
-1
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+2
-2
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+1
-14
src/kit/shell/src/shellMain.c
src/kit/shell/src/shellMain.c
+2
-5
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+0
-7
src/util/inc/tnettest.h
src/util/inc/tnettest.h
+1
-21
src/util/src/tnettest.c
src/util/src/tnettest.c
+225
-271
未找到文件。
src/dnode/inc/dnodeStep.h
0 → 100644
浏览文件 @
8b4e85dd
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_DNODE_STEP_H
#define TDENGINE_DNODE_STEP_H
#ifdef __cplusplus
extern
"C"
{
#endif
void
dnodeReportStep
(
char
*
name
,
char
*
desc
,
int8_t
finished
);
void
dnodeSendStartupStep
(
SRpcMsg
*
pMsg
);
#ifdef __cplusplus
}
#endif
#endif
src/dnode/src/dnodePeer.c
浏览文件 @
8b4e85dd
...
...
@@ -30,6 +30,7 @@
#include "dnodeVWrite.h"
#include "dnodeMPeer.h"
#include "dnodeMInfos.h"
#include "dnodeStep.h"
static
void
(
*
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
dnodeProcessReqMsgFromDnode
(
SRpcMsg
*
pMsg
,
SRpcEpSet
*
);
...
...
@@ -56,6 +57,8 @@ int32_t dnodeInitServer() {
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_AUTH
]
=
dnodeDispatchToMPeerQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_GRANT
]
=
dnodeDispatchToMPeerQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_STATUS
]
=
dnodeDispatchToMPeerQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_NETWORK_TEST
]
=
dnodeSendStartupStep
;
SRpcInit
rpcInit
;
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
8b4e85dd
...
...
@@ -29,6 +29,7 @@
#include "dnodeMRead.h"
#include "dnodeMWrite.h"
#include "dnodeShell.h"
#include "dnodeStep.h"
static
void
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
dnodeProcessMsgFromShell
(
SRpcMsg
*
pMsg
,
SRpcEpSet
*
);
...
...
@@ -74,6 +75,8 @@ int32_t dnodeInitShell() {
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_SHOW
]
=
dnodeDispatchToMReadQueue
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_RETRIEVE
]
=
dnodeDispatchToMReadQueue
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_NETWORK_TEST
]
=
dnodeSendStartupStep
;
int32_t
numOfThreads
=
tsNumOfCores
*
tsNumOfThreadsPerCore
;
numOfThreads
=
(
int32_t
)
((
1
.
0
-
tsRatioOfQueryThreads
)
*
numOfThreads
/
2
.
0
);
if
(
numOfThreads
<
1
)
{
...
...
@@ -142,7 +145,23 @@ static void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
}
}
static
int32_t
dnodeAuthNettestUser
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
if
(
strcmp
(
user
,
"nettestinternal"
)
==
0
)
{
char
pass
[
32
]
=
{
0
};
taosEncryptPass
((
uint8_t
*
)
user
,
strlen
(
user
),
pass
);
*
spi
=
0
;
*
encrypt
=
0
;
*
ckey
=
0
;
memcpy
(
secret
,
pass
,
TSDB_KEY_LEN
);
dTrace
(
"nettest user is authorized"
);
return
0
;
}
return
-
1
;
}
static
int
dnodeRetrieveUserAuthInfo
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
if
(
dnodeAuthNettestUser
(
user
,
spi
,
encrypt
,
secret
,
ckey
)
==
0
)
return
0
;
int
code
=
mnodeRetriveAuth
(
user
,
spi
,
encrypt
,
secret
,
ckey
);
if
(
code
!=
TSDB_CODE_APP_NOT_READY
)
return
code
;
...
...
src/dnode/src/dnodeStep.c
0 → 100644
浏览文件 @
8b4e85dd
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "taosmsg.h"
#include "dnodeInt.h"
static
SStartupStep
tsStartupStep
;
void
dnodeReportStep
(
char
*
name
,
char
*
desc
,
int8_t
finished
)
{
tstrncpy
(
tsStartupStep
.
name
,
name
,
sizeof
(
tsStartupStep
.
name
));
tstrncpy
(
tsStartupStep
.
desc
,
desc
,
sizeof
(
tsStartupStep
.
desc
));
tsStartupStep
.
finished
=
finished
;
}
void
dnodeSendStartupStep
(
SRpcMsg
*
pMsg
)
{
dInfo
(
"nettest msg is received, cont:%s"
,
(
char
*
)
pMsg
->
pCont
);
SStartupStep
*
pStep
=
rpcMallocCont
(
sizeof
(
SStartupStep
));
#if 1
memcpy
(
pStep
,
&
tsStartupStep
,
sizeof
(
SStartupStep
));
#else
static
int32_t
step
=
0
;
sprintf
(
pStep
->
name
,
"module:%d"
,
step
++
);
sprintf
(
pStep
->
desc
,
"step:%d"
,
step
++
);
if
(
step
>
10
)
pStep
->
finished
=
1
;
#endif
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
pCont
=
pStep
,
.
contLen
=
sizeof
(
SStartupStep
)};
rpcSendResponse
(
&
rpcRsp
);
rpcFreeCont
(
pMsg
->
pCont
);
}
src/inc/dnode.h
浏览文件 @
8b4e85dd
...
...
@@ -71,6 +71,8 @@ void dnodeDelayReprocessMWriteMsg(void *pMsg);
void
dnodeSendStatusMsgToMnode
();
void
dnodeReportStep
(
char
*
name
,
char
*
desc
,
int8_t
finished
);
#ifdef __cplusplus
}
#endif
...
...
src/inc/taosdef.h
浏览文件 @
8b4e85dd
...
...
@@ -286,6 +286,9 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size, void* buf
#define TSDB_SHOW_SQL_LEN 512
#define TSDB_SLOW_QUERY_SQL_LEN 512
#define TSDB_STEP_NAME_LEN 32
#define TSDB_STEP_DESC_LEN 128
#define TSDB_MQTT_HOSTNAME_LEN 64
#define TSDB_MQTT_PORT_LEN 8
#define TSDB_MQTT_USER_LEN 24
...
...
src/inc/taosmsg.h
浏览文件 @
8b4e85dd
...
...
@@ -105,10 +105,7 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_AUTH, "auth" )
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DUMMY12
,
"dummy12"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DUMMY13
,
"dummy13"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DUMMY14
,
"dummy14"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_NETWORK_TEST
,
"network-test"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_NETWORK_TEST
,
"nettest"
)
#ifndef TAOS_MESSAGE_C
TSDB_MSG_TYPE_MAX
// 105
...
...
@@ -838,6 +835,14 @@ typedef struct {
char
ckey
[
TSDB_KEY_LEN
];
}
SAuthMsg
,
SAuthRsp
;
typedef
struct
{
int8_t
finished
;
int8_t
reserved1
[
7
];
char
name
[
TSDB_STEP_NAME_LEN
];
char
desc
[
TSDB_STEP_DESC_LEN
];
char
reserved2
[
64
];
}
SStartupStep
;
#pragma pack(pop)
#ifdef __cplusplus
...
...
src/kit/shell/inc/shell.h
浏览文件 @
8b4e85dd
...
...
@@ -51,7 +51,6 @@ typedef struct SShellArguments {
char
*
commands
;
int
abort
;
int
port
;
int
endPort
;
int
pktLen
;
char
*
netTestRole
;
}
SShellArguments
;
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
8b4e85dd
...
...
@@ -32,14 +32,14 @@
/**************** Global variables ****************/
#ifdef _TD_POWER_
char
CLIENT_VERSION
[]
=
"Welcome to the PowerDB shell from %s, Client Version:%s
\n
"
"Copyright (c) 20
17
by PowerDB, Inc. All rights reserved.
\n\n
"
;
"Copyright (c) 20
20
by PowerDB, Inc. All rights reserved.
\n\n
"
;
char
PROMPT_HEADER
[]
=
"power> "
;
char
CONTINUE_PROMPT
[]
=
" -> "
;
int
prompt_size
=
7
;
#else
char
CLIENT_VERSION
[]
=
"Welcome to the TDengine shell from %s, Client Version:%s
\n
"
"Copyright (c) 20
17
by TAOS Data, Inc. All rights reserved.
\n\n
"
;
"Copyright (c) 20
20
by TAOS Data, Inc. All rights reserved.
\n\n
"
;
char
PROMPT_HEADER
[]
=
"taos> "
;
char
CONTINUE_PROMPT
[]
=
" -> "
;
...
...
src/kit/shell/src/shellLinux.c
浏览文件 @
8b4e85dd
...
...
@@ -46,8 +46,7 @@ static struct argp_option options[] = {
{
"thread"
,
'T'
,
"THREADNUM"
,
0
,
"Number of threads when using multi-thread to import data."
},
{
"database"
,
'd'
,
"DATABASE"
,
0
,
"Database to use when connecting to the server."
},
{
"timezone"
,
't'
,
"TIMEZONE"
,
0
,
"Time zone of the shell, default is local."
},
{
"netrole"
,
'n'
,
"NETROLE"
,
0
,
"Net role when network connectivity test, default is NULL, options: client|clients|server."
},
{
"endport"
,
'e'
,
"ENDPORT"
,
0
,
"Net test end port, default is 6042."
},
{
"netrole"
,
'n'
,
"NETROLE"
,
0
,
"Net role when network connectivity test, default is NULL, options: client|server|rpc|startup."
},
{
"pktlen"
,
'l'
,
"PKTLEN"
,
0
,
"Packet length used for net test, default is 1000 bytes."
},
{
0
}};
...
...
@@ -130,20 +129,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case
'd'
:
arguments
->
database
=
arg
;
break
;
case
'n'
:
arguments
->
netTestRole
=
arg
;
break
;
case
'e'
:
if
(
arg
)
{
arguments
->
endPort
=
atoi
(
arg
);
}
else
{
fprintf
(
stderr
,
"Invalid end port
\n
"
);
return
-
1
;
}
break
;
case
'l'
:
if
(
arg
)
{
arguments
->
pktLen
=
atoi
(
arg
);
...
...
@@ -152,7 +140,6 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
return
-
1
;
}
break
;
case
OPT_ABORT
:
arguments
->
abort
=
1
;
break
;
...
...
src/kit/shell/src/shellMain.c
浏览文件 @
8b4e85dd
...
...
@@ -61,8 +61,7 @@ SShellArguments args = {
.
file
=
"
\0
"
,
.
dir
=
"
\0
"
,
.
threadNum
=
5
,
.
commands
=
NULL
,
.
endPort
=
6042
,
.
commands
=
NULL
,
.
pktLen
=
1000
,
.
netTestRole
=
NULL
};
...
...
@@ -81,9 +80,7 @@ int main(int argc, char* argv[]) {
if
(
args
.
netTestRole
&&
args
.
netTestRole
[
0
]
!=
0
)
{
taos_init
();
CmdArguments
cmdArgs
;
memcpy
(
&
cmdArgs
,
&
args
,
sizeof
(
SShellArguments
));
taosNetTest
(
&
cmdArgs
);
taosNetTest
(
args
.
netTestRole
,
args
.
host
,
args
.
port
,
args
.
pktLen
);
exit
(
0
);
}
...
...
src/rpc/src/rpcMain.c
浏览文件 @
8b4e85dd
...
...
@@ -1086,13 +1086,6 @@ static void *rpcProcessMsgFromPeer(SRecvInfo *pRecv) {
tDebug
(
"%s %p %p, %s is sent with error code:0x%x"
,
pRpc
->
label
,
pConn
,
(
void
*
)
pHead
->
ahandle
,
taosMsg
[
pHead
->
msgType
+
1
],
code
);
}
}
else
{
// msg is passed to app only parsing is ok
if
(
pHead
->
msgType
==
TSDB_MSG_TYPE_NETWORK_TEST
)
{
rpcSendQuickRsp
(
pConn
,
TSDB_CODE_SUCCESS
);
rpcFreeMsg
(
pRecv
->
msg
);
return
pConn
;
}
rpcProcessIncomingMsg
(
pConn
,
pHead
,
pContext
);
}
}
...
...
src/util/inc/tnettest.h
浏览文件 @
8b4e85dd
...
...
@@ -20,27 +20,7 @@
extern
"C"
{
#endif
typedef
struct
CmdArguments
{
char
*
host
;
char
*
password
;
char
*
user
;
char
*
auth
;
char
*
database
;
char
*
timezone
;
bool
is_raw_time
;
bool
is_use_passwd
;
char
file
[
TSDB_FILENAME_LEN
];
char
dir
[
TSDB_FILENAME_LEN
];
int
threadNum
;
char
*
commands
;
int
abort
;
int
port
;
int
endPort
;
int
pktLen
;
char
*
netTestRole
;
}
CmdArguments
;
void
taosNetTest
(
CmdArguments
*
args
);
void
taosNetTest
(
char
*
role
,
char
*
host
,
int
port
,
int
pkgLen
);
#ifdef __cplusplus
}
...
...
src/util/src/tnettest.c
浏览文件 @
8b4e85dd
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录