Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
daafc0fe
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看板
提交
daafc0fe
编写于
9月 29, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10430] interface of dnode/mnode/vnode module
上级
3e995bd3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
203 addition
and
56 deletion
+203
-56
include/server/dnode/dnode.h
include/server/dnode/dnode.h
+17
-17
include/server/mnode/mnode.h
include/server/mnode/mnode.h
+111
-20
include/server/vnode/vnode.h
include/server/vnode/vnode.h
+75
-19
未找到文件。
include/server/dnode/dnode.h
浏览文件 @
daafc0fe
...
...
@@ -21,53 +21,53 @@ extern "C" {
#endif
/**
* Initialize and start the dnode module
* Initialize and start the dnode module
.
*
* @return Instance of dnode module
* @return Instance of dnode module
.
*/
struct
Dnode
*
dnodeCreateInstance
();
/**
* Stop and cleanup dnode module
* Stop and cleanup dnode module
.
*
* @param dnode
Instance of dnode module
* @param dnode
, instance of dnode module.
*/
void
dnodeCleanupInstance
(
struct
Dnode
*
dnode
);
/**
* Send messages to other dnodes, such as create vnode message.
*
* @param dnode
The instance of Dnode module
* @param epSet
T
he endpoint list of the dnodes.
* @param rpcMsg
M
essage to be sent.
* @param dnode
, the instance of Dnode module.
* @param epSet
, t
he endpoint list of the dnodes.
* @param rpcMsg
, m
essage to be sent.
*/
void
dnodeSendMsgToDnode
(
struct
Dnode
*
dnode
,
struct
SRpcEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
/**
* Send messages to mnode, such as config message.
*
* @param dnode
The instance of dnode module
* @param rpcMsg
M
essage to be sent.
* @param dnode
, the instance of dnode module.
* @param rpcMsg
, m
essage to be sent.
*/
void
dnodeSendMsgToMnode
(
struct
Dnode
*
dnode
,
struct
SRpcMsg
*
rpcMsg
);
/**
* Send redirect message to dnode or shell.
*
* @param dnode
The instance of dnode module
* @param rpcMsg
M
essage to be sent.
* @param forShell
U
sed to identify whether to send to shell or dnode.
* @param dnode
, the instance of dnode module.
* @param rpcMsg
, m
essage to be sent.
* @param forShell
, u
sed to identify whether to send to shell or dnode.
*/
void
dnodeSendRedirectMsg
(
struct
Dnode
*
dnode
,
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
);
/**
* Get the corresponding endpoint information from dnodeId.
*
* @param dnode
The instance of Dnode 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
* @param dnode
, the instance of dnode 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
dnodeGetDnodeEp
(
struct
Dnode
*
dnode
,
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
...
...
include/server/mnode/mnode.h
浏览文件 @
daafc0fe
...
...
@@ -20,49 +20,140 @@
extern
"C"
{
#endif
struct
SRpcMsg
;
struct
Dnode
;
typedef
struct
{
/**
* Send messages to other dnodes, such as create vnode message.
*
* @param dnode, the instance of dnode module.
* @param epSet, the endpoint list of the dnodes.
* @param rpcMsg, message to be sent.
*/
void
(
*
SendMsgToDnode
)(
struct
Dnode
*
dnode
,
struct
SRpcEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
/**
* Send messages to mnode, such as config message.
*
* @param dnode, the instance of dnode module.
* @param rpcMsg, message to be sent.
*/
void
(
*
SendMsgToMnode
)(
struct
Dnode
*
dnode
,
struct
SRpcMsg
*
rpcMsg
);
/**
* Send redirect message to dnode or shell.
*
* @param dnode, the instance of dnode module.
* @param rpcMsg, message to be sent.
* @param forShell, used to identify whether to send to shell or dnode.
*/
void
(
*
SendRedirectMsg
)(
struct
Dnode
*
dnode
,
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
)(
struct
Dnode
*
dnode
,
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
}
SMnodeFp
;
typedef
struct
{
struct
Dnode
*
dnode
;
SMnodeFp
fp
;
char
clusterId
[
TSDB_CLUSTER_ID_LEN
];
int32_t
dnodeId
;
}
SMnodePara
;
/**
* Deploy Mnode instances in Dnode.
*
* @return Error Code.
* Initialize and start mnode module.
*
* @param para, initialization parameters.
* @return Instance of mnode module.
*/
int32_t
mnodeDeploy
(
);
struct
Mnode
*
mnodeCreateInstance
(
SMnodePara
para
);
/**
* Delete the Mnode instance deployed in Dnode.
* Stop and cleanup mnode module.
*
* @param mnode, instance of mnode module.
*/
void
mnode
UnDeploy
(
);
void
mnode
CleanupInstance
(
struct
Mnode
*
vnode
);
/**
* Start Mnode service.
*
* Deploy mnode instances in dnode.
*
* @param mnode, instance of mnode module.
* @param minfos, server information used to deploy the mnode instance.
* @return Error Code.
*/
int32_t
mnode
Start
(
);
int32_t
mnode
Deploy
(
struct
Mnode
*
mnode
,
struct
SMInfos
*
minfos
);
/**
* Stop Mnode service.
* Delete the mnode instance deployed in dnode.
*
* @param mnode, instance of mnode module.
*/
int32_t
mnodeStop
(
);
void
mnodeUnDeploy
(
struct
Mnode
*
mnode
);
/**
* Interface for processing messages.
*
* @param pMsg Message to be processed.
* @return Error code
*
* @param mnode, instance of mnode module.
* @param rpcMsg, message to be processed.
* @return Error code.
*/
int32_t
mnodeProcessMsg
(
SRpcMsg
*
p
Msg
);
void
mnodeProcessMsg
(
struct
Mnode
*
mnode
,
SRpcMsg
*
rpc
Msg
);
/**
* Whether the Mnode is in service.
*
* Whether the mnode is in service.
*
* @param mnode, instance of mnode module.
* @return Server status.
*/
bool
mnodeIsServing
();
bool
mnodeIsServing
(
struct
Mnode
*
mnode
);
typedef
struct
{
int64_t
numOfDnode
;
int64_t
numOfMnode
;
int64_t
numOfVgroup
;
int64_t
numOfDatabase
;
int64_t
numOfSuperTable
;
int64_t
numOfChildTable
;
int64_t
numOfColumn
;
int64_t
totalPoints
;
int64_t
totalStorage
;
int64_t
compStorage
;
}
SMnodeStat
;
/**
* Get the statistical information of Mnode.
*
* @param mnode, instance of mnode module.
* @param stat, statistical information.
* @return Error Code.
*/
int32_t
mnodeGetStatistics
(
struct
Mnode
*
mnode
,
SMnodeStat
*
stat
);
/**
* Get the statistical information of Mnode.
*
* @param mnode, instance of mnode module.
* @param user, username.
* @param spi, security parameter index.
* @param encrypt, encrypt algorithm.
* @param secret, key for authentication.
* @param ckey, ciphering key.
* @return Error Code.
*/
int32_t
mnodeRetriveAuth
(
struct
Mnode
*
mnode
,
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_MNODE_H_*/
\ No newline at end of file
#endif
/*_TD_MNODE_H_*/
include/server/vnode/vnode.h
浏览文件 @
daafc0fe
...
...
@@ -20,43 +20,99 @@
extern
"C"
{
#endif
struct
SRpcMsg
;
struct
Dnode
;
typedef
struct
{
/**
* Send messages to other dnodes, such as create vnode message.
*
* @param dnode, the instance of dnode module.
* @param epSet, the endpoint list of dnodes.
* @param rpcMsg, message to be sent.
*/
void
(
*
SendMsgToDnode
)(
struct
Dnode
*
dnode
,
struct
SRpcEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
/**
* Send messages to mnode, such as config message.
*
* @param dnode, the instance of dnode module.
* @param rpcMsg, message to be sent.
*/
void
(
*
SendMsgToMnode
)(
struct
Dnode
*
dnode
,
struct
SRpcMsg
*
rpcMsg
);
/**
* Get the corresponding endpoint information from dnodeId.
*
* @param dnode, the instance of dnode 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
)(
struct
Dnode
*
dnode
,
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
}
SVnodeFp
;
typedef
struct
{
struct
Dnode
*
dnode
;
SVnodeFp
fp
;
}
SVnodePara
;
/**
* Start
Initialize V
node module.
* Start
initialize v
node module.
*
* @return Error Code.
* @param para, initialization parameters.
* @return Instance of vnode module.
*/
int32_t
vnodeInit
(
);
struct
Vnode
*
vnodeCreateInstance
(
SVnodePara
para
);
/**
* Cleanup Vnode module.
* Cleanup vnode module.
*
* @param vnode, instance of vnode module.
*/
void
vnodeCleanup
(
);
void
vnodeCleanup
Instance
(
struct
Vnode
*
vnode
);
typedef
struct
{
int64_t
queryMsgCount
;
int64_t
writeMsgCount
;
int32_t
unused
;
}
SVnodeStat
;
/**
* Get the statistical information of
Vnode
* Get the statistical information of
vnode.
*
* @param stat Statistical information.
* @param vnode, instance of vnode module.
* @param sta, statistical information.
* @return Error Code.
*/
int32_t
vnodeGetStatistics
(
SVnodeStat
*
stat
);
int32_t
vnodeGetStatistics
(
struct
Vnode
*
vnode
,
SVnodeStat
*
stat
);
/**
/**
* Interface for processing messages.
*
* @param pMsg Message to be processed.
* @return Error code
* @param vnode, instance of vnode module.
* @param msg, message to be processed.
*/
void
vnodeProcessMsg
(
struct
Vnode
*
vnode
,
SRpcMsg
*
msg
);
/**
* Get the status of all vnodes.
*
* @param vnode, instance of vnode module.
* @param status, status msg.
*/
void
vnodeGetStatus
(
struct
Vnode
*
vnode
,
struct
SStatusMsg
*
status
);
/**
* Set access permissions for all vnodes.
*
* @param vnode, instance of vnode module.
* @param access, access permissions of vnodes.
* @param numOfVnodes, the size of vnodes.
*/
int32_t
vnodeProcessMsg
(
SRpcMsg
*
pMsg
);
void
vnodeSetAccess
(
struct
Vnode
*
vnode
,
struct
SVgroupAccess
*
access
,
int32_t
numOfVnodes
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_VNODE_H_*/
\ No newline at end of file
#endif
/*_TD_VNODE_H_*/
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录