Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
~笨蛋陪你哭
TDengine
提交
64f57318
T
TDengine
项目概览
~笨蛋陪你哭
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
64f57318
编写于
4月 03, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-93] add ref to sdb
上级
2a41cd21
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
22 deletion
+9
-22
src/inc/mnode.h
src/inc/mnode.h
+0
-4
src/mnode/inc/mgmtAcct.h
src/mnode/inc/mgmtAcct.h
+0
-2
src/mnode/src/mgmtAcct.c
src/mnode/src/mgmtAcct.c
+0
-6
src/mnode/src/mgmtDb.c
src/mnode/src/mgmtDb.c
+2
-2
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+4
-4
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+3
-4
未找到文件。
src/inc/mnode.h
浏览文件 @
64f57318
...
...
@@ -59,7 +59,6 @@ typedef struct {
char
mnodeName
[
TSDB_DNODE_NAME_LEN
+
1
];
int8_t
reserved
[
15
];
int8_t
updateEnd
[
1
];
int32_t
refCount
;
int
syncFd
;
void
*
hbTimer
;
void
*
pSync
;
...
...
@@ -85,7 +84,6 @@ typedef struct {
char
dnodeName
[
TSDB_DNODE_NAME_LEN
+
1
];
int8_t
reserved
[
15
];
int8_t
updateEnd
[
1
];
int32_t
refCount
;
SVnodeLoad
vload
[
TSDB_MAX_VNODES
];
int32_t
status
;
uint32_t
lastReboot
;
// time stamp for last reboot
...
...
@@ -153,7 +151,6 @@ typedef struct _vg_obj {
int8_t
lbStatus
;
int8_t
reserved
[
14
];
int8_t
updateEnd
[
1
];
int32_t
refCount
;
struct
_vg_obj
*
prev
,
*
next
;
struct
_db_obj
*
pDb
;
int32_t
numOfTables
;
...
...
@@ -219,7 +216,6 @@ typedef struct _acctObj {
int8_t
dirty
;
int8_t
reserved
[
14
];
int8_t
updateEnd
[
1
];
int32_t
refCount
;
SAcctInfo
acctInfo
;
pthread_mutex_t
mutex
;
}
SAcctObj
;
...
...
src/mnode/inc/mgmtAcct.h
浏览文件 @
64f57318
...
...
@@ -30,8 +30,6 @@ typedef enum {
int32_t
acctInit
();
void
acctCleanUp
();
SAcctObj
*
acctGetAcct
(
char
*
acctName
);
void
acctIncRef
(
SAcctObj
*
pAcct
);
void
acctDecRef
(
SAcctObj
*
pAcct
);
int32_t
acctCheck
(
SAcctObj
*
pAcct
,
EAcctGrantType
type
);
void
acctAddDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
);
...
...
src/mnode/src/mgmtAcct.c
浏览文件 @
64f57318
...
...
@@ -32,31 +32,25 @@ int32_t acctInit() {
void
acctCleanUp
()
{}
SAcctObj
*
acctGetAcct
(
char
*
acctName
)
{
return
&
tsAcctObj
;
}
void
acctIncRef
(
SAcctObj
*
pAcct
)
{}
void
acctDecRef
(
SAcctObj
*
pAcct
)
{}
int32_t
acctCheck
(
SAcctObj
*
pAcct
,
EAcctGrantType
type
)
{
return
TSDB_CODE_SUCCESS
;
}
#endif
void
acctAddDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
atomic_add_fetch_32
(
&
pAcct
->
acctInfo
.
numOfDbs
,
1
);
pDb
->
pAcct
=
pAcct
;
acctIncRef
(
pAcct
);
}
void
acctRemoveDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
atomic_sub_fetch_32
(
&
pAcct
->
acctInfo
.
numOfDbs
,
1
);
pDb
->
pAcct
=
NULL
;
acctDecRef
(
pAcct
);
}
void
acctAddUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
atomic_add_fetch_32
(
&
pAcct
->
acctInfo
.
numOfUsers
,
1
);
pUser
->
pAcct
=
pAcct
;
acctIncRef
(
pAcct
);
}
void
acctRemoveUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
atomic_sub_fetch_32
(
&
pAcct
->
acctInfo
.
numOfUsers
,
1
);
pUser
->
pAcct
=
NULL
;
acctDecRef
(
pAcct
);
}
\ No newline at end of file
src/mnode/src/mgmtDb.c
浏览文件 @
64f57318
...
...
@@ -33,7 +33,7 @@
#include "mgmtUser.h"
#include "mgmtVgroup.h"
static
void
*
tsDbSdb
=
NULL
;
void
*
tsDbSdb
=
NULL
;
static
int32_t
tsDbUpdateSize
;
static
int32_t
mgmtCreateDb
(
SAcctObj
*
pAcct
,
SCMCreateDbMsg
*
pCreate
);
...
...
@@ -116,7 +116,7 @@ int32_t mgmtInitDbs() {
.
tableName
=
"dbs"
,
.
hashSessions
=
TSDB_MAX_DBS
,
.
maxRowSize
=
tsDbUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
refCountPos
=
0
,
//
(int8_t *)(&tObj.refCount) - (int8_t *)&tObj,
.
keyType
=
SDB_KEY_TYPE_STRING
,
.
insertFp
=
mgmtDbActionInsert
,
.
deleteFp
=
mgmtDbActionDelete
,
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
64f57318
...
...
@@ -45,8 +45,8 @@
#include "mgmtUser.h"
#include "mgmtVgroup.h"
static
void
*
tsChildTableSdb
;
static
void
*
tsSuperTableSdb
;
void
*
tsChildTableSdb
;
void
*
tsSuperTableSdb
;
static
int32_t
tsChildTableUpdateSize
;
static
int32_t
tsSuperTableUpdateSize
;
...
...
@@ -239,7 +239,7 @@ static int32_t mgmtInitChildTables() {
.
tableName
=
"ctables"
,
.
hashSessions
=
tsMaxTables
,
.
maxRowSize
=
sizeof
(
SChildTableObj
)
+
sizeof
(
SSchema
)
*
TSDB_MAX_COLUMNS
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
refCountPos
=
0
,
//
(int8_t *)(&tObj.refCount) - (int8_t *)&tObj,
.
keyType
=
SDB_KEY_TYPE_STRING
,
.
insertFp
=
mgmtChildTableActionInsert
,
.
deleteFp
=
mgmtChildTableActionDelete
,
...
...
@@ -415,7 +415,7 @@ static int32_t mgmtInitSuperTables() {
.
tableName
=
"stables"
,
.
hashSessions
=
TSDB_MAX_SUPER_TABLES
,
.
maxRowSize
=
tsSuperTableUpdateSize
+
sizeof
(
SSchema
)
*
TSDB_MAX_COLUMNS
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
refCountPos
=
0
,
//
(int8_t *)(&tObj.refCount) - (int8_t *)&tObj,
.
keyType
=
SDB_KEY_TYPE_STRING
,
.
insertFp
=
mgmtSuperTableActionInsert
,
.
deleteFp
=
mgmtSuperTableActionDelete
,
...
...
src/mnode/src/mgmtUser.c
浏览文件 @
64f57318
...
...
@@ -25,7 +25,7 @@
#include "mgmtShell.h"
#include "mgmtUser.h"
static
void
*
tsUserSdb
=
NULL
;
void
*
tsUserSdb
=
NULL
;
static
int32_t
tsUserUpdateSize
=
0
;
static
int32_t
mgmtGetUserMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mgmtRetrieveUsers
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
...
...
@@ -97,7 +97,7 @@ int32_t mgmtInitUsers() {
.
tableName
=
"users"
,
.
hashSessions
=
TSDB_MAX_USERS
,
.
maxRowSize
=
tsUserUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
refCountPos
=
0
,
//
(int8_t *)(&tObj.refCount) - (int8_t *)&tObj,
.
keyType
=
SDB_KEY_TYPE_STRING
,
.
insertFp
=
mgmtUserActionInsert
,
.
deleteFp
=
mgmtUserActionDelete
,
...
...
@@ -117,8 +117,7 @@ int32_t mgmtInitUsers() {
mgmtCreateUser
(
pAcct
,
"root"
,
"taosdata"
);
mgmtCreateUser
(
pAcct
,
"monitor"
,
tsInternalPass
);
mgmtCreateUser
(
pAcct
,
"_root"
,
tsInternalPass
);
acctDecRef
(
pAcct
);
mgmtAddShellMsgHandle
(
TSDB_MSG_TYPE_CM_CREATE_USER
,
mgmtProcessCreateUserMsg
);
mgmtAddShellMsgHandle
(
TSDB_MSG_TYPE_CM_ALTER_USER
,
mgmtProcessAlterUserMsg
);
mgmtAddShellMsgHandle
(
TSDB_MSG_TYPE_CM_DROP_USER
,
mgmtProcessDropUserMsg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录