提交 a5c3d2c6 编写于 作者: H Hongze Cheng

refactor

上级 cb98cd3f
/*
* 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 TD_TDISK_H
#define TD_TDISK_H
#include "tglobal.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
int level;
int id;
} SDiskID;
int tdInitMount(SDiskCfg *pDiskCfg, int ndisk);
void tdDestroyMount();
int tdUpdateDiskInfos();
void tdGetPrimaryPath(char *dst);
#ifdef __cplusplus
}
#endif
#endif
/*
* 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 _TD_TPATH_H_
#define _TD_TPATH_H_
#include <stdio.h>
#include "taosdef.h"
#ifdef __cplusplus
extern "C" {
#endif
static FORCE_INLINE void tdGetMnodeRootDir(const char *baseDir, char *dirName) {
snprintf(dirName, TSDB_FILENAME_LEN, "%s/mnode", baseDir);
}
static FORCE_INLINE void tdGetDnodeRootDir(const char *baseDir, char *dirName) {
snprintf(dirName, TSDB_FILENAME_LEN, "%s/dnode", baseDir);
}
static FORCE_INLINE void tdGetVnodeRootDir(const char *baseDir, char *dirName) {
snprintf(dirName, TSDB_FILENAME_LEN, "%s/vnode", baseDir);
}
static FORCE_INLINE void tdGetVnodeBackRootDir(const char *baseDir, char *dirName) {
snprintf(dirName, TSDB_FILENAME_LEN, "%s/vnode_bak", baseDir);
}
static FORCE_INLINE void tdGetVnodeDir(const char *baseDir, int vid, char *dirName) {
snprintf(dirName, TSDB_FILENAME_LEN, "%s/vnode/vnode%d", baseDir, vid);
}
static FORCE_INLINE void tdGetVnodeBackDir(const char *baseDir, int vid, char *dirName) {
snprintf(dirName, TSDB_FILENAME_LEN, "%s/vnode_bak/vnode%d", baseDir, vid);
}
static FORCE_INLINE void tdGetTsdbRootDir(const char *baseDir, int vid, char *dirName) {
snprintf(dirName, TSDB_FILENAME_LEN, "%s/vnode/vnode%d/tsdb", baseDir, vid);
}
static FORCE_INLINE void tdGetTsdbDataDir(const char *baseDir, int vid, char *dirName) {
snprintf(dirName, TSDB_FILENAME_LEN, "%s/vnode/vnode%d/tsdb/data", baseDir, vid);
}
#ifdef __cplusplus
}
#endif
#endif // _TD_TPATH_H_
\ No newline at end of file
......@@ -13,7 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os.h"
#include "tmount.h"
#include "hash.h"
#include "taosdef.h"
#include "taoserror.h"
......
......@@ -16,7 +16,6 @@
#define _DEFAULT_SOURCE
#include "os.h"
#include "tconfig.h"
#include "tmount.h"
#include "tglobal.h"
#include "tulog.h"
......
......@@ -20,7 +20,6 @@
#include "tlog.h"
#include "ttimer.h"
#include "tutil.h"
#include "tmount.h"
#include "tscUtil.h"
#include "tsclient.h"
#include "dnode.h"
......
......@@ -21,8 +21,6 @@
#include "tchecksum.h"
#include "tsdbMain.h"
#include "tutil.h"
#include "tpath.h"
#include "tmount.h"
const char * tsdbFileSuffix[] = {".head", ".data", ".last", ".stat", ".h", ".d", ".l", ".s"};
......
......@@ -21,7 +21,6 @@
#include "tcoding.h"
#include "tscompression.h"
#include "tsdbMain.h"
#include "tpath.h"
#define TSDB_GET_COMPCOL_LEN(nCols) (sizeof(SCompData) + sizeof(SCompCol) * (nCols) + sizeof(TSCKSUM))
#define TSDB_KEY_COL_OFFSET 0
......
......@@ -29,8 +29,6 @@
#include "dnodeVWrite.h"
#include "dnodeVRead.h"
#include "query.h"
#include "tpath.h"
#include "tmount.h"
static SHashObj*tsVnodesHash;
static void vnodeCleanUp(SVnodeObj *pVnode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册