Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3b1add19
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看板
提交
3b1add19
编写于
10月 25, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10430] add dnode trans file
上级
7bcfb460
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
189 addition
and
172 deletion
+189
-172
include/server/mnode/mnode.h
include/server/mnode/mnode.h
+10
-0
include/util/tdef.h
include/util/tdef.h
+1
-0
source/server/dnode/inc/dnodeInt.h
source/server/dnode/inc/dnodeInt.h
+2
-0
source/server/dnode/inc/dnodeMain.h
source/server/dnode/inc/dnodeMain.h
+5
-5
source/server/dnode/inc/dnodeTrans.h
source/server/dnode/inc/dnodeTrans.h
+0
-1
source/server/dnode/src/dnodeInt.c
source/server/dnode/src/dnodeInt.c
+4
-3
source/server/dnode/src/dnodeMain.c
source/server/dnode/src/dnodeMain.c
+4
-4
source/server/dnode/src/dnodeTrans.c
source/server/dnode/src/dnodeTrans.c
+141
-155
source/server/mnode/inc/mnodeInt.h
source/server/mnode/inc/mnodeInt.h
+1
-0
source/server/mnode/src/mnodeAuth.c
source/server/mnode/src/mnodeAuth.c
+17
-2
source/server/mnode/src/mondeInt.c
source/server/mnode/src/mondeInt.c
+4
-2
未找到文件。
include/server/mnode/mnode.h
浏览文件 @
3b1add19
...
...
@@ -46,6 +46,16 @@ typedef struct {
*/
void
(
*
SendRedirectMsg
)(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
);
/**
* Get the corresponding endpoint information from dnodeId.
*
* @param dnode, the instance of dDnode module.
* @param dnodeId, the id ot dnode.
* @param ep, the endpoint of dnode.
* @param fqdn, the fqdn of dnode.
* @param port, the port of dnode.
*/
void
(
*
GetDnodeEp
)(
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
}
SMnodeFp
;
typedef
struct
{
...
...
include/util/tdef.h
浏览文件 @
3b1add19
...
...
@@ -68,6 +68,7 @@ extern const int32_t TYPE_BYTES[15];
#define TSDB_DATA_NULL_STR "NULL"
#define TSDB_DATA_NULL_STR_L "null"
#define TSDB_NETTEST_USER "nettestinternal"
#define TSDB_DEFAULT_USER "root"
#ifdef _TD_POWER_
#define TSDB_DEFAULT_PASS "powerdb"
...
...
source/server/dnode/inc/dnodeInt.h
浏览文件 @
3b1add19
...
...
@@ -19,7 +19,9 @@
#ifdef __cplusplus
extern
"C"
{
#endif
#include "os.h"
#include "taosmsg.h"
#include "tglobal.h"
#include "tlog.h"
#include "trpc.h"
#include "dnode.h"
...
...
source/server/dnode/inc/dnodeMain.h
浏览文件 @
3b1add19
...
...
@@ -22,10 +22,10 @@ extern "C" {
#include "dnodeInt.h"
typedef
enum
{
TD
_RUN_STAT_INIT
,
TD
_RUN_STAT_RUNNING
,
TD
_RUN_STAT_STOPPED
}
RunStat
;
DN
_RUN_STAT_INIT
,
DN
_RUN_STAT_RUNNING
,
DN
_RUN_STAT_STOPPED
}
EDn
RunStat
;
int32_t
dnodeInitMain
();
void
dnodeCleanupMain
();
...
...
@@ -36,7 +36,7 @@ void dnodeReportStartupFinished(char *name, char *desc);
void
dnodeProcessStartupReq
(
SRpcMsg
*
pMsg
);
void
dnodeProcessCreateMnodeReq
(
SRpcMsg
*
pMsg
);
void
dnodeProcessConfigDnodeReq
(
SRpcMsg
*
pMsg
);
RunStat
dnodeGetRunStat
();
EDn
RunStat
dnodeGetRunStat
();
void
dnodeSetRunStat
();
void
*
dnodeGetTimer
();
...
...
source/server/dnode/inc/dnodeTrans.h
浏览文件 @
3b1add19
...
...
@@ -25,7 +25,6 @@ int32_t dnodeInitTrans();
void
dnodeCleanupTrans
();
void
dnodeSendMsgToMnode
(
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnode
(
SRpcEpSet
*
epSet
,
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
,
SRpcEpSet
*
epSet
);
#ifdef __cplusplus
}
...
...
source/server/dnode/src/dnodeInt.c
浏览文件 @
3b1add19
...
...
@@ -46,6 +46,7 @@ static int32_t dnodeInitVnodeModule(void **unused) {
static
int32_t
dnodeInitMnodeModule
(
void
**
unused
)
{
SMnodePara
para
;
para
.
fp
.
GetDnodeEp
=
dnodeGetDnodeEp
;
para
.
fp
.
SendMsgToDnode
=
dnodeSendMsgToDnode
;
para
.
fp
.
SendMsgToMnode
=
dnodeSendMsgToMnode
;
para
.
fp
.
SendRedirectMsg
=
dnodeSendRedirectMsg
;
...
...
@@ -77,7 +78,7 @@ int32_t dnodeInit() {
taosStepExec
(
tsSteps
);
dnodeSetRunStat
(
TD
_RUN_STAT_RUNNING
);
dnodeSetRunStat
(
DN
_RUN_STAT_RUNNING
);
dnodeReportStartupFinished
(
"TDengine"
,
"initialized successfully"
);
dInfo
(
"TDengine is initialized successfully"
);
...
...
@@ -85,8 +86,8 @@ int32_t dnodeInit() {
}
void
dnodeCleanup
()
{
if
(
dnodeGetRunStat
()
!=
TD
_RUN_STAT_STOPPED
)
{
dnodeSetRunStat
(
TD
_RUN_STAT_STOPPED
);
if
(
dnodeGetRunStat
()
!=
DN
_RUN_STAT_STOPPED
)
{
dnodeSetRunStat
(
DN
_RUN_STAT_STOPPED
);
taosStepCleanup
(
tsSteps
);
tsSteps
=
NULL
;
}
...
...
source/server/dnode/src/dnodeMain.c
浏览文件 @
3b1add19
...
...
@@ -29,7 +29,7 @@
#include "mnode.h"
static
struct
{
RunStat
runStatus
;
EDn
RunStat
runStatus
;
void
*
dnodeTimer
;
SStartupStep
startup
;
}
tsDmain
;
...
...
@@ -55,7 +55,7 @@ static void dnodeCheckDataDirOpenned(char *dir) {
}
int32_t
dnodeInitMain
()
{
tsDmain
.
runStatus
=
TD
_RUN_STAT_STOPPED
;
tsDmain
.
runStatus
=
DN
_RUN_STAT_STOPPED
;
tsDmain
.
dnodeTimer
=
taosTmrInit
(
100
,
200
,
60000
,
"DND-TMR"
);
if
(
tsDmain
.
dnodeTimer
==
NULL
)
{
dError
(
"failed to init dnode timer"
);
...
...
@@ -260,8 +260,8 @@ void dnodeProcessConfigDnodeReq(SRpcMsg *pMsg) {
rpcFreeCont
(
pMsg
->
pCont
);
}
RunStat
dnodeGetRunStat
()
{
return
tsDmain
.
runStatus
;
}
EDn
RunStat
dnodeGetRunStat
()
{
return
tsDmain
.
runStatus
;
}
void
dnodeSetRunStat
(
RunStat
stat
)
{
tsDmain
.
runStatus
=
stat
;
}
void
dnodeSetRunStat
(
EDn
RunStat
stat
)
{
tsDmain
.
runStatus
=
stat
;
}
void
*
dnodeGetTimer
()
{
return
tsDmain
.
dnodeTimer
;
}
\ No newline at end of file
source/server/dnode/src/dnodeTrans.c
浏览文件 @
3b1add19
此差异已折叠。
点击以展开。
source/server/mnode/inc/mnodeInt.h
浏览文件 @
3b1add19
...
...
@@ -30,6 +30,7 @@ EMnStatus mnodeGetStatus();
void
mnodeSendMsgToDnode
(
struct
SRpcEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
void
mnodeSendMsgToMnode
(
struct
SRpcMsg
*
rpcMsg
);
void
mnodeSendRedirectMsg
(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
);
void
mnodeGetDnodeEp
(
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
#ifdef __cplusplus
}
...
...
source/server/mnode/src/mnodeAuth.c
浏览文件 @
3b1add19
...
...
@@ -15,7 +15,22 @@
#define _DEFAULT_SOURCE
#include "os.h"
#include "mnode
Int
.h"
#include "mnode
Auth
.h"
int32_t
mnodeInitAuth
()
{
return
0
;
}
void
mnodeCleanupAuth
()
{}
\ No newline at end of file
void
mnodeCleanupAuth
()
{}
int32_t
mnodeRetriveAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
if
(
strcmp
(
user
,
TSDB_NETTEST_USER
)
==
0
)
{
char
pass
[
32
]
=
{
0
};
taosEncryptPass
((
uint8_t
*
)
user
,
strlen
(
user
),
pass
);
*
spi
=
0
;
*
encrypt
=
0
;
*
ckey
=
0
;
memcpy
(
secret
,
pass
,
TSDB_KEY_LEN
);
mDebug
(
"nettest user is authorized"
);
return
0
;
}
return
0
;
}
\ No newline at end of file
source/server/mnode/src/mondeInt.c
浏览文件 @
3b1add19
...
...
@@ -61,6 +61,10 @@ void mnodeSendMsgToMnode(struct SRpcMsg *rpcMsg) { return (*tsMint.fp.SendMsgToM
void
mnodeSendRedirectMsg
(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
)
{
(
*
tsMint
.
fp
.
SendRedirectMsg
)(
rpcMsg
,
forShell
);
}
void
mnodeGetDnodeEp
(
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
)
{
(
*
tsMint
.
fp
.
GetDnodeEp
)(
dnodeId
,
ep
,
fqdn
,
port
);
}
int32_t
mnodeGetStatistics
(
SMnodeStat
*
stat
)
{
return
0
;
}
static
int32_t
mnodeSetPara
(
SMnodePara
para
)
{
...
...
@@ -242,5 +246,3 @@ void mnodeCleanup() {
mInfo
(
"mnode is cleaned up"
);
}
}
int32_t
mnodeRetriveAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录