Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
10485e33
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看板
提交
10485e33
编写于
3月 30, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-17] make cluster can be compiled
上级
ecae31bb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
77 addition
and
9 deletion
+77
-9
src/mnode/src/mgmtAcct.c
src/mnode/src/mgmtAcct.c
+74
-6
src/mnode/src/mgmtGrant.c
src/mnode/src/mgmtGrant.c
+1
-1
src/util/src/tglobalcfg.c
src/util/src/tglobalcfg.c
+2
-2
未找到文件。
src/mnode/src/mgmtAcct.c
浏览文件 @
10485e33
...
@@ -14,11 +14,11 @@
...
@@ -14,11 +14,11 @@
*/
*/
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#ifndef _ACCOUNT
#include "os.h"
#include "os.h"
#include "taoserror.h"
#include "taoserror.h"
#include "mnode.h"
#include "mnode.h"
#include "mgmtAcct.h"
#include "mgmtAcct.h"
#ifndef _ACCOUNT
static
SAcctObj
tsAcctObj
=
{
0
};
static
SAcctObj
tsAcctObj
=
{
0
};
...
@@ -31,10 +31,78 @@ int32_t acctInit() {
...
@@ -31,10 +31,78 @@ int32_t acctInit() {
void
acctCleanUp
()
{}
void
acctCleanUp
()
{}
SAcctObj
*
acctGetAcct
(
char
*
acctName
)
{
return
&
tsAcctObj
;
}
SAcctObj
*
acctGetAcct
(
char
*
acctName
)
{
return
&
tsAcctObj
;
}
int32_t
acctCheck
(
SAcctObj
*
pAcct
,
EAcctGrantType
type
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
acctCheck
(
SAcctObj
*
pAcct
,
EAcctGrantType
type
)
{
return
TSDB_CODE_SUCCESS
;
}
#endif
int32_t
acctAddDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
pthread_mutex_lock
(
&
pAcct
->
mutex
);
pDb
->
next
=
pAcct
->
pHead
;
pDb
->
prev
=
NULL
;
pDb
->
pAcct
=
pAcct
;
if
(
pAcct
->
pHead
)
{
pAcct
->
pHead
->
prev
=
pDb
;
}
pAcct
->
pHead
=
pDb
;
pAcct
->
acctInfo
.
numOfDbs
++
;
pthread_mutex_unlock
(
&
pAcct
->
mutex
);
return
0
;
}
int32_t
acctRemoveDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
pthread_mutex_lock
(
&
pAcct
->
mutex
);
if
(
pDb
->
prev
)
{
pDb
->
prev
->
next
=
pDb
->
next
;
}
if
(
pDb
->
next
)
{
pDb
->
next
->
prev
=
pDb
->
prev
;
}
if
(
pDb
->
prev
==
NULL
)
{
pAcct
->
pHead
=
pDb
->
next
;
}
pAcct
->
acctInfo
.
numOfDbs
--
;
pthread_mutex_unlock
(
&
pAcct
->
mutex
);
return
0
;
}
int32_t
acctAddUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
pthread_mutex_lock
(
&
pAcct
->
mutex
);
pUser
->
next
=
pAcct
->
pUser
;
pUser
->
prev
=
NULL
;
if
(
pAcct
->
pUser
)
{
pAcct
->
pUser
->
prev
=
pUser
;
}
pAcct
->
pUser
=
pUser
;
pAcct
->
acctInfo
.
numOfUsers
++
;
pUser
->
pAcct
=
pAcct
;
pthread_mutex_unlock
(
&
pAcct
->
mutex
);
return
0
;
}
int32_t
acctRemoveUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
pthread_mutex_lock
(
&
pAcct
->
mutex
);
if
(
pUser
->
prev
)
{
pUser
->
prev
->
next
=
pUser
->
next
;
}
if
(
pUser
->
next
)
{
pUser
->
next
->
prev
=
pUser
->
prev
;
}
if
(
pUser
->
prev
==
NULL
)
{
pAcct
->
pUser
=
pUser
->
next
;
}
int32_t
acctAddDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
return
TSDB_CODE_SUCCESS
;
}
pAcct
->
acctInfo
.
numOfUsers
--
;
int32_t
acctRemoveDb
(
SAcctObj
*
pAcct
,
SDbObj
*
pDb
)
{
return
TSDB_CODE_SUCCESS
;
}
pthread_mutex_unlock
(
&
pAcct
->
mutex
);
int32_t
acctAddUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
acctRemoveUser
(
SAcctObj
*
pAcct
,
SUserObj
*
pUser
)
{
return
TSDB_CODE_SUCCESS
;
}
#endif
return
0
;
\ No newline at end of file
}
\ No newline at end of file
src/mnode/src/mgmtGrant.c
浏览文件 @
10485e33
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
int32_t
grantInit
()
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
grantInit
()
{
return
TSDB_CODE_SUCCESS
;
}
void
grantCleanUp
()
{}
void
grantCleanUp
()
{}
void
grantParseParameter
()
{
mError
(
"can't parsed parameter k"
);
}
void
grantParseParameter
()
{
mError
(
"can't parsed parameter k"
);
}
int32_t
grantCheck
(
EGrantType
grant
)
{
return
true
;
}
int32_t
grantCheck
(
EGrantType
grant
)
{
return
TSDB_CODE_SUCCESS
;
}
void
grantReset
(
EGrantType
grant
,
uint64_t
value
)
{}
void
grantReset
(
EGrantType
grant
,
uint64_t
value
)
{}
void
grantAdd
(
EGrantType
grant
,
uint64_t
value
)
{}
void
grantAdd
(
EGrantType
grant
,
uint64_t
value
)
{}
void
grantRestore
(
EGrantType
grant
,
uint64_t
value
)
{}
void
grantRestore
(
EGrantType
grant
,
uint64_t
value
)
{}
...
...
src/util/src/tglobalcfg.c
浏览文件 @
10485e33
...
@@ -81,7 +81,7 @@ float tsRatioOfQueryThreads = 0.5;
...
@@ -81,7 +81,7 @@ float tsRatioOfQueryThreads = 0.5;
char
tsPublicIp
[
TSDB_IPv4ADDR_LEN
]
=
{
0
};
char
tsPublicIp
[
TSDB_IPv4ADDR_LEN
]
=
{
0
};
char
tsPrivateIp
[
TSDB_IPv4ADDR_LEN
]
=
{
0
};
char
tsPrivateIp
[
TSDB_IPv4ADDR_LEN
]
=
{
0
};
short
tsNumOfVnodesPerCore
=
8
;
short
tsNumOfVnodesPerCore
=
8
;
short
tsNumOfTotalVnodes
=
0
;
short
tsNumOfTotalVnodes
=
TSDB_INVALID_VNODE_NUM
;
short
tsCheckHeaderFile
=
0
;
short
tsCheckHeaderFile
=
0
;
#ifdef _TD_ARM_32_
#ifdef _TD_ARM_32_
...
@@ -960,7 +960,7 @@ bool tsReadGlobalConfig() {
...
@@ -960,7 +960,7 @@ bool tsReadGlobalConfig() {
tsNumOfCores
=
1
;
tsNumOfCores
=
1
;
}
}
if
(
tsNumOfTotalVnodes
==
-
1
)
{
if
(
tsNumOfTotalVnodes
==
TSDB_INVALID_VNODE_NUM
)
{
tsNumOfTotalVnodes
=
tsNumOfCores
*
tsNumOfVnodesPerCore
;
tsNumOfTotalVnodes
=
tsNumOfCores
*
tsNumOfVnodesPerCore
;
tsNumOfTotalVnodes
=
tsNumOfTotalVnodes
>
TSDB_MAX_VNODES
?
TSDB_MAX_VNODES
:
tsNumOfTotalVnodes
;
tsNumOfTotalVnodes
=
tsNumOfTotalVnodes
>
TSDB_MAX_VNODES
?
TSDB_MAX_VNODES
:
tsNumOfTotalVnodes
;
tsNumOfTotalVnodes
=
tsNumOfTotalVnodes
<
TSDB_MIN_VNODES
?
TSDB_MIN_VNODES
:
tsNumOfTotalVnodes
;
tsNumOfTotalVnodes
=
tsNumOfTotalVnodes
<
TSDB_MIN_VNODES
?
TSDB_MIN_VNODES
:
tsNumOfTotalVnodes
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录