Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f8d35c2a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f8d35c2a
编写于
3月 06, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compile error
上级
a00be5e3
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
97 addition
and
92 deletion
+97
-92
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+0
-32
src/dnode/src/dnodeSystem.c
src/dnode/src/dnodeSystem.c
+15
-9
src/mnode/CMakeLists.txt
src/mnode/CMakeLists.txt
+1
-1
src/mnode/inc/mgmtMnode.h
src/mnode/inc/mgmtMnode.h
+2
-2
src/mnode/src/mgmtBalance.c
src/mnode/src/mgmtBalance.c
+0
-8
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+18
-2
src/plugins/http/CMakeLists.txt
src/plugins/http/CMakeLists.txt
+1
-1
src/plugins/http/src/httpSystem.c
src/plugins/http/src/httpSystem.c
+15
-7
src/sdb/CMakeLists.txt
src/sdb/CMakeLists.txt
+1
-1
src/sdb/inc/sdbint.h
src/sdb/inc/sdbint.h
+2
-2
src/sdb/src/sdbEngine.c
src/sdb/src/sdbEngine.c
+4
-4
src/sdb/src/sdbstr.c
src/sdb/src/sdbstr.c
+38
-23
未找到文件。
src/dnode/src/dnodeModule.c
浏览文件 @
f8d35c2a
...
...
@@ -68,38 +68,6 @@ void dnodeCleanUpModules() {
}
}
void
dnodeProcessModuleStatus
(
uint32_t
status
)
{
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_RUNING
)
{
return
;
}
int
news
=
status
;
int
olds
=
tsModuleStatus
;
for
(
int
moduleType
=
0
;
moduleType
<
TSDB_MOD_MAX
;
++
moduleType
)
{
int
newStatus
=
news
&
(
1
<<
moduleType
);
int
oldStatus
=
olds
&
(
1
<<
moduleType
);
if
(
oldStatus
>
0
)
{
if
(
newStatus
==
0
)
{
if
(
tsModule
[
moduleType
].
stopFp
)
{
dPrint
(
"module:%s is stopped on this node"
,
tsModule
[
moduleType
].
name
);
(
*
tsModule
[
moduleType
].
stopFp
)();
}
}
}
else
if
(
oldStatus
==
0
)
{
if
(
newStatus
>
0
)
{
if
(
tsModule
[
moduleType
].
startFp
)
{
dPrint
(
"module:%s is started on this node"
,
tsModule
[
moduleType
].
name
);
(
*
tsModule
[
moduleType
].
startFp
)();
}
}
}
else
{
}
}
tsModuleStatus
=
status
;
}
int32_t
dnodeInitModules
()
{
for
(
int
mod
=
0
;
mod
<
TSDB_MOD_MAX
;
++
mod
)
{
if
(
tsModule
[
mod
].
num
!=
0
&&
tsModule
[
mod
].
initFp
)
{
...
...
src/dnode/src/dnodeSystem.c
浏览文件 @
f8d35c2a
...
...
@@ -33,12 +33,14 @@
#include "dnodeVnodeMgmt.h"
#ifdef CLUSTER
//#include "acct.h"
//#include "admin.h"
//#include "cluster.h"
//#include "grant.h"
//#include "replica.h"
//#include "storage.h"
#include "account.h"
#include "admin.h"
#include "balance.h"
#include "cluster.h"
#include "grant.h"
#include "mpeer.h"
#include "storage.h"
#include "vpeer.h"
#endif
static
pthread_mutex_t
tsDnodeMutex
;
...
...
@@ -89,8 +91,6 @@ void dnodeCleanUpSystem() {
dnodeSetRunStatus
(
TSDB_DNODE_RUN_STATUS_STOPPED
);
}
dnodeCleanupShell
();
dnodeCleanUpModules
();
dnodeCleanupVnodes
();
...
...
@@ -112,7 +112,13 @@ void dnodeCheckDataDirOpenned(const char *dir) {
void
dnodeInitPlugins
()
{
#ifdef CLUSTER
acctInit
();
// acctInit();
// adminInit();
// balanceInit();
// clusterInit();
// grantInit();
// mpeerInit();
// storageInit();
#endif
}
...
...
src/mnode/CMakeLists.txt
浏览文件 @
f8d35c2a
...
...
@@ -14,7 +14,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
TARGET_LINK_LIBRARIES
(
mnode trpc tutil sdb pthread
)
IF
(
TD_CLUSTER
)
TARGET_LINK_LIBRARIES
(
mnode
acct
)
TARGET_LINK_LIBRARIES
(
mnode
)
ENDIF
()
ENDIF
()
...
...
src/mnode/inc/mgmtMnode.h
浏览文件 @
f8d35c2a
...
...
@@ -24,8 +24,8 @@ extern "C" {
#include <stdbool.h>
#include "mnode.h"
int32_t
mgmt
InitMnodes
(
);
void
mgmtCleanUpMnodes
(
);
int32_t
mgmt
AddMnode
(
uint32_t
privateIp
,
uint32_t
publicIp
);
int32_t
mgmtRemoveMnode
(
uint32_t
privateIp
);
int32_t
mgmtGetMnodeMeta
(
STableMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
int32_t
mgmtRetrieveMnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
...
...
src/mnode/src/mgmtBalance.c
浏览文件 @
f8d35c2a
...
...
@@ -77,11 +77,3 @@ int32_t mgmtAllocVnodes(SVgObj *pVgroup) {
return
0
;
}
}
char
*
mgmtGetVnodeStatus
(
SVgObj
*
pVgroup
,
SVnodeGid
*
pVnode
)
{
if
(
mgmtGetVnodeStatusFp
)
{
return
(
*
mgmtGetVnodeStatusFp
)(
pVgroup
,
pVnode
);
}
else
{
return
"master"
;
}
}
src/mnode/src/mgmtMnode.c
浏览文件 @
f8d35c2a
...
...
@@ -18,11 +18,27 @@
#include "mgmtMnode.h"
#include "mgmtUser.h"
int32_t
(
*
mgmt
InitMnodesFp
)(
)
=
NULL
;
void
(
*
mgmtCleanUpMnodesFp
)(
)
=
NULL
;
int32_t
(
*
mgmt
AddMnodeFp
)(
uint32_t
privateIp
,
uint32_t
publicIp
)
=
NULL
;
int32_t
(
*
mgmtRemoveMnodeFp
)(
uint32_t
privateIp
)
=
NULL
;
int32_t
(
*
mgmtGetMnodesNumFp
)()
=
NULL
;
void
*
(
*
mgmtGetNextMnodeFp
)(
SShowObj
*
pShow
,
SSdbPeer
**
pMnode
)
=
NULL
;
int32_t
mgmtAddMnode
(
uint32_t
privateIp
,
uint32_t
publicIp
)
{
if
(
mgmtAddMnodeFp
)
{
return
(
*
mgmtAddMnodeFp
)(
privateIp
,
publicIp
);
}
else
{
return
0
;
}
}
int32_t
mgmtRemoveMnode
(
uint32_t
privateIp
)
{
if
(
mgmtRemoveMnodeFp
)
{
return
(
*
mgmtRemoveMnodeFp
)(
privateIp
);
}
else
{
return
0
;
}
}
static
int32_t
mgmtGetMnodesNum
()
{
if
(
mgmtGetMnodesNumFp
)
{
return
(
*
mgmtGetMnodesNumFp
)();
...
...
src/plugins/http/CMakeLists.txt
浏览文件 @
f8d35c2a
...
...
@@ -13,6 +13,6 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
TARGET_LINK_LIBRARIES
(
http taos_static z
)
IF
(
TD_CLUSTER
)
TARGET_LINK_LIBRARIES
(
http
http_admin
)
TARGET_LINK_LIBRARIES
(
http
)
ENDIF
()
ENDIF
()
src/plugins/http/src/httpSystem.c
浏览文件 @
f8d35c2a
...
...
@@ -34,13 +34,21 @@
#include "tgHandle.h"
#include "tlog.h"
#ifdef CLUSTER
void
adminInitHandle
(
HttpServer
*
pServer
);
void
opInitHandle
(
HttpServer
*
pServer
);
#else
void
adminInitHandle
(
HttpServer
*
pServer
)
{}
void
opInitHandle
(
HttpServer
*
pServer
)
{}
#endif
void
(
*
adminInitHandleFp
)(
HttpServer
*
pServer
)
=
NULL
;
void
(
*
opInitHandleFp
)(
HttpServer
*
pServer
)
=
NULL
;
void
adminInitHandle
(
HttpServer
*
pServer
)
{
if
(
adminInitHandleFp
)
{
(
*
adminInitHandleFp
)(
pServer
);
}
}
void
opInitHandle
(
HttpServer
*
pServer
)
{
if
(
opInitHandleFp
)
{
(
*
opInitHandleFp
)(
pServer
);
}
}
static
HttpServer
*
httpServer
=
NULL
;
void
taosInitNote
(
int
numOfNoteLines
,
int
maxNotes
,
char
*
lable
);
...
...
src/sdb/CMakeLists.txt
浏览文件 @
f8d35c2a
...
...
@@ -11,6 +11,6 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
ADD_LIBRARY
(
sdb
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
sdb trpc
)
IF
(
TD_CLUSTER
)
TARGET_LINK_LIBRARIES
(
sdb
mreplica
)
TARGET_LINK_LIBRARIES
(
sdb
)
ENDIF
()
ENDIF
()
src/sdb/inc/sdbint.h
浏览文件 @
f8d35c2a
...
...
@@ -84,7 +84,7 @@ typedef struct {
char
*
row
;
}
SSdbUpdate
;
typedef
struct
{
typedef
struct
_SSdbTable
{
SSdbHeader
header
;
int
maxRows
;
int
dbId
;
...
...
@@ -132,7 +132,7 @@ extern int sdbMaxPeers;
extern
int
sdbNumOfTables
;
extern
int64_t
sdbVersion
;
int
mpeer
ForwardDbReqToPeer
(
SSdbTable
*
pTable
,
char
type
,
char
*
data
,
int
dataLen
);
int
sdb
ForwardDbReqToPeer
(
SSdbTable
*
pTable
,
char
type
,
char
*
data
,
int
dataLen
);
int
mpeerRetrieveRows
(
int
fd
,
SSdbTable
*
pTable
,
uint64_t
version
);
void
sdbResetTable
(
SSdbTable
*
pTable
);
extern
const
int16_t
sdbFileVersion
;
...
...
src/sdb/src/sdbEngine.c
浏览文件 @
f8d35c2a
...
...
@@ -430,7 +430,7 @@ int64_t sdbInsertRow(void *handle, void *row, int rowSize) {
pthread_mutex_lock
(
&
pTable
->
mutex
);
if
(
mpeer
ForwardDbReqToPeer
(
pTable
,
SDB_TYPE_INSERT
,
rowHead
->
data
,
rowHead
->
rowSize
)
==
0
)
{
if
(
sdb
ForwardDbReqToPeer
(
pTable
,
SDB_TYPE_INSERT
,
rowHead
->
data
,
rowHead
->
rowSize
)
==
0
)
{
pTable
->
id
++
;
sdbVersion
++
;
if
(
pTable
->
keyType
==
SDB_KEYTYPE_AUTO
)
{
...
...
@@ -547,7 +547,7 @@ int sdbDeleteRow(void *handle, void *row) {
pthread_mutex_lock
(
&
pTable
->
mutex
);
if
(
mpeer
ForwardDbReqToPeer
(
pTable
,
SDB_TYPE_DELETE
,
(
char
*
)
row
,
rowSize
)
==
0
)
{
if
(
sdb
ForwardDbReqToPeer
(
pTable
,
SDB_TYPE_DELETE
,
(
char
*
)
row
,
rowSize
)
==
0
)
{
pTable
->
id
++
;
sdbVersion
++
;
...
...
@@ -665,7 +665,7 @@ int sdbUpdateRow(void *handle, void *row, int updateSize, char isUpdated) {
pthread_mutex_lock
(
&
pTable
->
mutex
);
if
(
mpeer
ForwardDbReqToPeer
(
pTable
,
SDB_TYPE_UPDATE
,
rowHead
->
data
,
rowHead
->
rowSize
)
==
0
)
{
if
(
sdb
ForwardDbReqToPeer
(
pTable
,
SDB_TYPE_UPDATE
,
rowHead
->
data
,
rowHead
->
rowSize
)
==
0
)
{
pTable
->
id
++
;
sdbVersion
++
;
...
...
@@ -744,7 +744,7 @@ int sdbBatchUpdateRow(void *handle, void *row, int rowSize) {
}
pthread_mutex_lock
(
&
pTable
->
mutex
);
if
(
mpeer
ForwardDbReqToPeer
(
pTable
,
SDB_TYPE_BATCH_UPDATE
,
row
,
rowSize
)
==
0
)
{
if
(
sdb
ForwardDbReqToPeer
(
pTable
,
SDB_TYPE_BATCH_UPDATE
,
row
,
rowSize
)
==
0
)
{
/* // write action */
/* write(pTable->fd, &action, sizeof(action)); */
/* pTable->size += sizeof(action); */
...
...
src/sdb/src/sdbstr.c
浏览文件 @
f8d35c2a
...
...
@@ -12,32 +12,47 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "sdbint.h"
char
*
sdbStatusStr
[]
=
{
"offline"
,
"unsynced"
,
"syncing"
,
"serving"
,
"null"
};
char
*
sdbRoleStr
[]
=
{
"unauthed"
,
"undecided"
,
"master"
,
"slave"
,
"null"
};
#ifndef CLUSTER
/*
* Lite Version sync request is always successful
*/
int
mpeerForwardDbReqToPeer
(
SSdbTable
*
pTable
,
char
type
,
char
*
data
,
int
dataLen
)
{
return
0
;
int32_t
(
*
mpeerInitMnodesFp
)(
char
*
directory
)
=
NULL
;
void
(
*
mpeerCleanUpMnodesFp
)()
=
NULL
;
int32_t
(
*
mpeerForwardRequestFp
)(
SSdbTable
*
pTable
,
char
type
,
void
*
cont
,
int32_t
contLen
)
=
NULL
;
char
*
sdbStatusStr
[]
=
{
"offline"
,
"unsynced"
,
"syncing"
,
"serving"
,
"null"
};
char
*
sdbRoleStr
[]
=
{
"unauthed"
,
"undecided"
,
"master"
,
"slave"
,
"null"
};
int32_t
sdbForwardDbReqToPeer
(
SSdbTable
*
pTable
,
char
type
,
char
*
data
,
int32_t
dataLen
)
{
if
(
mpeerForwardRequestFp
)
{
return
mpeerForwardRequestFp
(
pTable
,
type
,
data
,
dataLen
);
}
else
{
return
0
;
}
}
/*
* Lite Version does not need to initialize peers
*/
int
sdbInitPeers
(
char
*
directory
)
{
return
0
;
int32_t
sdbInitPeers
(
char
*
directory
)
{
if
(
mpeerInitMnodesFp
)
{
return
(
*
mpeerInitMnodesFp
)(
directory
);
}
else
{
return
0
;
}
}
/*
* Lite Version does not need to cleanup peers
*/
void
sdbCleanUpPeers
(){}
#endif
\ No newline at end of file
void
sdbCleanUpPeers
()
{
if
(
mpeerCleanUpMnodesFp
)
{
(
*
mpeerCleanUpMnodesFp
)();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录