Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f8d35c2a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
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() {
...
@@ -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
()
{
int32_t
dnodeInitModules
()
{
for
(
int
mod
=
0
;
mod
<
TSDB_MOD_MAX
;
++
mod
)
{
for
(
int
mod
=
0
;
mod
<
TSDB_MOD_MAX
;
++
mod
)
{
if
(
tsModule
[
mod
].
num
!=
0
&&
tsModule
[
mod
].
initFp
)
{
if
(
tsModule
[
mod
].
num
!=
0
&&
tsModule
[
mod
].
initFp
)
{
...
...
src/dnode/src/dnodeSystem.c
浏览文件 @
f8d35c2a
...
@@ -33,12 +33,14 @@
...
@@ -33,12 +33,14 @@
#include "dnodeVnodeMgmt.h"
#include "dnodeVnodeMgmt.h"
#ifdef CLUSTER
#ifdef CLUSTER
//#include "acct.h"
#include "account.h"
//#include "admin.h"
#include "admin.h"
//#include "cluster.h"
#include "balance.h"
//#include "grant.h"
#include "cluster.h"
//#include "replica.h"
#include "grant.h"
//#include "storage.h"
#include "mpeer.h"
#include "storage.h"
#include "vpeer.h"
#endif
#endif
static
pthread_mutex_t
tsDnodeMutex
;
static
pthread_mutex_t
tsDnodeMutex
;
...
@@ -89,8 +91,6 @@ void dnodeCleanUpSystem() {
...
@@ -89,8 +91,6 @@ void dnodeCleanUpSystem() {
dnodeSetRunStatus
(
TSDB_DNODE_RUN_STATUS_STOPPED
);
dnodeSetRunStatus
(
TSDB_DNODE_RUN_STATUS_STOPPED
);
}
}
dnodeCleanupShell
();
dnodeCleanupShell
();
dnodeCleanUpModules
();
dnodeCleanUpModules
();
dnodeCleanupVnodes
();
dnodeCleanupVnodes
();
...
@@ -112,7 +112,13 @@ void dnodeCheckDataDirOpenned(const char *dir) {
...
@@ -112,7 +112,13 @@ void dnodeCheckDataDirOpenned(const char *dir) {
void
dnodeInitPlugins
()
{
void
dnodeInitPlugins
()
{
#ifdef CLUSTER
#ifdef CLUSTER
acctInit
();
// acctInit();
// adminInit();
// balanceInit();
// clusterInit();
// grantInit();
// mpeerInit();
// storageInit();
#endif
#endif
}
}
...
...
src/mnode/CMakeLists.txt
浏览文件 @
f8d35c2a
...
@@ -14,7 +14,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
...
@@ -14,7 +14,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
TARGET_LINK_LIBRARIES
(
mnode trpc tutil sdb pthread
)
TARGET_LINK_LIBRARIES
(
mnode trpc tutil sdb pthread
)
IF
(
TD_CLUSTER
)
IF
(
TD_CLUSTER
)
TARGET_LINK_LIBRARIES
(
mnode
acct
)
TARGET_LINK_LIBRARIES
(
mnode
)
ENDIF
()
ENDIF
()
ENDIF
()
ENDIF
()
...
...
src/mnode/inc/mgmtMnode.h
浏览文件 @
f8d35c2a
...
@@ -24,8 +24,8 @@ extern "C" {
...
@@ -24,8 +24,8 @@ extern "C" {
#include <stdbool.h>
#include <stdbool.h>
#include "mnode.h"
#include "mnode.h"
int32_t
mgmt
InitMnodes
(
);
int32_t
mgmt
AddMnode
(
uint32_t
privateIp
,
uint32_t
publicIp
);
void
mgmtCleanUpMnodes
(
);
int32_t
mgmtRemoveMnode
(
uint32_t
privateIp
);
int32_t
mgmtGetMnodeMeta
(
STableMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
int32_t
mgmtGetMnodeMeta
(
STableMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
int32_t
mgmtRetrieveMnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
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) {
...
@@ -77,11 +77,3 @@ int32_t mgmtAllocVnodes(SVgObj *pVgroup) {
return
0
;
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 @@
...
@@ -18,11 +18,27 @@
#include "mgmtMnode.h"
#include "mgmtMnode.h"
#include "mgmtUser.h"
#include "mgmtUser.h"
int32_t
(
*
mgmt
InitMnodesFp
)(
)
=
NULL
;
int32_t
(
*
mgmt
AddMnodeFp
)(
uint32_t
privateIp
,
uint32_t
publicIp
)
=
NULL
;
void
(
*
mgmtCleanUpMnodesFp
)(
)
=
NULL
;
int32_t
(
*
mgmtRemoveMnodeFp
)(
uint32_t
privateIp
)
=
NULL
;
int32_t
(
*
mgmtGetMnodesNumFp
)()
=
NULL
;
int32_t
(
*
mgmtGetMnodesNumFp
)()
=
NULL
;
void
*
(
*
mgmtGetNextMnodeFp
)(
SShowObj
*
pShow
,
SSdbPeer
**
pMnode
)
=
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
()
{
static
int32_t
mgmtGetMnodesNum
()
{
if
(
mgmtGetMnodesNumFp
)
{
if
(
mgmtGetMnodesNumFp
)
{
return
(
*
mgmtGetMnodesNumFp
)();
return
(
*
mgmtGetMnodesNumFp
)();
...
...
src/plugins/http/CMakeLists.txt
浏览文件 @
f8d35c2a
...
@@ -13,6 +13,6 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
...
@@ -13,6 +13,6 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
TARGET_LINK_LIBRARIES
(
http taos_static z
)
TARGET_LINK_LIBRARIES
(
http taos_static z
)
IF
(
TD_CLUSTER
)
IF
(
TD_CLUSTER
)
TARGET_LINK_LIBRARIES
(
http
http_admin
)
TARGET_LINK_LIBRARIES
(
http
)
ENDIF
()
ENDIF
()
ENDIF
()
ENDIF
()
src/plugins/http/src/httpSystem.c
浏览文件 @
f8d35c2a
...
@@ -34,13 +34,21 @@
...
@@ -34,13 +34,21 @@
#include "tgHandle.h"
#include "tgHandle.h"
#include "tlog.h"
#include "tlog.h"
#ifdef CLUSTER
void
adminInitHandle
(
HttpServer
*
pServer
);
void
(
*
adminInitHandleFp
)(
HttpServer
*
pServer
)
=
NULL
;
void
opInitHandle
(
HttpServer
*
pServer
);
void
(
*
opInitHandleFp
)(
HttpServer
*
pServer
)
=
NULL
;
#else
void
adminInitHandle
(
HttpServer
*
pServer
)
{}
void
adminInitHandle
(
HttpServer
*
pServer
)
{
void
opInitHandle
(
HttpServer
*
pServer
)
{}
if
(
adminInitHandleFp
)
{
#endif
(
*
adminInitHandleFp
)(
pServer
);
}
}
void
opInitHandle
(
HttpServer
*
pServer
)
{
if
(
opInitHandleFp
)
{
(
*
opInitHandleFp
)(
pServer
);
}
}
static
HttpServer
*
httpServer
=
NULL
;
static
HttpServer
*
httpServer
=
NULL
;
void
taosInitNote
(
int
numOfNoteLines
,
int
maxNotes
,
char
*
lable
);
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))
...
@@ -11,6 +11,6 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
ADD_LIBRARY
(
sdb
${
SRC
}
)
ADD_LIBRARY
(
sdb
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
sdb trpc
)
TARGET_LINK_LIBRARIES
(
sdb trpc
)
IF
(
TD_CLUSTER
)
IF
(
TD_CLUSTER
)
TARGET_LINK_LIBRARIES
(
sdb
mreplica
)
TARGET_LINK_LIBRARIES
(
sdb
)
ENDIF
()
ENDIF
()
ENDIF
()
ENDIF
()
src/sdb/inc/sdbint.h
浏览文件 @
f8d35c2a
...
@@ -84,7 +84,7 @@ typedef struct {
...
@@ -84,7 +84,7 @@ typedef struct {
char
*
row
;
char
*
row
;
}
SSdbUpdate
;
}
SSdbUpdate
;
typedef
struct
{
typedef
struct
_SSdbTable
{
SSdbHeader
header
;
SSdbHeader
header
;
int
maxRows
;
int
maxRows
;
int
dbId
;
int
dbId
;
...
@@ -132,7 +132,7 @@ extern int sdbMaxPeers;
...
@@ -132,7 +132,7 @@ extern int sdbMaxPeers;
extern
int
sdbNumOfTables
;
extern
int
sdbNumOfTables
;
extern
int64_t
sdbVersion
;
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
);
int
mpeerRetrieveRows
(
int
fd
,
SSdbTable
*
pTable
,
uint64_t
version
);
void
sdbResetTable
(
SSdbTable
*
pTable
);
void
sdbResetTable
(
SSdbTable
*
pTable
);
extern
const
int16_t
sdbFileVersion
;
extern
const
int16_t
sdbFileVersion
;
...
...
src/sdb/src/sdbEngine.c
浏览文件 @
f8d35c2a
...
@@ -430,7 +430,7 @@ int64_t sdbInsertRow(void *handle, void *row, int rowSize) {
...
@@ -430,7 +430,7 @@ int64_t sdbInsertRow(void *handle, void *row, int rowSize) {
pthread_mutex_lock
(
&
pTable
->
mutex
);
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
++
;
pTable
->
id
++
;
sdbVersion
++
;
sdbVersion
++
;
if
(
pTable
->
keyType
==
SDB_KEYTYPE_AUTO
)
{
if
(
pTable
->
keyType
==
SDB_KEYTYPE_AUTO
)
{
...
@@ -547,7 +547,7 @@ int sdbDeleteRow(void *handle, void *row) {
...
@@ -547,7 +547,7 @@ int sdbDeleteRow(void *handle, void *row) {
pthread_mutex_lock
(
&
pTable
->
mutex
);
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
++
;
pTable
->
id
++
;
sdbVersion
++
;
sdbVersion
++
;
...
@@ -665,7 +665,7 @@ int sdbUpdateRow(void *handle, void *row, int updateSize, char isUpdated) {
...
@@ -665,7 +665,7 @@ int sdbUpdateRow(void *handle, void *row, int updateSize, char isUpdated) {
pthread_mutex_lock
(
&
pTable
->
mutex
);
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
++
;
pTable
->
id
++
;
sdbVersion
++
;
sdbVersion
++
;
...
@@ -744,7 +744,7 @@ int sdbBatchUpdateRow(void *handle, void *row, int rowSize) {
...
@@ -744,7 +744,7 @@ int sdbBatchUpdateRow(void *handle, void *row, int rowSize) {
}
}
pthread_mutex_lock
(
&
pTable
->
mutex
);
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 action */
/* write(pTable->fd, &action, sizeof(action)); */
/* write(pTable->fd, &action, sizeof(action)); */
/* pTable->size += sizeof(action); */
/* pTable->size += sizeof(action); */
...
...
src/sdb/src/sdbstr.c
浏览文件 @
f8d35c2a
...
@@ -12,32 +12,47 @@
...
@@ -12,32 +12,47 @@
* You should have received a copy of the GNU Affero General Public License
* 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/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#define _DEFAULT_SOURCE
#include "sdbint.h"
#include "sdbint.h"
char
*
sdbStatusStr
[]
=
{
"offline"
,
"unsynced"
,
"syncing"
,
"serving"
,
"null"
};
int32_t
(
*
mpeerInitMnodesFp
)(
char
*
directory
)
=
NULL
;
void
(
*
mpeerCleanUpMnodesFp
)()
=
NULL
;
char
*
sdbRoleStr
[]
=
{
"unauthed"
,
"undecided"
,
"master"
,
"slave"
,
"null"
};
int32_t
(
*
mpeerForwardRequestFp
)(
SSdbTable
*
pTable
,
char
type
,
void
*
cont
,
int32_t
contLen
)
=
NULL
;
#ifndef CLUSTER
char
*
sdbStatusStr
[]
=
{
"offline"
,
/*
"unsynced"
,
* Lite Version sync request is always successful
"syncing"
,
*/
"serving"
,
int
mpeerForwardDbReqToPeer
(
SSdbTable
*
pTable
,
char
type
,
char
*
data
,
int
dataLen
)
{
"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
;
return
0
;
}
}
}
/*
int32_t
sdbInitPeers
(
char
*
directory
)
{
* Lite Version does not need to initialize peers
if
(
mpeerInitMnodesFp
)
{
*/
return
(
*
mpeerInitMnodesFp
)(
directory
);
int
sdbInitPeers
(
char
*
directory
)
{
}
else
{
return
0
;
return
0
;
}
}
}
/*
void
sdbCleanUpPeers
()
{
* Lite Version does not need to cleanup peers
if
(
mpeerCleanUpMnodesFp
)
{
*/
(
*
mpeerCleanUpMnodesFp
)();
void
sdbCleanUpPeers
(){}
}
}
#endif
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录