提交 d6ed7605 编写于 作者: S slguan

#1177

上级 78d9ffd7
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
ADD_SUBDIRECTORY(detail)
ADD_SUBDIRECTORY(lite)
\ No newline at end of file
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/dnode/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/detail/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/vnode/detail/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc)
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(mnode ${SRC})
TARGET_LINK_LIBRARIES(mnode trpc tutil sdb pthread)
IF (TD_CLUSTER)
TARGET_LINK_LIBRARIES(mnode mcluster)
ELSEIF (TD_LITE)
TARGET_LINK_LIBRARIES(mnode mlite)
ENDIF ()
ENDIF ()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/dnode/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/detail/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/vnode/detail/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc)
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(mnode ${SRC})
TARGET_LINK_LIBRARIES(mnode trpc tutil sdb pthread)
IF (TD_CLUSTER)
TARGET_LINK_LIBRARIES(mnode mcluster)
ELSEIF (TD_LITE)
TARGET_LINK_LIBRARIES(mnode mlite)
ENDIF ()
ENDIF ()
......@@ -16,56 +16,4 @@
#define _DEFAULT_SOURCE
#include "mgmt.h"
extern void *userSdb;
extern void *dbSdb;
SAcctObj acctObj;
int mgmtInitAccts() { return 0; }
void mgmtCreateRootAcct() {}
SAcctObj *mgmtGetAcct(char *name) { return &acctObj; }
int mgmtCheckUserLimit(SAcctObj *pAcct) {
int numOfUsers = sdbGetNumOfRows(userSdb);
if (numOfUsers >= tsMaxUsers) {
mWarn("numOfUsers:%d, exceed tsMaxUsers:%d", numOfUsers, tsMaxUsers);
return TSDB_CODE_TOO_MANY_USERS;
}
return 0;
}
int mgmtCheckDbLimit(SAcctObj *pAcct) {
int numOfDbs = sdbGetNumOfRows(dbSdb);
if (numOfDbs >= tsMaxDbs) {
mWarn("numOfDbs:%d, exceed tsMaxDbs:%d", numOfDbs, tsMaxDbs);
return TSDB_CODE_TOO_MANY_DATABSES;
}
return 0;
}
int mgmtCheckMeterLimit(SAcctObj *pAcct) { return 0; }
int mgmtCheckUserGrant() { return 0; }
int mgmtCheckDbGrant() { return 0; }
int mgmtCheckMeterGrant() { return 0; }
void grantAddTimeSeries(uint32_t timeSeriesNum) {}
void mgmtCheckAcct() {
SAcctObj *pAcct = &acctObj;
pAcct->acctId = 0;
strcpy(pAcct->user, "root");
mgmtCreateUser(pAcct, "root", "taosdata");
mgmtCreateUser(pAcct, "monitor", tsInternalPass);
mgmtCreateUser(pAcct, "_root", tsInternalPass);
}
void mgmtCleanUpAccts() {}
int mgmtGetAcctMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn) { return TSDB_CODE_OPS_NOT_SUPPORT; }
int mgmtRetrieveAccts(SShowObj *pShow, char *data, int rows, SConnObj *pConn) { return 0; }
......@@ -19,6 +19,11 @@
#include "mgmt.h"
#include "tschemautil.h"
extern void *userSdb;
extern void *dbSdb;
SAcctObj acctObj;
int mgmtGetAcctsNum();
SShowObj *mgmtGetNextAcct(SShowObj *pShow, SAcctObj **pAcct);
......@@ -126,3 +131,58 @@ int mgmtRemoveConnFromAcct(SConnObj *pConn) {
return 0;
}
/*
* Edge Version Implementation
*/
int mgmtInitAcctsImp() { return 0; }
int (*mgmtInitAccts)() = mgmtInitAcctsImp;
void mgmtCreateRootAcct() {}
SAcctObj *mgmtGetAcct(char *name) { return &acctObj; }
int mgmtCheckUserLimit(SAcctObj *pAcct) {
int numOfUsers = sdbGetNumOfRows(userSdb);
if (numOfUsers >= tsMaxUsers) {
mWarn("numOfUsers:%d, exceed tsMaxUsers:%d", numOfUsers, tsMaxUsers);
return TSDB_CODE_TOO_MANY_USERS;
}
return 0;
}
int mgmtCheckDbLimit(SAcctObj *pAcct) {
int numOfDbs = sdbGetNumOfRows(dbSdb);
if (numOfDbs >= tsMaxDbs) {
mWarn("numOfDbs:%d, exceed tsMaxDbs:%d", numOfDbs, tsMaxDbs);
return TSDB_CODE_TOO_MANY_DATABSES;
}
return 0;
}
int mgmtCheckMeterLimit(SAcctObj *pAcct) { return 0; }
int mgmtCheckUserGrant() { return 0; }
int mgmtCheckDbGrant() { return 0; }
int mgmtCheckMeterGrant() { return 0; }
void grantAddTimeSeries(uint32_t timeSeriesNum) {}
void mgmtCheckAcct() {
SAcctObj *pAcct = &acctObj;
pAcct->acctId = 0;
strcpy(pAcct->user, "root");
mgmtCreateUser(pAcct, "root", "taosdata");
mgmtCreateUser(pAcct, "monitor", tsInternalPass);
mgmtCreateUser(pAcct, "_root", tsInternalPass);
}
void mgmtCleanUpAccts() {}
int mgmtGetAcctMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn) { return TSDB_CODE_OPS_NOT_SUPPORT; }
int mgmtRetrieveAccts(SShowObj *pShow, char *data, int rows, SConnObj *pConn) { return 0; }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册