From 79aff97033dd88cbae142c768cba820cfbe0204b Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 22 Sep 2021 16:05:46 +0800 Subject: [PATCH] refact --- include/libs/index/index.h | 27 +++++++++++++++++++ include/{dnode => server}/dnode.h | 0 include/{dnode => server}/mnode/mnode.h | 0 include/{dnode => server}/qnode/qnode.h | 0 include/{dnode => server}/vnode/meta/meta.h | 0 include/{dnode => server}/vnode/tq/tq.h | 0 include/{dnode => server}/vnode/tsdb/tsdb.h | 0 include/{dnode => server}/vnode/vnode.h | 0 source/CMakeLists.txt | 5 ++++ source/client/CMakeLists.txt | 2 ++ source/common/CMakeLists.txt | 0 source/libs/CMakeLists.txt | 4 +++ source/libs/asvc/CMakeLists.txt | 7 +++++ source/libs/index/CMakeLists.txt | 7 +++++ source/libs/raft/CMakeLists.txt | 7 +++++ source/libs/tkv/CMakeLists.txt | 7 +++++ source/os/CMakeLists.txt | 7 +++++ source/os/src/os.c | 14 ++++++++++ source/server/CMakeLists.txt | 1 + source/server/mnode/CMakeLists.txt | 7 +++++ source/server/qnode/CMakeLists.txt | 7 +++++ source/server/vnode/CMakeLists.txt | 7 +++++ source/util/CMakeLists.txt | 7 +++++ {src/util/source => source/util/src}/talgo.c | 0 {src/util/source => source/util/src}/tarray.c | 0 {src/util/source => source/util/src}/tlist.c | 0 .../source => source/util/src}/tlockfree.c | 0 27 files changed, 116 insertions(+) create mode 100644 include/libs/index/index.h rename include/{dnode => server}/dnode.h (100%) rename include/{dnode => server}/mnode/mnode.h (100%) rename include/{dnode => server}/qnode/qnode.h (100%) rename include/{dnode => server}/vnode/meta/meta.h (100%) rename include/{dnode => server}/vnode/tq/tq.h (100%) rename include/{dnode => server}/vnode/tsdb/tsdb.h (100%) rename include/{dnode => server}/vnode/vnode.h (100%) create mode 100644 source/CMakeLists.txt create mode 100644 source/client/CMakeLists.txt create mode 100644 source/common/CMakeLists.txt create mode 100644 source/libs/CMakeLists.txt create mode 100644 source/libs/asvc/CMakeLists.txt create mode 100644 source/libs/index/CMakeLists.txt create mode 100644 source/libs/raft/CMakeLists.txt create mode 100644 source/libs/tkv/CMakeLists.txt create mode 100644 source/os/CMakeLists.txt create mode 100644 source/os/src/os.c create mode 100644 source/server/CMakeLists.txt create mode 100644 source/server/mnode/CMakeLists.txt create mode 100644 source/server/qnode/CMakeLists.txt create mode 100644 source/server/vnode/CMakeLists.txt create mode 100644 source/util/CMakeLists.txt rename {src/util/source => source/util/src}/talgo.c (100%) rename {src/util/source => source/util/src}/tarray.c (100%) rename {src/util/source => source/util/src}/tlist.c (100%) rename {src/util/source => source/util/src}/tlockfree.c (100%) diff --git a/include/libs/index/index.h b/include/libs/index/index.h new file mode 100644 index 0000000000..f821b437af --- /dev/null +++ b/include/libs/index/index.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef _TD_INDEX_H_ +#define _TD_INDEX_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_INDEX_H_*/ \ No newline at end of file diff --git a/include/dnode/dnode.h b/include/server/dnode.h similarity index 100% rename from include/dnode/dnode.h rename to include/server/dnode.h diff --git a/include/dnode/mnode/mnode.h b/include/server/mnode/mnode.h similarity index 100% rename from include/dnode/mnode/mnode.h rename to include/server/mnode/mnode.h diff --git a/include/dnode/qnode/qnode.h b/include/server/qnode/qnode.h similarity index 100% rename from include/dnode/qnode/qnode.h rename to include/server/qnode/qnode.h diff --git a/include/dnode/vnode/meta/meta.h b/include/server/vnode/meta/meta.h similarity index 100% rename from include/dnode/vnode/meta/meta.h rename to include/server/vnode/meta/meta.h diff --git a/include/dnode/vnode/tq/tq.h b/include/server/vnode/tq/tq.h similarity index 100% rename from include/dnode/vnode/tq/tq.h rename to include/server/vnode/tq/tq.h diff --git a/include/dnode/vnode/tsdb/tsdb.h b/include/server/vnode/tsdb/tsdb.h similarity index 100% rename from include/dnode/vnode/tsdb/tsdb.h rename to include/server/vnode/tsdb/tsdb.h diff --git a/include/dnode/vnode/vnode.h b/include/server/vnode/vnode.h similarity index 100% rename from include/dnode/vnode/vnode.h rename to include/server/vnode/vnode.h diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt new file mode 100644 index 0000000000..8d850c72a1 --- /dev/null +++ b/source/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(os) +add_subdirectory(util) +add_subdirectory(common) +add_subdirectory(lib) +add_subdirectory(dnode) \ No newline at end of file diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt new file mode 100644 index 0000000000..bb3b1bf78c --- /dev/null +++ b/source/client/CMakeLists.txt @@ -0,0 +1,2 @@ +aux_source_directory(src CLIENT_SRC) +add_library(taos ${CLIENT_SRC}) \ No newline at end of file diff --git a/source/common/CMakeLists.txt b/source/common/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/source/libs/CMakeLists.txt b/source/libs/CMakeLists.txt new file mode 100644 index 0000000000..035e41bd5b --- /dev/null +++ b/source/libs/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory(asvc) +add_subdirectory(raft) +add_subdirectory(tkv) +add_subdirectory(index) \ No newline at end of file diff --git a/source/libs/asvc/CMakeLists.txt b/source/libs/asvc/CMakeLists.txt new file mode 100644 index 0000000000..11c2e0bf59 --- /dev/null +++ b/source/libs/asvc/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src ASVC_SRC) +add_library(asvc ${ASVC_SRC}) +target_include_directories( + asvc + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/asvc" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/libs/index/CMakeLists.txt b/source/libs/index/CMakeLists.txt new file mode 100644 index 0000000000..638d3f64cd --- /dev/null +++ b/source/libs/index/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src INDEX_SRC) +add_library(index ${INDEX_SRC}) +target_include_directories( + index + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/index" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/libs/raft/CMakeLists.txt b/source/libs/raft/CMakeLists.txt new file mode 100644 index 0000000000..127adc106e --- /dev/null +++ b/source/libs/raft/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src RAFT_SRC) +add_library(raft ${RAFT_SRC}) +target_include_directories( + raft + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/raft" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/libs/tkv/CMakeLists.txt b/source/libs/tkv/CMakeLists.txt new file mode 100644 index 0000000000..bec359d75d --- /dev/null +++ b/source/libs/tkv/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src TKV_SRC) +add_library(tkv ${TKV_SRC}) +target_include_directories( + tkv + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/tkv" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/os/CMakeLists.txt b/source/os/CMakeLists.txt new file mode 100644 index 0000000000..9e5d6126ba --- /dev/null +++ b/source/os/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src OS_SRC) +add_library(os ${OS_SRC}) +target_include_directories( + os + PUBLIC "${CMAKE_SOURCE_DIR}/include/os" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" +) \ No newline at end of file diff --git a/source/os/src/os.c b/source/os/src/os.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/os/src/os.c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ \ No newline at end of file diff --git a/source/server/CMakeLists.txt b/source/server/CMakeLists.txt new file mode 100644 index 0000000000..d28d40b188 --- /dev/null +++ b/source/server/CMakeLists.txt @@ -0,0 +1 @@ +add \ No newline at end of file diff --git a/source/server/mnode/CMakeLists.txt b/source/server/mnode/CMakeLists.txt new file mode 100644 index 0000000000..689d6f7f2a --- /dev/null +++ b/source/server/mnode/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src MNODE_SRC) +add_library(mnode ${MNODE_SRC}) +target_include_directories( + mnode + PUBLIC "${CMAKE_SOURCE_DIR}/include/server/mnode" + private "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/server/qnode/CMakeLists.txt b/source/server/qnode/CMakeLists.txt new file mode 100644 index 0000000000..4d4e764d41 --- /dev/null +++ b/source/server/qnode/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src QNODE_SRC) +add_library(qnode ${QNODE_SRC}) +target_include_directories( + qnode + PUBLIC "${CMAKE_SOURCE_DIR}/include/server/qnode" + private "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/server/vnode/CMakeLists.txt b/source/server/vnode/CMakeLists.txt new file mode 100644 index 0000000000..1334bda9c5 --- /dev/null +++ b/source/server/vnode/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src VNODE_SRC) +add_library(vnode ${VNODE_SRC}) +target_include_directories( + vnode + PUBLIC "${CMAKE_SOURCE_DIR}/include/server/vnode" + private "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/util/CMakeLists.txt b/source/util/CMakeLists.txt new file mode 100644 index 0000000000..36b09cc208 --- /dev/null +++ b/source/util/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src UTIL_SRC) +add_library(util ${UTIL_SRC}) +target_include_directories( + util + PUBLIC "${CMAKE_SOURCE_DIR}/include/util" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" +) \ No newline at end of file diff --git a/src/util/source/talgo.c b/source/util/src/talgo.c similarity index 100% rename from src/util/source/talgo.c rename to source/util/src/talgo.c diff --git a/src/util/source/tarray.c b/source/util/src/tarray.c similarity index 100% rename from src/util/source/tarray.c rename to source/util/src/tarray.c diff --git a/src/util/source/tlist.c b/source/util/src/tlist.c similarity index 100% rename from src/util/source/tlist.c rename to source/util/src/tlist.c diff --git a/src/util/source/tlockfree.c b/source/util/src/tlockfree.c similarity index 100% rename from src/util/source/tlockfree.c rename to source/util/src/tlockfree.c