提交 f1f30749 编写于 作者: S slguan

[TD-63]

上级 9961bf33
...@@ -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 ()
......
...@@ -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
} }
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册