Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
王长生-AnH
TDengine
提交
d426627e
T
TDengine
项目概览
王长生-AnH
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d426627e
编写于
4月 17, 2020
作者:
H
hzcheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/2.0tsdb
上级
dfa8e5be
c36735c4
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
111 addition
and
114 deletion
+111
-114
cmake/define.inc
cmake/define.inc
+1
-1
cmake/input.inc
cmake/input.inc
+0
-8
src/dnode/inc/dnodeMClient.h
src/dnode/inc/dnodeMClient.h
+1
-1
src/dnode/src/dnodeMClient.c
src/dnode/src/dnodeMClient.c
+1
-1
src/inc/mnode.h
src/inc/mnode.h
+0
-3
src/inc/tadmin.h
src/inc/tadmin.h
+3
-8
src/mnode/src/mgmtAcct.c
src/mnode/src/mgmtAcct.c
+3
-3
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+9
-1
src/os/darwin/src/tdarwin.c
src/os/darwin/src/tdarwin.c
+5
-0
src/os/linux/src/tlinux.c
src/os/linux/src/tlinux.c
+8
-5
src/os/windows/src/twintimer.c
src/os/windows/src/twintimer.c
+5
-1
src/plugins/http/CMakeLists.txt
src/plugins/http/CMakeLists.txt
+2
-2
src/plugins/http/inc/httpHandle.h
src/plugins/http/inc/httpHandle.h
+26
-3
src/plugins/http/src/httpSystem.c
src/plugins/http/src/httpSystem.c
+7
-20
src/plugins/monitor/src/monitorSystem.c
src/plugins/monitor/src/monitorSystem.c
+22
-2
src/util/CMakeLists.txt
src/util/CMakeLists.txt
+0
-4
src/util/inc/tlog.h
src/util/inc/tlog.h
+0
-42
src/util/inc/tutil.h
src/util/inc/tutil.h
+1
-0
src/util/src/ttimer.c
src/util/src/ttimer.c
+16
-8
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+1
-1
未找到文件。
cmake/define.inc
浏览文件 @
d426627e
...
@@ -6,7 +6,7 @@ IF (TD_SYNC)
...
@@ -6,7 +6,7 @@ IF (TD_SYNC)
ENDIF
()
ENDIF
()
IF
(
TD_ACCOUNT
)
IF
(
TD_ACCOUNT
)
ADD_DEFINITIONS
(
-
D_ACC
OUN
T
)
ADD_DEFINITIONS
(
-
D_ACCT
)
ENDIF
()
ENDIF
()
IF
(
TD_ADMIN
)
IF
(
TD_ADMIN
)
...
...
cmake/input.inc
浏览文件 @
d426627e
CMAKE_MINIMUM_REQUIRED
(
VERSION
2.8
)
CMAKE_MINIMUM_REQUIRED
(
VERSION
2.8
)
PROJECT
(
TDengine
)
PROJECT
(
TDengine
)
IF
(
$
{
CLUSTER
}
MATCHES
"true"
)
SET
(
TD_CLUSTER
TRUE
)
MESSAGE
(
STATUS
"Build with cluster plugins"
)
ELSEIF
(
$
{
CLUSTER
}
MATCHES
"false"
)
SET
(
TD_CLUSTER
FALSE
)
MESSAGE
(
STATUS
"Build without cluster plugins"
)
ENDIF
()
IF
(
$
{
ACCOUNT
}
MATCHES
"true"
)
IF
(
$
{
ACCOUNT
}
MATCHES
"true"
)
SET
(
TD_ACCOUNT
TRUE
)
SET
(
TD_ACCOUNT
TRUE
)
MESSAGE
(
STATUS
"Build with account plugins"
)
MESSAGE
(
STATUS
"Build with account plugins"
)
...
...
src/dnode/inc/dnodeMClient.h
浏览文件 @
d426627e
...
@@ -23,7 +23,7 @@ extern "C" {
...
@@ -23,7 +23,7 @@ extern "C" {
int32_t
dnodeInitMClient
();
int32_t
dnodeInitMClient
();
void
dnodeCleanupMClient
();
void
dnodeCleanupMClient
();
void
dnodeSendMsgToMnode
(
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToMnode
(
SRpcMsg
*
rpcMsg
);
void
*
dnodeGetM
peerInfos
();
void
*
dnodeGetM
nodeList
();
int32_t
dnodeGetDnodeId
();
int32_t
dnodeGetDnodeId
();
#ifdef __cplusplus
#ifdef __cplusplus
...
...
src/dnode/src/dnodeMClient.c
浏览文件 @
d426627e
...
@@ -332,7 +332,7 @@ uint32_t dnodeGetMnodeMasteIp() {
...
@@ -332,7 +332,7 @@ uint32_t dnodeGetMnodeMasteIp() {
return
tsMnodeIpList
.
ip
[
tsMnodeIpList
.
inUse
];
return
tsMnodeIpList
.
ip
[
tsMnodeIpList
.
inUse
];
}
}
void
*
dnodeGetM
peerInfos
()
{
void
*
dnodeGetM
nodeList
()
{
return
&
tsMnodeInfos
;
return
&
tsMnodeInfos
;
}
}
...
...
src/inc/mnode.h
浏览文件 @
d426627e
...
@@ -25,9 +25,6 @@ int32_t mgmtStartSystem();
...
@@ -25,9 +25,6 @@ int32_t mgmtStartSystem();
void
mgmtCleanUpSystem
();
void
mgmtCleanUpSystem
();
void
mgmtStopSystem
();
void
mgmtStopSystem
();
extern
char
version
[];
extern
char
tsMnodeDir
[];
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
src/inc/tadmin.h
浏览文件 @
d426627e
...
@@ -20,15 +20,10 @@
...
@@ -20,15 +20,10 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#include <stdint.h>
struct
HttpServer
;
#include <stdbool.h>
void
adminInit
();
void
adminInitHandle
(
struct
HttpServer
*
pServer
);
void
opInitHandle
(
struct
HttpServer
*
pServer
);
struct
_http_server_obj_
;
extern
void
(
*
adminInitHandleFp
)(
struct
_http_server_obj_
*
pServer
);
extern
void
(
*
opInitHandleFp
)(
struct
_http_server_obj_
*
pServer
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/mnode/src/mgmtAcct.c
浏览文件 @
d426627e
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
#include "mgmtSdb.h"
#include "mgmtSdb.h"
#include "mgmtUser.h"
#include "mgmtUser.h"
static
void
*
tsAcctSdb
=
NULL
;
void
*
tsAcctSdb
=
NULL
;
static
int32_t
tsAcctUpdateSize
;
int32_t
tsAcctUpdateSize
;
static
void
mgmtCreateRootAcct
();
static
void
mgmtCreateRootAcct
();
static
int32_t
mgmtActionAcctDestroy
(
SSdbOperDesc
*
pOper
)
{
static
int32_t
mgmtActionAcctDestroy
(
SSdbOperDesc
*
pOper
)
{
...
...
src/mnode/src/mgmtMnode.c
浏览文件 @
d426627e
...
@@ -30,9 +30,9 @@
...
@@ -30,9 +30,9 @@
#include "mgmtShell.h"
#include "mgmtShell.h"
#include "mgmtUser.h"
#include "mgmtUser.h"
int32_t
tsMnodeIsMaster
=
true
;
static
void
*
tsMnodeSdb
=
NULL
;
static
void
*
tsMnodeSdb
=
NULL
;
static
int32_t
tsMnodeUpdateSize
=
0
;
static
int32_t
tsMnodeUpdateSize
=
0
;
static
int32_t
tsMnodeIsMaster
=
true
;
static
int32_t
mgmtGetMnodeMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mgmtGetMnodeMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mgmtRetrieveMnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mgmtRetrieveMnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
...
@@ -87,6 +87,14 @@ static int32_t mgmtMnodeActionDecode(SSdbOperDesc *pOper) {
...
@@ -87,6 +87,14 @@ static int32_t mgmtMnodeActionDecode(SSdbOperDesc *pOper) {
}
}
static
int32_t
mgmtMnodeActionRestored
()
{
static
int32_t
mgmtMnodeActionRestored
()
{
if
(
mgmtGetMnodesNum
()
==
1
)
{
SMnodeObj
*
pMnode
=
NULL
;
mgmtGetNextMnode
(
NULL
,
&
pMnode
);
if
(
pMnode
!=
NULL
)
{
pMnode
->
role
=
TAOS_SYNC_ROLE_MASTER
;
mgmtReleaseMnode
(
pMnode
);
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/os/darwin/src/tdarwin.c
浏览文件 @
d426627e
...
@@ -243,6 +243,11 @@ int taosInitTimer(void (*callback)(int), int ms) {
...
@@ -243,6 +243,11 @@ int taosInitTimer(void (*callback)(int), int ms) {
return
setitimer
(
ITIMER_REAL
,
&
tv
,
NULL
);
return
setitimer
(
ITIMER_REAL
,
&
tv
,
NULL
);
}
}
void
taosUninitTimer
()
{
struct
itimerval
tv
=
{
0
};
return
setitimer
(
ITIMER_REAL
,
&
tv
,
NULL
);
}
void
taosGetSystemTimezone
()
{
void
taosGetSystemTimezone
()
{
// get and set default timezone
// get and set default timezone
SGlobalConfig
*
cfg_timezone
=
tsGetConfigOption
(
"timezone"
);
SGlobalConfig
*
cfg_timezone
=
tsGetConfigOption
(
"timezone"
);
...
...
src/os/linux/src/tlinux.c
浏览文件 @
d426627e
...
@@ -286,20 +286,23 @@ void *taosProcessAlarmSignal(void *tharg) {
...
@@ -286,20 +286,23 @@ void *taosProcessAlarmSignal(void *tharg) {
return
NULL
;
return
NULL
;
}
}
static
pthread_t
timerThread
;
int
taosInitTimer
(
void
(
*
callback
)(
int
),
int
ms
)
{
int
taosInitTimer
(
void
(
*
callback
)(
int
),
int
ms
)
{
pthread_t
thread
;
pthread_attr_t
tattr
;
pthread_attr_t
tattr
;
pthread_attr_init
(
&
tattr
);
pthread_attr_init
(
&
tattr
);
pthread_attr_setdetachstate
(
&
tattr
,
PTHREAD_CREATE_DETACHED
);
int
code
=
pthread_create
(
&
timerThread
,
&
tattr
,
taosProcessAlarmSignal
,
callback
);
int
code
=
pthread_create
(
&
thread
,
&
tattr
,
taosProcessAlarmSignal
,
callback
);
pthread_detach
(
thread
);
pthread_attr_destroy
(
&
tattr
);
pthread_attr_destroy
(
&
tattr
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
tmrError
(
"failed to create timer thread"
);
tmrError
(
"failed to create timer thread"
);
return
-
1
;
return
-
1
;
}
}
return
0
;
}
return
thread
;
void
taosUninitTimer
()
{
pthread_cancel
(
timerThread
);
pthread_join
(
timerThread
,
NULL
);
}
}
ssize_t
tread
(
int
fd
,
void
*
buf
,
size_t
count
)
{
ssize_t
tread
(
int
fd
,
void
*
buf
,
size_t
count
)
{
...
...
src/os/windows/src/twintimer.c
浏览文件 @
d426627e
...
@@ -30,8 +30,8 @@ void WINAPI taosWinOnTimer(UINT wTimerID, UINT msg, DWORD_PTR dwUser, DWORD_PTR
...
@@ -30,8 +30,8 @@ void WINAPI taosWinOnTimer(UINT wTimerID, UINT msg, DWORD_PTR dwUser, DWORD_PTR
}
}
}
}
static
MMRESULT
timerId
;
int
taosInitTimer
(
win_timer_f
callback
,
int
ms
)
{
int
taosInitTimer
(
win_timer_f
callback
,
int
ms
)
{
MMRESULT
timerId
;
DWORD_PTR
param
=
*
((
int64_t
*
)
&
callback
);
DWORD_PTR
param
=
*
((
int64_t
*
)
&
callback
);
timerId
=
timeSetEvent
(
ms
,
1
,
(
LPTIMECALLBACK
)
taosWinOnTimer
,
param
,
TIME_PERIODIC
);
timerId
=
timeSetEvent
(
ms
,
1
,
(
LPTIMECALLBACK
)
taosWinOnTimer
,
param
,
TIME_PERIODIC
);
...
@@ -41,6 +41,10 @@ int taosInitTimer(win_timer_f callback, int ms) {
...
@@ -41,6 +41,10 @@ int taosInitTimer(win_timer_f callback, int ms) {
return
0
;
return
0
;
}
}
void
taosUninitTimer
()
{
timeKillEvent
(
timerId
);
}
void
taosMsleep
(
int
mseconds
)
{
void
taosMsleep
(
int
mseconds
)
{
Sleep
(
mseconds
);
Sleep
(
mseconds
);
}
}
...
...
src/plugins/http/CMakeLists.txt
浏览文件 @
d426627e
...
@@ -15,7 +15,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
...
@@ -15,7 +15,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
ADD_LIBRARY
(
http
${
SRC
}
)
ADD_LIBRARY
(
http
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
http taos_static z
)
TARGET_LINK_LIBRARIES
(
http taos_static z
)
IF
(
TD_
CLUSTER
)
IF
(
TD_
ADMIN
)
TARGET_LINK_LIBRARIES
(
http
)
TARGET_LINK_LIBRARIES
(
http
admin
)
ENDIF
()
ENDIF
()
ENDIF
()
ENDIF
()
src/plugins/http/inc/httpHandle.h
浏览文件 @
d426627e
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "taosdef.h"
#include "taosdef.h"
#include "tutil.h"
#include "tutil.h"
#include "zlib.h"
#include "zlib.h"
#include "tlog.h"
#include "http.h"
#include "http.h"
#include "httpJson.h"
#include "httpJson.h"
...
@@ -206,10 +206,10 @@ typedef struct HttpThread {
...
@@ -206,10 +206,10 @@ typedef struct HttpThread {
int
threadId
;
int
threadId
;
char
label
[
HTTP_LABEL_SIZE
];
char
label
[
HTTP_LABEL_SIZE
];
bool
(
*
processData
)(
HttpContext
*
pContext
);
bool
(
*
processData
)(
HttpContext
*
pContext
);
struct
_http_server_obj_
*
pServer
;
// handle passed by upper layer during pServer initialization
struct
HttpServer
*
pServer
;
// handle passed by upper layer during pServer initialization
}
HttpThread
;
}
HttpThread
;
typedef
struct
_http_server_obj_
{
typedef
struct
HttpServer
{
char
label
[
HTTP_LABEL_SIZE
];
char
label
[
HTTP_LABEL_SIZE
];
char
serverIp
[
16
];
char
serverIp
[
16
];
uint16_t
serverPort
;
uint16_t
serverPort
;
...
@@ -313,4 +313,27 @@ const char* httpContextStateStr(HttpContextState state);
...
@@ -313,4 +313,27 @@ const char* httpContextStateStr(HttpContextState state);
bool
httpAlterContextState
(
HttpContext
*
pContext
,
HttpContextState
srcState
,
HttpContextState
destState
);
bool
httpAlterContextState
(
HttpContext
*
pContext
,
HttpContextState
srcState
,
HttpContextState
destState
);
void
httpRemoveContextFromEpoll
(
HttpThread
*
pThread
,
HttpContext
*
pContext
);
void
httpRemoveContextFromEpoll
(
HttpThread
*
pThread
,
HttpContext
*
pContext
);
#define httpError(...) \
if (httpDebugFlag & DEBUG_ERROR) { \
tprintf("ERROR HTP ", 255, __VA_ARGS__); \
}
#define httpWarn(...) \
if (httpDebugFlag & DEBUG_WARN) { \
tprintf("WARN HTP ", httpDebugFlag, __VA_ARGS__); \
}
#define httpTrace(...) \
if (httpDebugFlag & DEBUG_TRACE) { \
tprintf("HTP ", httpDebugFlag, __VA_ARGS__); \
}
#define httpDump(...) \
if (httpDebugFlag & DEBUG_TRACE) { \
taosPrintLongString("HTP ", httpDebugFlag, __VA_ARGS__); \
}
#define httpPrint(...) \
{ tprintf("HTP ", 255, __VA_ARGS__); }
#define httpLError(...) taosLogError(__VA_ARGS__) httpError(__VA_ARGS__)
#define httpLWarn(...) taosLogWarn(__VA_ARGS__) httpWarn(__VA_ARGS__)
#define httpLPrint(...) taosLogPrint(__VA_ARGS__) httpPrint(__VA_ARGS__)
#endif
#endif
src/plugins/http/src/httpSystem.c
浏览文件 @
d426627e
...
@@ -13,11 +13,9 @@
...
@@ -13,11 +13,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include <arpa/inet.h>
#define _DEFAULT_SOURCE
#include <stdint.h>
#include "os.h"
#include <string.h>
#include "tadmin.h"
#include <unistd.h>
#include "http.h"
#include "http.h"
#include "httpCode.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpHandle.h"
...
@@ -27,28 +25,17 @@
...
@@ -27,28 +25,17 @@
#include "tglobalcfg.h"
#include "tglobalcfg.h"
#include "tsocket.h"
#include "tsocket.h"
#include "ttimer.h"
#include "ttimer.h"
#include "gcHandle.h"
#include "gcHandle.h"
#include "httpHandle.h"
#include "httpHandle.h"
#include "restHandle.h"
#include "restHandle.h"
#include "tgHandle.h"
#include "tgHandle.h"
#include "tlog.h"
#ifndef _ADMIN
void
(
*
adminInitHandleFp
)(
HttpServer
*
pServer
)
=
NULL
;
void
adminInitHandle
(
HttpServer
*
pServer
)
{}
void
(
*
opInitHandleFp
)(
HttpServer
*
pServer
)
=
NULL
;
void
opInitHandle
(
HttpServer
*
pServer
)
{}
void
adminInitHandle
(
HttpServer
*
pServer
)
{
if
(
adminInitHandleFp
)
{
(
*
adminInitHandleFp
)(
pServer
);
}
}
void
opInitHandle
(
HttpServer
*
pServer
)
{
#endif
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/plugins/monitor/src/monitorSystem.c
浏览文件 @
d426627e
...
@@ -13,17 +13,37 @@
...
@@ -13,17 +13,37 @@
* 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 "os.h"
#include "os.h"
#include "tlog.h"
#include "monitor.h"
#include "monitor.h"
#include "dnode.h"
#include "dnode.h"
#include "monitorSystem.h"
#include "tsclient.h"
#include "tsclient.h"
#include "taosdef.h"
#include "taosdef.h"
#include "tsystem.h"
#include "tsystem.h"
#include "ttime.h"
#include "ttime.h"
#include "ttimer.h"
#include "ttimer.h"
#include "tutil.h"
#include "tutil.h"
#include "monitorSystem.h"
#define monitorError(...) \
if (monitorDebugFlag & DEBUG_ERROR) { \
tprintf("ERROR MON ", 255, __VA_ARGS__); \
}
#define monitorWarn(...) \
if (monitorDebugFlag & DEBUG_WARN) { \
tprintf("WARN MON ", monitorDebugFlag, __VA_ARGS__); \
}
#define monitorTrace(...) \
if (monitorDebugFlag & DEBUG_TRACE) { \
tprintf("MON ", monitorDebugFlag, __VA_ARGS__); \
}
#define monitorPrint(...) \
{ tprintf("MON ", 255, __VA_ARGS__); }
#define monitorLError(...) taosLogError(__VA_ARGS__) monitorError(__VA_ARGS__)
#define monitorLWarn(...) taosLogWarn(__VA_ARGS__) monitorWarn(__VA_ARGS__)
#define monitorLPrint(...) taosLogPrint(__VA_ARGS__) monitorPrint(__VA_ARGS__)
#define SQL_LENGTH 1024
#define SQL_LENGTH 1024
#define LOG_LEN_STR 80
#define LOG_LEN_STR 80
...
...
src/util/CMakeLists.txt
浏览文件 @
d426627e
...
@@ -107,8 +107,4 @@ ELSEIF(TD_DARWIN_64)
...
@@ -107,8 +107,4 @@ ELSEIF(TD_DARWIN_64)
TARGET_LINK_LIBRARIES
(
tutil iconv pthread os
)
TARGET_LINK_LIBRARIES
(
tutil iconv pthread os
)
ENDIF
()
ENDIF
()
#IF (TD_CLUSTER)
# TARGET_LINK_LIBRARIES(tutil mstorage)
# TARGET_LINK_LIBRARIES(tutil mstorage)
#ENDIF ()
src/util/inc/tlog.h
浏览文件 @
d426627e
...
@@ -177,48 +177,6 @@ extern uint32_t cdebugFlag;
...
@@ -177,48 +177,6 @@ extern uint32_t cdebugFlag;
tprintf("DND QRY ", qdebugFlag, __VA_ARGS__); \
tprintf("DND QRY ", qdebugFlag, __VA_ARGS__); \
}
}
#define httpError(...) \
if (httpDebugFlag & DEBUG_ERROR) { \
tprintf("ERROR HTP ", 255, __VA_ARGS__); \
}
#define httpWarn(...) \
if (httpDebugFlag & DEBUG_WARN) { \
tprintf("WARN HTP ", httpDebugFlag, __VA_ARGS__); \
}
#define httpTrace(...) \
if (httpDebugFlag & DEBUG_TRACE) { \
tprintf("HTP ", httpDebugFlag, __VA_ARGS__); \
}
#define httpDump(...) \
if (httpDebugFlag & DEBUG_TRACE) { \
taosPrintLongString("HTP ", httpDebugFlag, __VA_ARGS__); \
}
#define httpPrint(...) \
{ tprintf("HTP ", 255, __VA_ARGS__); }
#define httpLError(...) taosLogError(__VA_ARGS__) httpError(__VA_ARGS__)
#define httpLWarn(...) taosLogWarn(__VA_ARGS__) httpWarn(__VA_ARGS__)
#define httpLPrint(...) taosLogPrint(__VA_ARGS__) httpPrint(__VA_ARGS__)
#define monitorError(...) \
if (monitorDebugFlag & DEBUG_ERROR) { \
tprintf("ERROR MON ", 255, __VA_ARGS__); \
}
#define monitorWarn(...) \
if (monitorDebugFlag & DEBUG_WARN) { \
tprintf("WARN MON ", monitorDebugFlag, __VA_ARGS__); \
}
#define monitorTrace(...) \
if (monitorDebugFlag & DEBUG_TRACE) { \
tprintf("MON ", monitorDebugFlag, __VA_ARGS__); \
}
#define monitorPrint(...) \
{ tprintf("MON ", 255, __VA_ARGS__); }
#define monitorLError(...) taosLogError(__VA_ARGS__) monitorError(__VA_ARGS__)
#define monitorLWarn(...) taosLogWarn(__VA_ARGS__) monitorWarn(__VA_ARGS__)
#define monitorLPrint(...) taosLogPrint(__VA_ARGS__) monitorPrint(__VA_ARGS__)
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
src/util/inc/tutil.h
浏览文件 @
d426627e
...
@@ -139,6 +139,7 @@ int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstP
...
@@ -139,6 +139,7 @@ int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstP
void
getTmpfilePath
(
const
char
*
fileNamePattern
,
char
*
dstPath
);
void
getTmpfilePath
(
const
char
*
fileNamePattern
,
char
*
dstPath
);
int32_t
taosInitTimer
(
void
(
*
callback
)(
int
),
int32_t
ms
);
int32_t
taosInitTimer
(
void
(
*
callback
)(
int
),
int32_t
ms
);
void
taosUninitTimer
();
bool
taosMbsToUcs4
(
char
*
mbs
,
int32_t
mbs_len
,
char
*
ucs4
,
int32_t
ucs4_max_len
);
bool
taosMbsToUcs4
(
char
*
mbs
,
int32_t
mbs_len
,
char
*
ucs4
,
int32_t
ucs4_max_len
);
...
...
src/util/src/ttimer.c
浏览文件 @
d426627e
...
@@ -84,8 +84,6 @@ static tmr_ctrl_t* tmrCtrls;
...
@@ -84,8 +84,6 @@ static tmr_ctrl_t* tmrCtrls;
static
tmr_ctrl_t
*
unusedTmrCtrl
=
NULL
;
static
tmr_ctrl_t
*
unusedTmrCtrl
=
NULL
;
static
void
*
tmrQhandle
;
static
void
*
tmrQhandle
;
static
int
numOfTmrCtrl
=
0
;
static
int
numOfTmrCtrl
=
0
;
//static void* tmrContext = NULL;
static
int
athread
=
0
;
int
taosTmrThreads
=
1
;
int
taosTmrThreads
=
1
;
...
@@ -519,7 +517,7 @@ static void taosTmrModuleInit(void) {
...
@@ -519,7 +517,7 @@ static void taosTmrModuleInit(void) {
}
}
tmrQhandle
=
taosInitScheduler
(
10000
,
taosTmrThreads
,
"tmr"
);
tmrQhandle
=
taosInitScheduler
(
10000
,
taosTmrThreads
,
"tmr"
);
athread
=
taosInitTimer
(
taosTimerLoopFunc
,
MSECONDS_PER_TICK
);
taosInitTimer
(
taosTimerLoopFunc
,
MSECONDS_PER_TICK
);
tmrTrace
(
"timer module is initialized, number of threads: %d"
,
taosTmrThreads
);
tmrTrace
(
"timer module is initialized, number of threads: %d"
,
taosTmrThreads
);
}
}
...
@@ -562,7 +560,9 @@ void taosTmrCleanUp(void* handle) {
...
@@ -562,7 +560,9 @@ void taosTmrCleanUp(void* handle) {
pthread_mutex_unlock
(
&
tmrCtrlMutex
);
pthread_mutex_unlock
(
&
tmrCtrlMutex
);
if
(
numOfTmrCtrl
<=
0
)
{
if
(
numOfTmrCtrl
<=
0
)
{
// pthread_cancel(athread);
taosUninitTimer
();
taosCleanUpScheduler
(
tmrQhandle
);
for
(
int
i
=
0
;
i
<
tListLen
(
wheels
);
i
++
)
{
for
(
int
i
=
0
;
i
<
tListLen
(
wheels
);
i
++
)
{
time_wheel_t
*
wheel
=
wheels
+
i
;
time_wheel_t
*
wheel
=
wheels
+
i
;
...
@@ -571,10 +571,18 @@ void taosTmrCleanUp(void* handle) {
...
@@ -571,10 +571,18 @@ void taosTmrCleanUp(void* handle) {
}
}
pthread_mutex_destroy
(
&
tmrCtrlMutex
);
pthread_mutex_destroy
(
&
tmrCtrlMutex
);
for
(
size_t
i
=
0
;
i
<
timerMap
.
size
;
i
++
)
{
timer_list_t
*
list
=
timerMap
.
slots
+
i
;
tmr_obj_t
*
t
=
list
->
timers
;
while
(
t
!=
NULL
)
{
tmr_obj_t
*
next
=
t
->
mnext
;
free
(
t
);
t
=
next
;
}
}
free
(
timerMap
.
slots
);
free
(
timerMap
.
slots
);
free
(
tmrCtrls
);
free
(
tmrCtrls
);
taosCleanUpScheduler
(
tmrQhandle
);
tmrModuleInit
=
PTHREAD_ONCE_INIT
;
tmrTrace
(
"timer module is cleaned up"
);
tmrTrace
(
"timer module is cleaned up"
);
}
}
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
d426627e
...
@@ -42,7 +42,7 @@ static void vnodeNotifyRole(void *ahandle, int8_t role);
...
@@ -42,7 +42,7 @@ static void vnodeNotifyRole(void *ahandle, int8_t role);
static
pthread_once_t
vnodeModuleInit
=
PTHREAD_ONCE_INIT
;
static
pthread_once_t
vnodeModuleInit
=
PTHREAD_ONCE_INIT
;
#ifndef _
VPEER
#ifndef _
SYNC
tsync_h
syncStart
(
const
SSyncInfo
*
info
)
{
return
NULL
;
}
tsync_h
syncStart
(
const
SSyncInfo
*
info
)
{
return
NULL
;
}
int
syncForwardToPeer
(
tsync_h
shandle
,
void
*
pHead
,
void
*
mhandle
)
{
return
0
;
}
int
syncForwardToPeer
(
tsync_h
shandle
,
void
*
pHead
,
void
*
mhandle
)
{
return
0
;
}
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录