diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index bc5bd8c03763dd25f202662e4fa85fa7877a99ff..5cdf84658b3817530fa492249bd31c6edab23d94 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -5,3 +5,5 @@ ADD_SUBDIRECTORY(zlib-1.2.11) ADD_SUBDIRECTORY(pthread) ADD_SUBDIRECTORY(regex) ADD_SUBDIRECTORY(iconv) +ADD_SUBDIRECTORY(lz4) +ADD_SUBDIRECTORY(cJson) diff --git a/deps/cJson/CMakeLists.txt b/deps/cJson/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..43b31589b30f9bddbdaac8ff2344545c289bc609 --- /dev/null +++ b/deps/cJson/CMakeLists.txt @@ -0,0 +1,4 @@ +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCE_LIST) + +add_library(cJson ${SOURCE_LIST}) +target_include_directories(cJson PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc) \ No newline at end of file diff --git a/src/util/inc/cJSON.h b/deps/cJson/inc/cJSON.h similarity index 100% rename from src/util/inc/cJSON.h rename to deps/cJson/inc/cJSON.h diff --git a/src/util/src/cJSON.c b/deps/cJson/src/cJSON.c similarity index 100% rename from src/util/src/cJSON.c rename to deps/cJson/src/cJSON.c diff --git a/deps/lz4/CMakeLists.txt b/deps/lz4/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..a142d8d468c1674509de0df8d5625d7b8938869d --- /dev/null +++ b/deps/lz4/CMakeLists.txt @@ -0,0 +1,4 @@ +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCE_LIST) + +add_library(lz4 ${SOURCE_LIST}) +target_include_directories(lz4 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc) \ No newline at end of file diff --git a/src/thirdparty/inc/lz4.h b/deps/lz4/inc/lz4.h similarity index 100% rename from src/thirdparty/inc/lz4.h rename to deps/lz4/inc/lz4.h diff --git a/src/thirdparty/src/lz4.c b/deps/lz4/src/lz4.c similarity index 100% rename from src/thirdparty/src/lz4.c rename to deps/lz4/src/lz4.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 326f00dbbd5c4565c03b3c8b253d511d42b7668c..1a8f7d88070033f14eb41d3a727c157c698c9520 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,8 +3,6 @@ PROJECT(TDengine) # Base compile ADD_SUBDIRECTORY(os) -ADD_SUBDIRECTORY(thirdparty) - ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(util) ADD_SUBDIRECTORY(rpc) @@ -14,5 +12,7 @@ ADD_SUBDIRECTORY(kit) ADD_SUBDIRECTORY(plugins) ADD_SUBDIRECTORY(mnode) ADD_SUBDIRECTORY(vnode) +ADD_SUBDIRECTORY(tsdb) +ADD_SUBDIRECTORY(wal) ADD_SUBDIRECTORY(dnode) #ADD_SUBDIRECTORY(connector/jdbc) diff --git a/src/dnode/CMakeLists.txt b/src/dnode/CMakeLists.txt index ee05403a613d9b7bc1bb35758fbf9e9746f593a4..899977061832bf1ba4c76ba2d802d3e1c619c1fd 100644 --- a/src/dnode/CMakeLists.txt +++ b/src/dnode/CMakeLists.txt @@ -7,14 +7,16 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/vnode/tsdb/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/tsdb/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lz4/inc) INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc) INCLUDE_DIRECTORIES(inc) AUX_SOURCE_DIRECTORY(src SRC) ADD_EXECUTABLE(taosd ${SRC}) - TARGET_LINK_LIBRARIES(taosd mnode taos_static monitor http tsdb twal vnode) + TARGET_LINK_LIBRARIES(taosd mnode taos_static monitor http tsdb twal vnode cJson lz4) IF (TD_ACCOUNT) TARGET_LINK_LIBRARIES(taosd account) @@ -31,7 +33,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) TARGET_LINK_LIBRARIES(taosd balance sync) ENDIF () - IF (TD_MPEER) + IF (TD_MPEER) TARGET_LINK_LIBRARIES(taosd mpeer sync) ENDIF () diff --git a/src/plugins/http/CMakeLists.txt b/src/plugins/http/CMakeLists.txt index 57ca4ca9f0b0d5e0210178f62e3ca82ba5e48e61..9b36f4029a7d5993435b5a0e45cde1d31d19b184 100644 --- a/src/plugins/http/CMakeLists.txt +++ b/src/plugins/http/CMakeLists.txt @@ -7,6 +7,8 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/zlib-1.2.11/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lz4/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(inc) AUX_SOURCE_DIRECTORY(src SRC) diff --git a/src/query/CMakeLists.txt b/src/query/CMakeLists.txt index 1bbd06780482eb691f06297aed7e4c6ac6863f9a..01be5e643bdfffc92e0dc94e36beaea5d67cf8c4 100644 --- a/src/query/CMakeLists.txt +++ b/src/query/CMakeLists.txt @@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc) -INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/vnode/tsdb/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/tsdb/inc) INCLUDE_DIRECTORIES(inc) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index e8768c10dd074915e940599f609e5fb0491e4365..229b1077f83093223a3b1ffbfdf55c7e4f106ff4 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -4,6 +4,8 @@ PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lz4/inc) INCLUDE_DIRECTORIES(inc) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) @@ -22,7 +24,7 @@ ELSEIF (TD_WINDOWS_64) ENDIF () ADD_LIBRARY(trpc ${SRC}) -TARGET_LINK_LIBRARIES(trpc tutil) +TARGET_LINK_LIBRARIES(trpc tutil lz4) ADD_SUBDIRECTORY(test) diff --git a/src/thirdparty/CMakeLists.txt b/src/thirdparty/CMakeLists.txt deleted file mode 100644 index 9958e1e28c0a963a18021a0e449e389583bc5698..0000000000000000000000000000000000000000 --- a/src/thirdparty/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCE_LIST) - -add_library(thirdparty ${SOURCE_LIST}) -target_include_directories(thirdparty PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc) \ No newline at end of file diff --git a/src/vnode/tsdb/CMakeLists.txt b/src/tsdb/CMakeLists.txt similarity index 100% rename from src/vnode/tsdb/CMakeLists.txt rename to src/tsdb/CMakeLists.txt diff --git a/src/vnode/tsdb/inc/tsdb.h b/src/tsdb/inc/tsdb.h similarity index 100% rename from src/vnode/tsdb/inc/tsdb.h rename to src/tsdb/inc/tsdb.h diff --git a/src/vnode/tsdb/inc/tsdbMain.h b/src/tsdb/inc/tsdbMain.h similarity index 100% rename from src/vnode/tsdb/inc/tsdbMain.h rename to src/tsdb/inc/tsdbMain.h diff --git a/src/vnode/tsdb/src/tsdbCache.c b/src/tsdb/src/tsdbCache.c similarity index 100% rename from src/vnode/tsdb/src/tsdbCache.c rename to src/tsdb/src/tsdbCache.c diff --git a/src/vnode/tsdb/src/tsdbCompactor.c b/src/tsdb/src/tsdbCompactor.c similarity index 100% rename from src/vnode/tsdb/src/tsdbCompactor.c rename to src/tsdb/src/tsdbCompactor.c diff --git a/src/vnode/tsdb/src/tsdbFile.c b/src/tsdb/src/tsdbFile.c similarity index 100% rename from src/vnode/tsdb/src/tsdbFile.c rename to src/tsdb/src/tsdbFile.c diff --git a/src/vnode/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c similarity index 100% rename from src/vnode/tsdb/src/tsdbMain.c rename to src/tsdb/src/tsdbMain.c diff --git a/src/vnode/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c similarity index 100% rename from src/vnode/tsdb/src/tsdbMeta.c rename to src/tsdb/src/tsdbMeta.c diff --git a/src/vnode/tsdb/src/tsdbMetaFile.c b/src/tsdb/src/tsdbMetaFile.c similarity index 100% rename from src/vnode/tsdb/src/tsdbMetaFile.c rename to src/tsdb/src/tsdbMetaFile.c diff --git a/src/vnode/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c similarity index 100% rename from src/vnode/tsdb/src/tsdbRead.c rename to src/tsdb/src/tsdbRead.c diff --git a/src/vnode/tsdb/tests/CMakeLists.txt b/src/tsdb/tests/CMakeLists.txt similarity index 100% rename from src/vnode/tsdb/tests/CMakeLists.txt rename to src/tsdb/tests/CMakeLists.txt diff --git a/src/vnode/tsdb/tests/tsdbTests.cpp b/src/tsdb/tests/tsdbTests.cpp similarity index 100% rename from src/vnode/tsdb/tests/tsdbTests.cpp rename to src/tsdb/tests/tsdbTests.cpp diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 6c8f94ec392d3c6b3afe201d661f9e6e99fe9078..a814bf52ab65aaf85f7c3042e6622ad9b4a3337f 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -6,9 +6,11 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lz4/inc) AUX_SOURCE_DIRECTORY(src SRC) ADD_LIBRARY(tutil ${SRC}) - TARGET_LINK_LIBRARIES(tutil thirdparty pthread os m rt) + TARGET_LINK_LIBRARIES(tutil pthread os m rt) FIND_PATH(ICONV_INCLUDE_EXIST iconv.h /usr/include/ /usr/local/include/) IF (ICONV_INCLUDE_EXIST) ADD_DEFINITIONS(-DUSE_LIBICONV) @@ -65,7 +67,7 @@ ELSEIF (TD_WINDOWS_64) LIST(APPEND SRC ./src/tutil.c) LIST(APPEND SRC ./src/version.c) ADD_LIBRARY(tutil ${SRC}) - TARGET_LINK_LIBRARIES(tutil thirdparty iconv regex pthread os winmm IPHLPAPI ws2_32) + TARGET_LINK_LIBRARIES(tutil iconv regex pthread os winmm IPHLPAPI ws2_32) ELSEIF(TD_DARWIN_64) ADD_DEFINITIONS(-DUSE_LIBICONV) LIST(APPEND SRC ./src/hash.c) @@ -102,7 +104,7 @@ ELSEIF(TD_DARWIN_64) LIST(APPEND SRC ./src/version.c) LIST(APPEND SRC ./src/hash.c) ADD_LIBRARY(tutil ${SRC}) - TARGET_LINK_LIBRARIES(tutil thirdparty iconv pthread os) + TARGET_LINK_LIBRARIES(tutil iconv pthread os) ENDIF() #IF (TD_CLUSTER) diff --git a/src/vnode/CMakeLists.txt b/src/vnode/CMakeLists.txt index 3df980ece1654fda563dacae11b291788a4248bb..51065b8645fbc32403850d31cb4d92332b047892 100644 --- a/src/vnode/CMakeLists.txt +++ b/src/vnode/CMakeLists.txt @@ -1,6 +1,18 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -ADD_SUBDIRECTORY(wal) -ADD_SUBDIRECTORY(tsdb) -ADD_SUBDIRECTORY(main) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) + INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/tsdb/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/dnode/inc) + INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc) + INCLUDE_DIRECTORIES(inc) + AUX_SOURCE_DIRECTORY(src SRC) + + ADD_LIBRARY(vnode ${SRC}) + TARGET_LINK_LIBRARIES(vnode tsdb) +ENDIF () \ No newline at end of file diff --git a/src/vnode/cache/inc/cache.h b/src/vnode/cache/inc/cache.h deleted file mode 100644 index 52f357ee8f133d5110c91df99d0f52328eed2093..0000000000000000000000000000000000000000 --- a/src/vnode/cache/inc/cache.h +++ /dev/null @@ -1,17 +0,0 @@ -#if !defined(_TD_CACHE_H_) -#define _TD_CACHE_H_ - -#define TD_MIN_CACHE_BLOCK_SIZE 1024*1024 /* 1M */ -#define TD_MAX_CACHE_BLOCK_SIZE 64*1024*1024 /* 64M */ - -typedef void cache_pool_t; - -typedef struct SCacheBlock -{ - int32_t blockId; - char data[]; -} SCacheBlock; - - - -#endif // _TD_CACHE_H_ diff --git a/src/vnode/main/inc/vnodeInt.h b/src/vnode/inc/vnodeInt.h similarity index 100% rename from src/vnode/main/inc/vnodeInt.h rename to src/vnode/inc/vnodeInt.h diff --git a/src/vnode/main/CMakeLists.txt b/src/vnode/main/CMakeLists.txt deleted file mode 100644 index 19b1b4c22ad9901a94bfec35e26096eed534c38e..0000000000000000000000000000000000000000 --- a/src/vnode/main/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -PROJECT(TDengine) - -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) - INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/vnode/tsdb/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/dnode/inc) - INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc) - INCLUDE_DIRECTORIES(inc) - AUX_SOURCE_DIRECTORY(src SRC) - - ADD_LIBRARY(vnode ${SRC}) - TARGET_LINK_LIBRARIES(vnode tsdb) -ENDIF () \ No newline at end of file diff --git a/src/vnode/main/src/vnodeMain.c b/src/vnode/src/vnodeMain.c similarity index 100% rename from src/vnode/main/src/vnodeMain.c rename to src/vnode/src/vnodeMain.c diff --git a/src/vnode/main/src/vnodeRead.c b/src/vnode/src/vnodeRead.c similarity index 100% rename from src/vnode/main/src/vnodeRead.c rename to src/vnode/src/vnodeRead.c diff --git a/src/vnode/main/src/vnodeWrite.c b/src/vnode/src/vnodeWrite.c similarity index 100% rename from src/vnode/main/src/vnodeWrite.c rename to src/vnode/src/vnodeWrite.c diff --git a/src/vnode/wal/CMakeLists.txt b/src/wal/CMakeLists.txt similarity index 100% rename from src/vnode/wal/CMakeLists.txt rename to src/wal/CMakeLists.txt diff --git a/src/vnode/wal/src/walMain.c b/src/wal/src/walMain.c similarity index 100% rename from src/vnode/wal/src/walMain.c rename to src/wal/src/walMain.c diff --git a/src/vnode/wal/test/CMakeLists.txt b/src/wal/test/CMakeLists.txt similarity index 100% rename from src/vnode/wal/test/CMakeLists.txt rename to src/wal/test/CMakeLists.txt diff --git a/src/vnode/wal/test/waltest.c b/src/wal/test/waltest.c similarity index 100% rename from src/vnode/wal/test/waltest.c rename to src/wal/test/waltest.c diff --git a/tests/tsim/CMakeLists.txt b/tests/tsim/CMakeLists.txt index 2fec751cec4019b82d10760f13989e82894d262a..2eaf3fe7cfe35e7900d10cf820702f379c3a5137 100644 --- a/tests/tsim/CMakeLists.txt +++ b/tests/tsim/CMakeLists.txt @@ -3,6 +3,7 @@ PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(inc) @@ -12,4 +13,4 @@ ENDIF () AUX_SOURCE_DIRECTORY(src SRC) ADD_EXECUTABLE(tsim ${SRC}) -TARGET_LINK_LIBRARIES(tsim taos_static trpc tutil pthread ) +TARGET_LINK_LIBRARIES(tsim taos_static trpc tutil pthread cJson)