From 5b04e396914c8d2eafb8d7b925b7b4a86c8437a0 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 22 Sep 2021 16:25:22 +0800 Subject: [PATCH] refact --- include/libs/wal/wal.h | 27 +++++++++++++++++++++++++++ source/CMakeLists.txt | 2 +- source/libs/CMakeLists.txt | 3 ++- source/libs/asvc/src/asvc.c | 14 ++++++++++++++ source/libs/index/src/index.c | 27 +++++++++++++++++++++++++++ source/libs/raft/src/raft.c | 14 ++++++++++++++ source/libs/tkv/src/tkv.c | 14 ++++++++++++++ source/libs/wal/CMakeLists.txt | 7 +++++++ source/libs/wal/src/wal.c | 14 ++++++++++++++ 9 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 include/libs/wal/wal.h create mode 100644 source/libs/asvc/src/asvc.c create mode 100644 source/libs/index/src/index.c create mode 100644 source/libs/raft/src/raft.c create mode 100644 source/libs/tkv/src/tkv.c create mode 100644 source/libs/wal/CMakeLists.txt create mode 100644 source/libs/wal/src/wal.c diff --git a/include/libs/wal/wal.h b/include/libs/wal/wal.h new file mode 100644 index 0000000000..498c33b6e6 --- /dev/null +++ b/include/libs/wal/wal.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_WAL_H_ +#define _TD_WAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_WAL_H_*/ \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index eee512e5f9..e8f09c6d51 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(os) add_subdirectory(util) add_subdirectory(common) -# add_subdirectory(libs) +add_subdirectory(libs) # add_subdirectory(client) # add_subdirectory(server) \ No newline at end of file diff --git a/source/libs/CMakeLists.txt b/source/libs/CMakeLists.txt index 035e41bd5b..59a65fbfba 100644 --- a/source/libs/CMakeLists.txt +++ b/source/libs/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(asvc) add_subdirectory(raft) add_subdirectory(tkv) -add_subdirectory(index) \ No newline at end of file +add_subdirectory(index) +add_subdirectory(wal) \ No newline at end of file diff --git a/source/libs/asvc/src/asvc.c b/source/libs/asvc/src/asvc.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/libs/asvc/src/asvc.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/index/src/index.c b/source/libs/index/src/index.c new file mode 100644 index 0000000000..f821b437af --- /dev/null +++ b/source/libs/index/src/index.c @@ -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/source/libs/raft/src/raft.c b/source/libs/raft/src/raft.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/libs/raft/src/raft.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/tkv/src/tkv.c b/source/libs/tkv/src/tkv.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/libs/tkv/src/tkv.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/wal/CMakeLists.txt b/source/libs/wal/CMakeLists.txt new file mode 100644 index 0000000000..1e19586276 --- /dev/null +++ b/source/libs/wal/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src WAL_SRC) +add_library(wal ${WAL_SRC}) +target_include_directories( + wal + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/wal" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/libs/wal/src/wal.c b/source/libs/wal/src/wal.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/libs/wal/src/wal.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