Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e04bccdc
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e04bccdc
编写于
11月 02, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact
上级
ff33e67f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
5 deletion
+42
-5
source/dnode/vnode/meta/inc/metaDef.h
source/dnode/vnode/meta/inc/metaDef.h
+2
-2
source/dnode/vnode/meta/src/metaDB.c
source/dnode/vnode/meta/src/metaDB.c
+38
-1
source/dnode/vnode/meta/src/metaMain.c
source/dnode/vnode/meta/src/metaMain.c
+2
-2
未找到文件。
source/dnode/vnode/meta/inc/metaDef.h
浏览文件 @
e04bccdc
...
@@ -26,8 +26,8 @@ extern "C" {
...
@@ -26,8 +26,8 @@ extern "C" {
struct
SMeta
{
struct
SMeta
{
char
*
path
;
// path of current meta
char
*
path
;
// path of current meta
SMetaOptions
options
;
// meta option
SMetaOptions
options
;
// meta option
SMetaDB
*
pMetaDB
;
// meta DB for real storage engine
SMetaDB
metaDB
;
// meta DB for real storage engine
STbUidGenerator
uidG
enerator
;
// meta table UID generator
STbUidGenerator
uidG
nrt
;
// meta table UID generator
};
};
#ifdef __cplusplus
#ifdef __cplusplus
...
...
source/dnode/vnode/meta/src/metaDB.c
浏览文件 @
e04bccdc
...
@@ -11,4 +11,41 @@
...
@@ -11,4 +11,41 @@
*
*
* You should have received a copy of the GNU Affero General Public License
* 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/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
\ No newline at end of file
#include "meta.h"
#include "metaDef.h"
int
metaOpenDB
(
SMeta
*
pMeta
)
{
/* TODO */
pMeta
->
metaDB
.
pDB
=
tkvOpen
(
NULL
,
"db"
);
if
(
pMeta
->
metaDB
.
pDB
==
NULL
)
{
// TODO
return
-
1
;
}
pMeta
->
metaDB
.
pIdx
=
tkvOpen
(
NULL
,
"index"
);
if
(
pMeta
->
metaDB
.
pIdx
==
NULL
)
{
/* TODO */
return
-
1
;
}
{
/* TODO: for cache*/
}
return
0
;
}
void
metaCloseDB
(
SMeta
*
pMeta
)
{
/* TODO */
{
// TODO: clear cache
}
if
(
pMeta
->
metaDB
.
pIdx
)
{
tkvClose
(
pMeta
->
metaDB
.
pIdx
);
}
if
(
pMeta
->
metaDB
.
pDB
)
{
tkvClose
(
pMeta
->
metaDB
.
pIdx
);
}
}
\ No newline at end of file
source/dnode/vnode/meta/src/metaMain.c
浏览文件 @
e04bccdc
...
@@ -57,14 +57,14 @@ SMeta *metaOpen(const char *path, const SMetaOptions *pMetaOptions) {
...
@@ -57,14 +57,14 @@ SMeta *metaOpen(const char *path, const SMetaOptions *pMetaOptions) {
return
NULL
;
return
NULL
;
}
}
tableUidGeneratorInit
(
&
(
pMeta
->
uidG
enerator
),
IVLD_TB_UID
);
tableUidGeneratorInit
(
&
(
pMeta
->
uidG
nrt
),
IVLD_TB_UID
);
return
pMeta
;
return
pMeta
;
}
}
void
metaClose
(
SMeta
*
pMeta
)
{
void
metaClose
(
SMeta
*
pMeta
)
{
if
(
pMeta
)
{
if
(
pMeta
)
{
tableUidGeneratorClear
(
&
pMeta
->
uidG
enerator
);
tableUidGeneratorClear
(
&
pMeta
->
uidG
nrt
);
metaCloseDB
(
pMeta
);
metaCloseDB
(
pMeta
);
free
(
pMeta
);
free
(
pMeta
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录