refact code

This commit is contained in:
Hongze Cheng 2023-06-14 14:05:41 +08:00
parent 5bacfb4f94
commit 4138361839
22 changed files with 33 additions and 76 deletions

View File

@ -35,23 +35,23 @@ set(
"src/sma/smaSnapshot.c" "src/sma/smaSnapshot.c"
"src/sma/smaTimeRange.c" "src/sma/smaTimeRange.c"
# tsdb # # tsdb
"src/tsdb/tsdbCommit.c" # "src/tsdb/tsdbCommit.c"
"src/tsdb/tsdbFile.c" # "src/tsdb/tsdbFile.c"
"src/tsdb/tsdbFS.c" # "src/tsdb/tsdbFS.c"
"src/tsdb/tsdbOpen.c" # "src/tsdb/tsdbOpen.c"
"src/tsdb/tsdbMemTable.c" # "src/tsdb/tsdbMemTable.c"
"src/tsdb/tsdbRead.c" # "src/tsdb/tsdbRead.c"
"src/tsdb/tsdbCache.c" # "src/tsdb/tsdbCache.c"
"src/tsdb/tsdbWrite.c" # "src/tsdb/tsdbWrite.c"
"src/tsdb/tsdbReaderWriter.c" # "src/tsdb/tsdbReaderWriter.c"
"src/tsdb/tsdbUtil.c" # "src/tsdb/tsdbUtil.c"
"src/tsdb/tsdbSnapshot.c" # "src/tsdb/tsdbSnapshot.c"
"src/tsdb/tsdbCacheRead.c" # "src/tsdb/tsdbCacheRead.c"
"src/tsdb/tsdbRetention.c" # "src/tsdb/tsdbRetention.c"
"src/tsdb/tsdbDiskData.c" # "src/tsdb/tsdbDiskData.c"
"src/tsdb/tsdbMergeTree.c" # "src/tsdb/tsdbMergeTree.c"
"src/tsdb/tsdbDataIter.c" # "src/tsdb/tsdbDataIter.c"
# tq # tq
"src/tq/tq.c" "src/tq/tq.c"
@ -68,14 +68,12 @@ set(
"src/tq/tqOffsetSnapshot.c" "src/tq/tqOffsetSnapshot.c"
) )
if (USE_DEV_CODE) aux_source_directory("src/tsdb/" TSDB_SOURCE_FILES)
aux_source_directory("src/tsdb/dev" VNODE_SOURCE_DEV_FILES) list(
list(
APPEND APPEND
VNODE_SOURCE_FILES VNODE_SOURCE_FILES
${VNODE_SOURCE_DEV_FILES} ${TSDB_SOURCE_FILES}
) )
endif(USE_DEV_CODE)
target_sources( target_sources(
vnode vnode

View File

@ -1,41 +0,0 @@
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef _TSDB_DEV_H
#define _TSDB_DEV_H
#include "tsdb.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "inc/tsdbUtil2.h"
#include "inc/tsdbFile2.h"
#include "inc/tsdbFSet2.h"
#include "inc/tsdbFS2.h"
#include "inc/tsdbSttFileRW.h"
#include "inc/tsdbDataFileRW.h"
#ifdef __cplusplus
}
#endif
#endif /*_TSDB_DEV_H*/

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "inc/tsdbCommit2.h" #include "tsdbCommit2.h"
// extern dependencies // extern dependencies
typedef struct { typedef struct {

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "inc/tsdbDataFileRW.h" #include "tsdbDataFileRW.h"
typedef struct { typedef struct {
SFDataPtr brinBlkPtr[1]; SFDataPtr brinBlkPtr[1];

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "inc/tsdbFS2.h" #include "tsdbFS2.h"
extern int vnodeScheduleTask(int (*execute)(void *), void *arg); extern int vnodeScheduleTask(int (*execute)(void *), void *arg);
extern int vnodeScheduleTaskEx(int tpid, int (*execute)(void *), void *arg); extern int vnodeScheduleTaskEx(int tpid, int (*execute)(void *), void *arg);

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "inc/tsdbFSet2.h" #include "tsdbFSet2.h"
static int32_t tsdbSttLvlInit(int32_t level, SSttLvl **lvl) { static int32_t tsdbSttLvlInit(int32_t level, SSttLvl **lvl) {
if (!(lvl[0] = taosMemoryMalloc(sizeof(SSttLvl)))) return TSDB_CODE_OUT_OF_MEMORY; if (!(lvl[0] = taosMemoryMalloc(sizeof(SSttLvl)))) return TSDB_CODE_OUT_OF_MEMORY;

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "inc/tsdbFile2.h" #include "tsdbFile2.h"
// to_json // to_json
static int32_t head_to_json(const STFile *file, cJSON *json); static int32_t head_to_json(const STFile *file, cJSON *json);

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "inc/tsdbIter.h" #include "tsdbIter.h"
// STsdbIter ================ // STsdbIter ================
struct STsdbIter { struct STsdbIter {

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "inc/tsdbMerge.h" #include "tsdbMerge.h"
typedef struct { typedef struct {
STsdb *tsdb; STsdb *tsdb;

View File

@ -15,7 +15,7 @@
#include "tsdb.h" #include "tsdb.h"
#ifdef USE_DEV_CODE #ifdef USE_DEV_CODE
#include "dev/dev.h" #include "tsdbFS2.h"
#endif #endif
int32_t tsdbSetKeepCfg(STsdb *pTsdb, STsdbCfg *pCfg) { int32_t tsdbSetKeepCfg(STsdb *pTsdb, STsdbCfg *pCfg) {

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "inc/tsdbSttFileRW.h" #include "tsdbSttFileRW.h"
typedef struct { typedef struct {
int64_t prevFooter; int64_t prevFooter;

View File

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "dev.h" #include "tsdbUtil2.h"
// SDelBlock ---------- // SDelBlock ----------
int32_t tTombBlockInit(STombBlock *tombBlock) { int32_t tTombBlockInit(STombBlock *tombBlock) {