Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0230a529
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
0230a529
编写于
1月 20, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact tdb
上级
ebf0ee36
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
22 addition
and
68 deletion
+22
-68
source/libs/tdb/src/db/tdb_mpfile.c
source/libs/tdb/src/db/tdb_mpfile.c
+0
-14
source/libs/tdb/src/db/tdb_mpool.c
source/libs/tdb/src/db/tdb_mpool.c
+1
-1
source/libs/tdb/src/inc/tdb_inc.h
source/libs/tdb/src/inc/tdb_inc.h
+3
-3
source/libs/tdb/src/inc/tdb_mpfile.h
source/libs/tdb/src/inc/tdb_mpfile.h
+0
-46
source/libs/tdb/src/inc/tdb_mpool.h
source/libs/tdb/src/inc/tdb_mpool.h
+18
-4
未找到文件。
source/libs/tdb/src/db/tdb_mpfile.c
已删除
100644 → 0
浏览文件 @
ebf0ee36
/*
* 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
source/libs/tdb/src/db/tdb_mpool.c
浏览文件 @
0230a529
...
@@ -13,7 +13,7 @@
...
@@ -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 "tdb_mp.h"
#include "tdb_mp
ool
.h"
int
tdbOpenMP
(
TDB_MPOOL
**
mpp
,
uint64_t
cachesize
,
pgsize_t
pgsize
)
{
int
tdbOpenMP
(
TDB_MPOOL
**
mpp
,
uint64_t
cachesize
,
pgsize_t
pgsize
)
{
TDB_MPOOL
*
mp
;
TDB_MPOOL
*
mp
;
...
...
source/libs/tdb/src/inc/tdb_inc.h
浏览文件 @
0230a529
...
@@ -23,9 +23,9 @@
...
@@ -23,9 +23,9 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
// pg
id
_t
// pg
no
_t
typedef
int32_t
pg
id
_t
;
typedef
int32_t
pg
no
_t
;
#define TDB_IVLD_PGID ((pg
id
_t)-1)
#define TDB_IVLD_PGID ((pg
no
_t)-1)
// framd_id_t
// framd_id_t
typedef
int32_t
frame_id_t
;
typedef
int32_t
frame_id_t
;
...
...
source/libs/tdb/src/inc/tdb_mpfile.h
已删除
100644 → 0
浏览文件 @
ebf0ee36
/*
* 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_TDB_MPFILE_H_
#define _TD_TDB_MPFILE_H_
#include "tdb_mpool.h"
#ifdef __cplusplus
extern
"C"
{
#endif
// Exposed handle
typedef
struct
TDB_MPFILE
TDB_MPFILE
;
// Exposed apis
int
tdbMPFOpen
(
TDB_MPFILE
**
mpfp
,
const
char
*
fname
,
TDB_MPOOL
*
mp
);
int
tdbMPFClose
(
TDB_MPFILE
*
mpf
);
int
tdbMPFGet
(
TDB_MPFILE
*
mpf
,
pgid_t
pgid
,
void
*
addr
);
int
tdbMPFPut
(
TDB_MPOOL
*
mpf
,
pgid_t
pgid
,
void
*
addr
);
// Hidden structures
struct
TDB_MPFILE
{
uint8_t
fuid
[
20
];
// file unique ID
TDB_MPOOL
*
mp
;
// underlying memory pool
char
*
fname
;
// file name
int
fd
;
// fd
};
#ifdef __cplusplus
}
#endif
#endif
/*_TD_TDB_MPFILE_H_*/
\ No newline at end of file
source/libs/tdb/src/inc/tdb_mp.h
→
source/libs/tdb/src/inc/tdb_mp
ool
.h
浏览文件 @
0230a529
...
@@ -24,10 +24,11 @@ extern "C" {
...
@@ -24,10 +24,11 @@ extern "C" {
// Exposed handle
// Exposed handle
typedef
struct
TDB_MPOOL
TDB_MPOOL
;
typedef
struct
TDB_MPOOL
TDB_MPOOL
;
typedef
struct
TDB_MPFILE
TDB_MPFILE
;
typedef
struct
{
typedef
struct
{
uint8_t
fuid
[
TDB_FILE_UID_LEN
];
uint8_t
fuid
[
TDB_FILE_UID_LEN
];
pg
id
_t
pgid
;
pg
no
_t
pgid
;
}
mp_pgid_t
;
}
mp_pgid_t
;
typedef
struct
MP_PAGE
{
typedef
struct
MP_PAGE
{
...
@@ -55,15 +56,28 @@ struct TDB_MPOOL {
...
@@ -55,15 +56,28 @@ struct TDB_MPOOL {
// TODO: TD_DLIST(TD_MPFILE) mpfList; // MPFILE registered on this memory pool
// TODO: TD_DLIST(TD_MPFILE) mpfList; // MPFILE registered on this memory pool
};
};
#define MP_PAGE_AT(mp, idx) ((char *)((mp)->pages) + MP_PAGE_SIZE((mp)->pgsize) * (idx))
struct
TDB_MPFILE
{
uint8_t
fuid
[
20
];
// file unique ID
TDB_MPOOL
*
mp
;
// underlying memory pool
char
*
fname
;
// file name
int
fd
;
// fd
};
// Exposed apis =====================================================================================================
#define MP_PAGE_AT(mp, idx) ((char *)((mp)->pages) + MP_PAGE_SIZE((mp)->pgsize) * (idx))
/*=================================================== Exposed apis ==================================================*/
// TDB_MPOOL
int
tdbOpenMP
(
TDB_MPOOL
**
mpp
,
uint64_t
cachesize
,
pgsize_t
pgsize
);
int
tdbOpenMP
(
TDB_MPOOL
**
mpp
,
uint64_t
cachesize
,
pgsize_t
pgsize
);
int
tdbCloseMP
(
TDB_MPOOL
*
mp
);
int
tdbCloseMP
(
TDB_MPOOL
*
mp
);
int
tdbMPFetchPage
(
TDB_MPOOL
*
mp
,
mp_pgid_t
mpgid
,
void
*
p
);
int
tdbMPFetchPage
(
TDB_MPOOL
*
mp
,
mp_pgid_t
mpgid
,
void
*
p
);
int
tdbMpUnfetchPage
(
TDB_MPOOL
*
mp
,
mp_pgid_t
mpgid
,
void
*
p
);
int
tdbMpUnfetchPage
(
TDB_MPOOL
*
mp
,
mp_pgid_t
mpgid
,
void
*
p
);
// TDB_MPFILE
int
tdbMPFOpen
(
TDB_MPFILE
**
mpfp
,
const
char
*
fname
,
TDB_MPOOL
*
mp
);
int
tdbMPFClose
(
TDB_MPFILE
*
mpf
);
int
tdbMPFGet
(
TDB_MPFILE
*
mpf
,
pgno_t
pgid
,
void
*
addr
);
int
tdbMPFPut
(
TDB_MPOOL
*
mpf
,
pgno_t
pgid
,
void
*
addr
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录