提交 5704d5e2 编写于 作者: H Hongze Cheng

refact

上级 e26fbd80
/*
* 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_VNODE_REQUEST_H_
#define _TD_VNODE_REQUEST_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /*_TD_VNODE_REQUEST_H_*/
\ No newline at end of file
......@@ -85,10 +85,32 @@ static void vnodeFree(SVnode *pVnode) {
}
static int vnodeOpenImpl(SVnode *pVnode) {
char dir[TSDB_FILENAME_LEN];
// Open meta
sprintf(dir, "%s/meta", pVnode->path);
if (metaOpen(dir, &(pVnode->options.metaOptions)) < 0) {
// TODO: handle error
return -1;
}
// Open tsdb
sprintf(dir, "%s/tsdb", pVnode->path);
if (tsdbOpen(dir, &(pVnode->options.tsdbOptions)) < 0) {
// TODO: handle error
return -1;
}
// TODO: Open TQ
// TODO
return 0;
}
static void vnodeCloseImpl(SVnode *pVnode) {
// TODO
if (pVnode) {
// TODO: Close TQ
tsdbClose(pVnode->pTsdb);
metaClose(pVnode->pMeta);
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@
const SVnodeOptions defaultVnodeOptions = {0}; /* TODO */
void vnodeOptionsInit(SVnodeOptions *pVnodeOptions) { /* TODO */
vnodeOptionsCopy(pVnodeOptions, &defaultVnodeOptions);
}
void vnodeOptionsClear(SVnodeOptions *pVnodeOptions) { /* TODO */
......
/*
* 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/>.
*/
\ No newline at end of file
......@@ -21,6 +21,7 @@ int vnodeProcessWriteReqs(SVnode *pVnode, SReqBatch *pReqBatch) {
}
int vnodeApplyWriteRequest(SVnode *pVnode, const SRequest *pRequest) {
int type;
/* TODO */
return 0;
}
......
......@@ -13,11 +13,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "meta.h"
#include "metaDef.h"
const static SMetaOptions defaultMetaOptions = {.lruCacheSize = 0};
static void metaOptionsCopy(SMetaOptions *pDest, const SMetaOptions *pSrc);
const SMetaOptions defaultMetaOptions = {.lruCacheSize = 0};
/* ------------------------ EXPOSED METHODS ------------------------ */
void metaOptionsInit(SMetaOptions *pMetaOptions) { metaOptionsCopy(pMetaOptions, &defaultMetaOptions); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册