diff --git a/include/libs/lru/lru.h b/include/libs/lru/lru.h new file mode 100644 index 0000000000000000000000000000000000000000..c82e8ed7468a1a6107c893deb1d0ad43c7e13a4e --- /dev/null +++ b/include/libs/lru/lru.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_LRU_H_ +#define _TD_LRU_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_LRU_H_*/ \ No newline at end of file diff --git a/source/libs/CMakeLists.txt b/source/libs/CMakeLists.txt index ed6d2bef4f74d0608c106623aa5c208ccfb93f31..c1bec69cd25bea698b81fe28f52f98317c9501a5 100644 --- a/source/libs/CMakeLists.txt +++ b/source/libs/CMakeLists.txt @@ -4,4 +4,5 @@ add_subdirectory(tkv) add_subdirectory(index) add_subdirectory(wal) add_subdirectory(parser) -add_subdirectory(scheduler) \ No newline at end of file +add_subdirectory(scheduler) +add_subdirectory(lru) \ No newline at end of file diff --git a/source/libs/lru/CMakeLists.txt b/source/libs/lru/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..b65615dbbfcee28fd6da898dd6c1c69d6a177e18 --- /dev/null +++ b/source/libs/lru/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(src LRU_SRC) +add_library(lru ${LRU_SRC}) +target_include_directories( + lru + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/lru" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/libs/lru/inc/lruInt.h b/source/libs/lru/inc/lruInt.h new file mode 100644 index 0000000000000000000000000000000000000000..e0da680104e898dc20408071af4f5fc2cb3ef29a --- /dev/null +++ b/source/libs/lru/inc/lruInt.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_LRU_INT_H_ +#define _TD_LRU_INT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_LRU_INT_H_*/ \ No newline at end of file diff --git a/source/libs/lru/src/lru.c b/source/libs/lru/src/lru.c new file mode 100644 index 0000000000000000000000000000000000000000..6dea4a4e57392be988126c579648f39a8270b9bf --- /dev/null +++ b/source/libs/lru/src/lru.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/lru/test/lruTests.cpp b/source/libs/lru/test/lruTests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391