From 3908cbd341e0ccb69c0100538957bc44c45cca76 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 24 Sep 2021 18:05:56 +0800 Subject: [PATCH] add more module --- include/libs/catalog/catalog.h | 27 +++++++++++++++++++++ include/libs/executor/executor.h | 27 +++++++++++++++++++++ include/libs/planner/planner.h | 27 +++++++++++++++++++++ include/server/vnode/memtable/memTable.h | 0 include/server/vnode/tsdb/tsdb.h | 14 +++++++++++ source/libs/CMakeLists.txt | 5 +++- source/libs/catalog/CMakeLists.txt | 7 ++++++ source/libs/catalog/inc/catalogInt.h | 27 +++++++++++++++++++++ source/libs/catalog/src/catalog.c | 14 +++++++++++ source/libs/catalog/test/catalogTests.cpp | 0 source/libs/executor/CMakeLists.txt | 7 ++++++ source/libs/executor/inc/executorInt.h | 27 +++++++++++++++++++++ source/libs/executor/src/executor.c | 14 +++++++++++ source/libs/executor/test/executorTests.cpp | 0 source/libs/planner/CMakeLists.txt | 7 ++++++ source/libs/planner/inc/plannerInt.h | 27 +++++++++++++++++++++ source/libs/planner/src/planner.c | 14 +++++++++++ source/libs/planner/test/plannerTests.cpp | 0 18 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 include/libs/catalog/catalog.h create mode 100644 include/libs/executor/executor.h create mode 100644 include/libs/planner/planner.h create mode 100644 include/server/vnode/memtable/memTable.h create mode 100644 source/libs/catalog/CMakeLists.txt create mode 100644 source/libs/catalog/inc/catalogInt.h create mode 100644 source/libs/catalog/src/catalog.c create mode 100644 source/libs/catalog/test/catalogTests.cpp create mode 100644 source/libs/executor/CMakeLists.txt create mode 100644 source/libs/executor/inc/executorInt.h create mode 100644 source/libs/executor/src/executor.c create mode 100644 source/libs/executor/test/executorTests.cpp create mode 100644 source/libs/planner/CMakeLists.txt create mode 100644 source/libs/planner/inc/plannerInt.h create mode 100644 source/libs/planner/src/planner.c create mode 100644 source/libs/planner/test/plannerTests.cpp diff --git a/include/libs/catalog/catalog.h b/include/libs/catalog/catalog.h new file mode 100644 index 0000000000..de37807cf6 --- /dev/null +++ b/include/libs/catalog/catalog.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_CATALOG_H_ +#define _TD_CATALOG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_CATALOG_H_*/ \ No newline at end of file diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h new file mode 100644 index 0000000000..15416724c6 --- /dev/null +++ b/include/libs/executor/executor.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_EXECUTOR_H_ +#define _TD_EXECUTOR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_EXECUTOR_H_*/ \ No newline at end of file diff --git a/include/libs/planner/planner.h b/include/libs/planner/planner.h new file mode 100644 index 0000000000..6de7a59653 --- /dev/null +++ b/include/libs/planner/planner.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_PLANNER_H_ +#define _TD_PLANNER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_PLANNER_H_*/ \ No newline at end of file diff --git a/include/server/vnode/memtable/memTable.h b/include/server/vnode/memtable/memTable.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/include/server/vnode/tsdb/tsdb.h b/include/server/vnode/tsdb/tsdb.h index 1baf5ef2ee..8bca3590c0 100644 --- a/include/server/vnode/tsdb/tsdb.h +++ b/include/server/vnode/tsdb/tsdb.h @@ -16,10 +16,24 @@ #ifndef _TD_TSDB_H_ #define _TD_TSDB_H_ +#include "os.h" + #ifdef __cplusplus extern "C" { #endif +typedef struct STsdb STsdb; +typedef struct { +} STsdbCfg; + +int tsdbInit(int nthreads); +int tsdbClear(); +int tsdbCreateRepo(int id); +int tsdbDropRepo(int id); +STsdb *tsdbOpenRepo(STsdbCfg *pCfg); +int tsdbCloseRepo(STsdb *pTsdb); +int tsdbForceCloseRepo(STsdb *pTsdb); + #ifdef __cplusplus } #endif diff --git a/source/libs/CMakeLists.txt b/source/libs/CMakeLists.txt index c1bec69cd2..a7ec318eaa 100644 --- a/source/libs/CMakeLists.txt +++ b/source/libs/CMakeLists.txt @@ -5,4 +5,7 @@ add_subdirectory(index) add_subdirectory(wal) add_subdirectory(parser) add_subdirectory(scheduler) -add_subdirectory(lru) \ No newline at end of file +add_subdirectory(lru) +add_subdirectory(catalog) +add_subdirectory(executor) +add_subdirectory(planner) \ No newline at end of file diff --git a/source/libs/catalog/CMakeLists.txt b/source/libs/catalog/CMakeLists.txt new file mode 100644 index 0000000000..ae331bf392 --- /dev/null +++ b/source/libs/catalog/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src CATALOG_SRC) +add_library(catalog ${CATALOG_SRC}) +target_include_directories( + catalog + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/catalog" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/libs/catalog/inc/catalogInt.h b/source/libs/catalog/inc/catalogInt.h new file mode 100644 index 0000000000..f6f8a61faf --- /dev/null +++ b/source/libs/catalog/inc/catalogInt.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_CATALOG_INT_H_ +#define _TD_CATALOG_INT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_CATALOG_INT_H_*/ \ No newline at end of file diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/libs/catalog/src/catalog.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/libs/catalog/test/catalogTests.cpp b/source/libs/catalog/test/catalogTests.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/source/libs/executor/CMakeLists.txt b/source/libs/executor/CMakeLists.txt new file mode 100644 index 0000000000..ae0cc6b1a8 --- /dev/null +++ b/source/libs/executor/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src EXECUTOR_SRC) +add_library(executor ${EXECUTOR_SRC}) +target_include_directories( + executor + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/executor" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/libs/executor/inc/executorInt.h b/source/libs/executor/inc/executorInt.h new file mode 100644 index 0000000000..ef66b3f247 --- /dev/null +++ b/source/libs/executor/inc/executorInt.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_EXECUTOR_INT_H +#define _TD_EXECUTOR_INT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_EXECUTOR_INT_H*/ \ No newline at end of file diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/libs/executor/src/executor.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/libs/executor/test/executorTests.cpp b/source/libs/executor/test/executorTests.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/source/libs/planner/CMakeLists.txt b/source/libs/planner/CMakeLists.txt new file mode 100644 index 0000000000..8b3eb96c14 --- /dev/null +++ b/source/libs/planner/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src PLANNER_SRC) +add_library(planner ${PLANNER_SRC}) +target_include_directories( + planner + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/planner" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/libs/planner/inc/plannerInt.h b/source/libs/planner/inc/plannerInt.h new file mode 100644 index 0000000000..4005508ed7 --- /dev/null +++ b/source/libs/planner/inc/plannerInt.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_PLANNER_INT_H_ +#define _TD_PLANNER_INT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_PLANNER_INT_H_*/ \ No newline at end of file diff --git a/source/libs/planner/src/planner.c b/source/libs/planner/src/planner.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/libs/planner/src/planner.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/libs/planner/test/plannerTests.cpp b/source/libs/planner/test/plannerTests.cpp new file mode 100644 index 0000000000..e69de29bb2 -- GitLab