提交 f1f30749 编写于 作者: S slguan

[TD-63]

上级 9961bf33
......@@ -13,6 +13,10 @@ IF (TD_ACCOUNT)
ADD_DEFINITIONS(-D_ACCOUNT)
ENDIF ()
IF (TD_GRANT)
ADD_DEFINITIONS(-D_GRANT)
ENDIF ()
IF (TD_GODLL)
ADD_DEFINITIONS(-D_TD_GO_DLL_)
ENDIF ()
......
......@@ -22,11 +22,17 @@
#include "mnode.h"
bool mgmtCheckExpired();
void mgmtParseParameterKFp();
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 mgmtCheckUserGrant();
int32_t mgmtCheckDbGrant();
int32_t mgmtCheckDnodeGrant();
int32_t mgmtCheckAccts();
#ifdef __cplusplus
}
......
......@@ -14,58 +14,20 @@
*/
#define _DEFAULT_SOURCE
#ifndef _GRANT
#include "os.h"
#include "mgmtAcct.h"
int32_t (*mgmtCheckUserGrantFp)() = NULL;
int32_t (*mgmtCheckDbGrantFp)() = NULL;
void (*mgmtAddTimeSeriesFp)(uint32_t timeSeriesNum) = NULL;
void (*mgmtRestoreTimeSeriesFp)(uint32_t timeSeriesNum) = NULL;
int32_t (*mgmtCheckTimeSeriesFp)(uint32_t timeseries) = NULL;
bool (*mgmtCheckExpiredFp)() = NULL;
int32_t mgmtCheckUserGrant() {
if (mgmtCheckUserGrantFp) {
return (*mgmtCheckUserGrantFp)();
} else {
return 0;
}
}
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;
}
}
#include "mgmtGrant.h"
bool mgmtCheckExpired() { return false; }
void mgmtParseParameterKFp() {}
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) { return TSDB_CODE_SUCCESS; }
int32_t mgmtCheckUserGrant() { return TSDB_CODE_SUCCESS; }
int32_t mgmtCheckDbGrant() { return TSDB_CODE_SUCCESS; }
int32_t mgmtCheckDnodeGrant() { return TSDB_CODE_SUCCESS; }
int32_t mgmtCheckAccts() { return TSDB_CODE_SUCCESS; }
#endif
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册