Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
f1f30749
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f1f30749
编写于
3月 27, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-63]
上级
9961bf33
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
57 deletion
+29
-57
cmake/define.inc
cmake/define.inc
+4
-0
src/mnode/inc/mgmtGrant.h
src/mnode/inc/mgmtGrant.h
+9
-3
src/mnode/src/mgmtGrant.c
src/mnode/src/mgmtGrant.c
+16
-54
未找到文件。
cmake/define.inc
浏览文件 @
f1f30749
...
@@ -13,6 +13,10 @@ IF (TD_ACCOUNT)
...
@@ -13,6 +13,10 @@ IF (TD_ACCOUNT)
ADD_DEFINITIONS
(
-
D_ACCOUNT
)
ADD_DEFINITIONS
(
-
D_ACCOUNT
)
ENDIF
()
ENDIF
()
IF
(
TD_GRANT
)
ADD_DEFINITIONS
(
-
D_GRANT
)
ENDIF
()
IF
(
TD_GODLL
)
IF
(
TD_GODLL
)
ADD_DEFINITIONS
(
-
D_TD_GO_DLL_
)
ADD_DEFINITIONS
(
-
D_TD_GO_DLL_
)
ENDIF
()
ENDIF
()
...
...
src/mnode/inc/mgmtGrant.h
浏览文件 @
f1f30749
...
@@ -21,12 +21,18 @@
...
@@ -21,12 +21,18 @@
#endif
#endif
#include "mnode.h"
#include "mnode.h"
bool
mgmtCheckExpired
();
bool
mgmtCheckExpired
();
void
mgmtAddTimeSeries
(
SAcctObj
*
pAcct
,
uint32_t
timeSeriesNum
);
void
mgmtParseParameterKFp
();
void
mgmtRestoreTimeSeries
(
SAcctObj
*
pAcct
,
uint32_t
timeseries
);
void
mgmtSendMsgToMaster
();
void
mgmtSetCurStorage
(
uint64_t
storage
);
void
mgmtAddTimeSeries
(
SAcctObj
*
pAcct
,
uint32_t
timeSeriesNum
);
void
mgmtRestoreTimeSeries
(
SAcctObj
*
pAcct
,
uint32_t
timeseries
);
int32_t
mgmtCheckTimeSeries
(
uint32_t
timeseries
);
int32_t
mgmtCheckTimeSeries
(
uint32_t
timeseries
);
int32_t
mgmtCheckUserGrant
();
int32_t
mgmtCheckUserGrant
();
int32_t
mgmtCheckDbGrant
();
int32_t
mgmtCheckDbGrant
();
int32_t
mgmtCheckDnodeGrant
();
int32_t
mgmtCheckAccts
();
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/mnode/src/mgmtGrant.c
浏览文件 @
f1f30749
...
@@ -14,58 +14,20 @@
...
@@ -14,58 +14,20 @@
*/
*/
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#ifndef _GRANT
#include "os.h"
#include "os.h"
#include "mgmtAcct.h"
#include "mgmtGrant.h"
int32_t
(
*
mgmtCheckUserGrantFp
)()
=
NULL
;
bool
mgmtCheckExpired
()
{
return
false
;
}
int32_t
(
*
mgmtCheckDbGrantFp
)()
=
NULL
;
void
mgmtParseParameterKFp
()
{}
void
(
*
mgmtAddTimeSeriesFp
)(
uint32_t
timeSeriesNum
)
=
NULL
;
void
mgmtSendMsgToMaster
()
{}
void
(
*
mgmtRestoreTimeSeriesFp
)(
uint32_t
timeSeriesNum
)
=
NULL
;
void
mgmtSetCurStorage
(
uint64_t
storage
)
{}
int32_t
(
*
mgmtCheckTimeSeriesFp
)(
uint32_t
timeseries
)
=
NULL
;
void
mgmtAddTimeSeries
(
SAcctObj
*
pAcct
,
uint32_t
timeSeriesNum
)
{}
bool
(
*
mgmtCheckExpiredFp
)()
=
NULL
;
void
mgmtRestoreTimeSeries
(
SAcctObj
*
pAcct
,
uint32_t
timeseries
)
{}
int32_t
mgmtCheckTimeSeries
(
uint32_t
timeseries
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
mgmtCheckUserGrant
()
{
int32_t
mgmtCheckUserGrant
()
{
return
TSDB_CODE_SUCCESS
;
}
if
(
mgmtCheckUserGrantFp
)
{
int32_t
mgmtCheckDbGrant
()
{
return
TSDB_CODE_SUCCESS
;
}
return
(
*
mgmtCheckUserGrantFp
)();
int32_t
mgmtCheckDnodeGrant
()
{
return
TSDB_CODE_SUCCESS
;
}
}
else
{
int32_t
mgmtCheckAccts
()
{
return
TSDB_CODE_SUCCESS
;
}
return
0
;
}
#endif
}
\ No newline at end of file
int32_t
mgmtCheckDbGrant
()
{
if
(
mgmtCheckDbGrantFp
)
{
return
(
*
mgmtCheckDbGrantFp
)();
}
else
{
return
0
;
}
}
void
mgmtAddTimeSeries
(
SAcctObj
*
pAcct
,
uint32_t
timeSeriesNum
)
{
pAcct
->
acctInfo
.
numOfTimeSeries
+=
timeSeriesNum
;
if
(
mgmtAddTimeSeriesFp
)
{
(
*
mgmtAddTimeSeriesFp
)(
timeSeriesNum
);
}
}
void
mgmtRestoreTimeSeries
(
SAcctObj
*
pAcct
,
uint32_t
timeSeriesNum
)
{
pAcct
->
acctInfo
.
numOfTimeSeries
-=
timeSeriesNum
;
if
(
mgmtRestoreTimeSeriesFp
)
{
(
*
mgmtRestoreTimeSeriesFp
)(
timeSeriesNum
);
}
}
int32_t
mgmtCheckTimeSeries
(
uint32_t
timeseries
)
{
if
(
mgmtCheckTimeSeriesFp
)
{
return
(
*
mgmtCheckTimeSeriesFp
)(
timeseries
);
}
else
{
return
0
;
}
}
bool
mgmtCheckExpired
()
{
if
(
mgmtCheckExpiredFp
)
{
return
mgmtCheckExpiredFp
();
}
else
{
return
false
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录