Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
~笨蛋陪你哭
TDengine
提交
7625e803
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,发现更多精彩内容 >>
提交
7625e803
编写于
1月 25, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2837
上级
80dfa0a4
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
66 addition
and
186 deletion
+66
-186
CMakeLists.txt
CMakeLists.txt
+1
-1
src/balance/CMakeLists.txt
src/balance/CMakeLists.txt
+1
-7
src/cq/CMakeLists.txt
src/cq/CMakeLists.txt
+6
-18
src/dnode/CMakeLists.txt
src/dnode/CMakeLists.txt
+28
-69
src/mnode/CMakeLists.txt
src/mnode/CMakeLists.txt
+5
-18
src/os/inc/osDarwin.h
src/os/inc/osDarwin.h
+5
-4
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+8
-11
src/plugins/monitor/CMakeLists.txt
src/plugins/monitor/CMakeLists.txt
+5
-17
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+2
-12
src/sync/src/syncTcp.c
src/sync/src/syncTcp.c
+0
-8
src/vnode/CMakeLists.txt
src/vnode/CMakeLists.txt
+2
-10
src/wal/CMakeLists.txt
src/wal/CMakeLists.txt
+3
-11
未找到文件。
CMakeLists.txt
浏览文件 @
7625e803
...
...
@@ -30,7 +30,7 @@ MESSAGE(STATUS "Community directory: " ${TD_COMMUNITY_DIR})
INCLUDE
(
cmake/input.inc
)
INCLUDE
(
cmake/platform.inc
)
IF
(
TD_WINDOWS
)
IF
(
TD_WINDOWS
OR TD_DARWIN
)
SET
(
TD_SOMODE_STATIC TRUE
)
ENDIF
()
...
...
src/balance/CMakeLists.txt
浏览文件 @
7625e803
...
...
@@ -8,10 +8,4 @@ INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
IF
(
TD_LINUX OR TD_WINDOWS
)
ADD_LIBRARY
(
balance
${
SRC
}
)
ENDIF
()
IF
(
TD_DARWIN
)
ADD_LIBRARY
(
balance
${
SRC
}
)
ENDIF
()
ADD_LIBRARY
(
balance
${
SRC
}
)
src/cq/CMakeLists.txt
浏览文件 @
7625e803
...
...
@@ -6,22 +6,10 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SRC
)
IF
(
TD_LINUX OR TD_WINDOWS
)
ADD_LIBRARY
(
tcq
${
SRC
}
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
tcq tutil common taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
tcq tutil common taos
)
ENDIF
()
ADD_SUBDIRECTORY
(
test
)
ENDIF
()
IF
(
TD_DARWIN
)
ADD_LIBRARY
(
tcq
${
SRC
}
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
tcq tutil common taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
tcq tutil common taos
)
ENDIF
()
ADD_SUBDIRECTORY
(
test
)
ADD_LIBRARY
(
tcq
${
SRC
}
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
tcq tutil common taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
tcq tutil common taos
)
ENDIF
()
ADD_SUBDIRECTORY
(
test
)
src/dnode/CMakeLists.txt
浏览文件 @
7625e803
...
...
@@ -10,79 +10,38 @@ INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
IF
(
TD_LINUX OR TD_WINDOWS
)
ADD_EXECUTABLE
(
taosd
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lz4 balance sync
)
ADD_EXECUTABLE
(
taosd
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lz4 balance sync
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosd taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
taosd taos
)
ENDIF
()
IF
(
TD_ACCOUNT
)
TARGET_LINK_LIBRARIES
(
taosd account
)
ENDIF
()
IF
(
TD_GRANT
)
TARGET_LINK_LIBRARIES
(
taosd grant
)
ENDIF
()
IF
(
TD_LINUX AND TD_MQTT
)
TARGET_LINK_LIBRARIES
(
taosd mqtt
)
ENDIF
()
SET
(
PREPARE_ENV_CMD
"prepare_env_cmd"
)
SET
(
PREPARE_ENV_TARGET
"prepare_env_target"
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
PREPARE_ENV_CMD
}
POST_BUILD
COMMAND echo
"make test directory"
DEPENDS taosd
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/log/
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/data/
COMMAND
${
CMAKE_COMMAND
}
-E echo dataDir
${
TD_TESTS_OUTPUT_DIR
}
/data >
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo logDir
${
TD_TESTS_OUTPUT_DIR
}
/log >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo charset UTF-8 >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMENT
"prepare taosd environment"
)
ADD_CUSTOM_TARGET
(
${
PREPARE_ENV_TARGET
}
ALL WORKING_DIRECTORY
${
TD_EXECUTABLE_OUTPUT_PATH
}
DEPENDS
${
PREPARE_ENV_CMD
}
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosd taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
taosd taos
)
ENDIF
()
IF
(
TD_DARWIN
)
ADD_EXECUTABLE
(
taosd
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lz4 balance sync
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosd taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
taosd taos
)
ENDIF
()
IF
(
TD_ACCOUNT
)
TARGET_LINK_LIBRARIES
(
taosd account
)
ENDIF
()
IF
(
TD_GRANT
)
TARGET_LINK_LIBRARIES
(
taosd grant
)
ENDIF
()
IF
(
TD_ACCOUNT
)
TARGET_LINK_LIBRARIES
(
taosd account
)
ENDIF
()
IF
(
TD_MQT
T
)
TARGET_LINK_LIBRARIES
(
taosd mqt
t
)
ENDIF
()
IF
(
TD_GRAN
T
)
TARGET_LINK_LIBRARIES
(
taosd gran
t
)
ENDIF
()
# SET(PREPARE_ENV_CMD "prepare_env_cmd")
# SET(PREPARE_ENV_TARGET "prepare_env_target")
# ADD_CUSTOM_COMMAND(OUTPUT ${PREPARE_ENV_CMD}
# POST_BUILD
# COMMAND echo "make test directory"
# DEPENDS taosd
# COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/cfg/
# COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/log/
# COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/data/
# COMMAND ${CMAKE_COMMAND} -E echo dataDir ${TD_TESTS_OUTPUT_DIR}/data > ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
# COMMAND ${CMAKE_COMMAND} -E echo logDir ${TD_TESTS_OUTPUT_DIR}/log >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
# COMMAND ${CMAKE_COMMAND} -E echo charset UTF-8 >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
# COMMENT "prepare taosd environment")
# ADD_CUSTOM_TARGET(${PREPARE_ENV_TARGET} ALL WORKING_DIRECTORY ${TD_EXECUTABLE_OUTPUT_PATH} DEPENDS ${PREPARE_ENV_CMD})
IF
((
TD_LINUX OR TD_WINDOWS
)
AND TD_MQTT
)
TARGET_LINK_LIBRARIES
(
taosd mqtt
)
ENDIF
()
SET
(
PREPARE_ENV_CMD
"prepare_env_cmd"
)
SET
(
PREPARE_ENV_TARGET
"prepare_env_target"
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
PREPARE_ENV_CMD
}
POST_BUILD
COMMAND echo
"make test directory"
DEPENDS taosd
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/log/
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/data/
COMMAND
${
CMAKE_COMMAND
}
-E echo dataDir
${
TD_TESTS_OUTPUT_DIR
}
/data >
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo logDir
${
TD_TESTS_OUTPUT_DIR
}
/log >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo charset UTF-8 >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/taos.cfg
COMMENT
"prepare taosd environment"
)
ADD_CUSTOM_TARGET
(
${
PREPARE_ENV_TARGET
}
ALL WORKING_DIRECTORY
${
TD_EXECUTABLE_OUTPUT_PATH
}
DEPENDS
${
PREPARE_ENV_CMD
}
)
src/mnode/CMakeLists.txt
浏览文件 @
7625e803
CMAKE_MINIMUM_REQUIRED
(
VERSION 3.5
)
PROJECT
(
TDengine
)
IF
(
TD_LINUX OR TD_WINDOWS
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/dnode/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/dnode/inc
)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
ADD_LIBRARY
(
mnode
${
SRC
}
)
ENDIF
()
IF
(
TD_DARWIN
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/dnode/inc
)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
ADD_LIBRARY
(
mnode
${
SRC
}
)
ENDIF
()
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
ADD_LIBRARY
(
mnode
${
SRC
}
)
src/os/inc/osDarwin.h
浏览文件 @
7625e803
...
...
@@ -106,10 +106,11 @@ int64_t tsosStr2int64(char *str);
void
taos_block_sigalrm
(
void
);
#define TAOS_OS_DEF_EPOLL
#define TAOS_EPOLL_WAIT_TIME 500
typedef
int32_t
SOCKET
;
typedef
SOCKET
EpollFd
;
#define EpollClose(pollFd) epoll_close(pollFd)
#ifdef __cplusplus
}
...
...
src/plugins/http/src/httpServer.c
浏览文件 @
7625e803
...
...
@@ -48,7 +48,7 @@ static void httpStopThread(HttpThread *pThread) {
pThread
->
stop
=
true
;
r
=
epoll_ctl
(
pThread
->
pollFd
,
EPOLL_CTL_ADD
,
sv
[
0
],
&
ev
);
if
(
r
)
break
;
if
(
1
!=
send
(
sv
[
1
],
"1"
,
1
,
0
))
{
if
(
1
!=
send
(
sv
[
1
],
"1"
,
1
,
0
))
{
r
=
-
1
;
break
;
}
...
...
@@ -56,7 +56,7 @@ static void httpStopThread(HttpThread *pThread) {
if
(
r
)
{
pthread_cancel
(
pThread
->
thread
);
}
#else
#else
struct
epoll_event
event
=
{.
events
=
EPOLLIN
};
eventfd_t
fd
=
eventfd
(
1
,
0
);
if
(
fd
==
-
1
)
{
...
...
@@ -69,29 +69,26 @@ static void httpStopThread(HttpThread *pThread) {
pThread
->
label
,
strerror
(
errno
));
pthread_cancel
(
pThread
->
thread
);
}
#endif // __APPLE__
#endif
// __APPLE__
pthread_join
(
pThread
->
thread
,
NULL
);
#ifdef __APPLE__
if
(
sv
[
0
]
!=
-
1
)
{
if
(
sv
[
0
]
!=
-
1
)
{
close
(
sv
[
0
]);
sv
[
0
]
=
-
1
;
}
if
(
sv
[
1
]
!=
-
1
)
{
if
(
sv
[
1
]
!=
-
1
)
{
close
(
sv
[
1
]);
sv
[
1
]
=
-
1
;
}
#else // __APPLE__
#else
// __APPLE__
if
(
fd
!=
-
1
)
{
taosCloseSocket
(
fd
);
}
#endif // __APPLE__
#endif
// __APPLE__
#ifdef __APPLE__
epoll_close
(
pThread
->
pollFd
);
#else
EpollClose
(
pThread
->
pollFd
);
#endif
pthread_mutex_destroy
(
&
(
pThread
->
threadMutex
));
}
...
...
src/plugins/monitor/CMakeLists.txt
浏览文件 @
7625e803
...
...
@@ -6,22 +6,10 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
AUX_SOURCE_DIRECTORY
(
./src SRC
)
IF
(
TD_LINUX OR TD_WINDOWS
)
ADD_LIBRARY
(
monitor
${
SRC
}
)
ADD_LIBRARY
(
monitor
${
SRC
}
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
monitor taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
monitor taos
)
ENDIF
()
ENDIF
()
IF
(
TD_DARWIN
)
ADD_LIBRARY
(
monitor
${
SRC
}
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
monitor taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
monitor taos
)
ENDIF
()
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
monitor taos_static
)
ELSE
()
TARGET_LINK_LIBRARIES
(
monitor taos
)
ENDIF
()
src/rpc/src/rpcTcp.c
浏览文件 @
7625e803
...
...
@@ -314,14 +314,8 @@ void *taosInitTcpClient(uint32_t ip, uint16_t port, char *label, int num, void *
int
code
=
pthread_create
(
&
(
pThreadObj
->
thread
),
&
thattr
,
taosProcessTcpData
,
(
void
*
)(
pThreadObj
));
pthread_attr_destroy
(
&
thattr
);
if
(
code
!=
0
)
{
#ifdef __APPLE__
if
(
pThreadObj
->
pollFd
!=-
1
)
{
epoll_close
(
pThreadObj
->
pollFd
);
pThreadObj
->
pollFd
=
-
1
;
}
#else // __APPLE__
EpollClose
(
pThreadObj
->
pollFd
);
#endif // __APPLE__
pThreadObj
->
pollFd
=
-
1
;
free
(
pThreadObj
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
tError
(
"%s failed to create TCP read data thread(%s)"
,
label
,
strerror
(
errno
));
...
...
@@ -529,14 +523,10 @@ static void *taosProcessTcpData(void *param) {
if
(
pThreadObj
->
stop
)
break
;
}
#ifdef __APPLE__
if
(
pThreadObj
->
pollFd
>=
0
)
{
epoll_c
lose
(
pThreadObj
->
pollFd
);
EpollC
lose
(
pThreadObj
->
pollFd
);
pThreadObj
->
pollFd
=
-
1
;
}
#else // __APPLE__
if
(
pThreadObj
->
pollFd
>=
0
)
EpollClose
(
pThreadObj
->
pollFd
);
#endif
while
(
pThreadObj
->
pHead
)
{
SFdObj
*
pFdObj
=
pThreadObj
->
pHead
;
...
...
src/sync/src/syncTcp.c
浏览文件 @
7625e803
...
...
@@ -241,11 +241,7 @@ static void *syncProcessTcpData(void *param) {
sDebug
(
"%p TCP epoll thread exits"
,
pThread
);
#ifdef __APPLE__
epoll_close
(
pThread
->
pollFd
);
#else // __APPLE__
EpollClose
(
pThread
->
pollFd
);
#endif // __APPLE__
tfree
(
pThread
);
tfree
(
buffer
);
return
NULL
;
...
...
@@ -307,11 +303,7 @@ static SThreadObj *syncGetTcpThread(SPoolObj *pPool) {
pthread_attr_destroy
(
&
thattr
);
if
(
ret
!=
0
)
{
#ifdef __APPLE__
epoll_close
(
pThread
->
pollFd
);
#else // __APPLE__
EpollClose
(
pThread
->
pollFd
);
#endif
tfree
(
pThread
);
return
NULL
;
}
...
...
src/vnode/CMakeLists.txt
浏览文件 @
7625e803
...
...
@@ -10,13 +10,5 @@ INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
IF
(
TD_LINUX OR TD_WINDOWS
)
ADD_LIBRARY
(
vnode
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
vnode tsdb tcq
)
ENDIF
()
IF
(
TD_DARWIN
)
ADD_LIBRARY
(
vnode
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
vnode tsdb tcq
)
ENDIF
()
ADD_LIBRARY
(
vnode
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
vnode tsdb tcq
)
src/wal/CMakeLists.txt
浏览文件 @
7625e803
...
...
@@ -4,14 +4,6 @@ PROJECT(TDengine)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SRC
)
IF
(
TD_LINUX OR TD_WINDOWS
)
ADD_LIBRARY
(
twal
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
twal tutil common
)
ADD_SUBDIRECTORY
(
test
)
ENDIF
()
IF
(
TD_DARWIN
)
ADD_LIBRARY
(
twal
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
twal tutil common
)
ADD_SUBDIRECTORY
(
test
)
ENDIF
()
ADD_LIBRARY
(
twal
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
twal tutil common
)
ADD_SUBDIRECTORY
(
test
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录