Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c8c09c8a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c8c09c8a
编写于
1月 13, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact
上级
c3113421
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
40 addition
and
46 deletion
+40
-46
source/libs/CMakeLists.txt
source/libs/CMakeLists.txt
+1
-1
source/libs/tdb/CMakeLists.txt
source/libs/tdb/CMakeLists.txt
+4
-4
source/libs/tdb/inc/tdb.h
source/libs/tdb/inc/tdb.h
+4
-4
source/libs/tdb/src/inc/tdbBtree.h
source/libs/tdb/src/inc/tdbBtree.h
+4
-4
source/libs/tdb/src/inc/tdbBufPool.h
source/libs/tdb/src/inc/tdbBufPool.h
+6
-6
source/libs/tdb/src/inc/tdbDB.h
source/libs/tdb/src/inc/tdbDB.h
+5
-5
source/libs/tdb/src/inc/tdbDef.h
source/libs/tdb/src/inc/tdbDef.h
+3
-3
source/libs/tdb/src/inc/tdbDiskMgr.h
source/libs/tdb/src/inc/tdbDiskMgr.h
+1
-1
source/libs/tdb/src/inc/tdbEnv.h
source/libs/tdb/src/inc/tdbEnv.h
+3
-3
source/libs/tdb/src/inc/tdbHash.h
source/libs/tdb/src/inc/tdbHash.h
+3
-3
source/libs/tdb/src/inc/tdbPage.h
source/libs/tdb/src/inc/tdbPage.h
+4
-10
source/libs/tdb/src/tdbBufPool.c
source/libs/tdb/src/tdbBufPool.c
+1
-1
source/libs/tdb/src/tdbDiskMgr.c
source/libs/tdb/src/tdbDiskMgr.c
+1
-1
source/libs/tdb/test/tDiskMgrTest.cpp
source/libs/tdb/test/tDiskMgrTest.cpp
+0
-0
source/libs/tdb/test/tkvTests.cpp
source/libs/tdb/test/tkvTests.cpp
+0
-0
未找到文件。
source/libs/CMakeLists.txt
浏览文件 @
c8c09c8a
add_subdirectory
(
transport
)
add_subdirectory
(
transport
)
add_subdirectory
(
sync
)
add_subdirectory
(
sync
)
add_subdirectory
(
t
kv
)
add_subdirectory
(
t
db
)
add_subdirectory
(
index
)
add_subdirectory
(
index
)
add_subdirectory
(
wal
)
add_subdirectory
(
wal
)
add_subdirectory
(
parser
)
add_subdirectory
(
parser
)
...
...
source/libs/t
kv
/CMakeLists.txt
→
source/libs/t
db
/CMakeLists.txt
浏览文件 @
c8c09c8a
aux_source_directory
(
src T
KV
_SRC
)
aux_source_directory
(
src T
DB
_SRC
)
add_library
(
t
kv STATIC
${
TKV
_SRC
}
)
add_library
(
t
db STATIC
${
TDB
_SRC
}
)
# target_include_directories(
# target_include_directories(
# tkv
# tkv
# PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/tkv"
# PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/tkv"
# PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
# PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
# )
# )
target_include_directories
(
target_include_directories
(
t
kv
t
db
PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/inc"
PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/inc"
)
)
target_link_libraries
(
target_link_libraries
(
t
kv
t
db
PUBLIC os
PUBLIC os
PUBLIC util
PUBLIC util
)
)
\ No newline at end of file
source/libs/t
kv/inc/tkv
.h
→
source/libs/t
db/inc/tdb
.h
浏览文件 @
c8c09c8a
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef _TD_T
KV
_H_
#ifndef _TD_T
DB
_H_
#define _TD_T
KV
_H_
#define _TD_T
DB
_H_
#include "os.h"
#include "os.h"
...
@@ -28,7 +28,7 @@ typedef struct TDB_ENV TDB_ENV;
...
@@ -28,7 +28,7 @@ typedef struct TDB_ENV TDB_ENV;
// SKey
// SKey
typedef
struct
{
typedef
struct
{
void
*
bdata
;
void
*
bdata
;
uint32_t
size
;
uint32_t
size
;
}
TDB_KEY
,
TDB_VALUE
;
}
TDB_KEY
,
TDB_VALUE
;
...
@@ -36,4 +36,4 @@ typedef struct {
...
@@ -36,4 +36,4 @@ typedef struct {
}
}
#endif
#endif
#endif
/*_TD_TKV_H_*/
#endif
/*_TD_TDB_H_*/
\ No newline at end of file
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
Btree.h
→
source/libs/t
db/src/inc/tdb
Btree.h
浏览文件 @
c8c09c8a
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef _TD_T
KV
_BTREE_H_
#ifndef _TD_T
DB
_BTREE_H_
#define _TD_T
KV
_BTREE_H_
#define _TD_T
DB
_BTREE_H_
#include "tkvDef.h"
#include "tkvDef.h"
...
@@ -24,10 +24,10 @@ extern "C" {
...
@@ -24,10 +24,10 @@ extern "C" {
typedef
struct
{
typedef
struct
{
pgid_t
root
;
// root page number
pgid_t
root
;
// root page number
}
STkvBtree
;
}
TDB_BTREE
;
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
#endif
/*_TD_TKV_BTREE_H_*/
#endif
/*_TD_TDB_BTREE_H_*/
\ No newline at end of file
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
BufPool.h
→
source/libs/t
db/src/inc/tdb
BufPool.h
浏览文件 @
c8c09c8a
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef _TD_T
KV
_BUF_POOL_H_
#ifndef _TD_T
DB
_BUF_POOL_H_
#define _TD_T
KV
_BUF_POOL_H_
#define _TD_T
DB
_BUF_POOL_H_
#include "t
kv
Page.h"
#include "t
db
Page.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -26,9 +26,9 @@ typedef struct STkvBufPool STkvBufPool;
...
@@ -26,9 +26,9 @@ typedef struct STkvBufPool STkvBufPool;
int
tbpOpen
(
STkvBufPool
**
ppTkvBufPool
);
int
tbpOpen
(
STkvBufPool
**
ppTkvBufPool
);
int
tbpClose
(
STkvBufPool
*
pTkvBufPool
);
int
tbpClose
(
STkvBufPool
*
pTkvBufPool
);
ST
kv
Page
*
tbpNewPage
(
STkvBufPool
*
pTkvBufPool
);
ST
db
Page
*
tbpNewPage
(
STkvBufPool
*
pTkvBufPool
);
int
tbpDelPage
(
STkvBufPool
*
pTkvBufPool
);
int
tbpDelPage
(
STkvBufPool
*
pTkvBufPool
);
ST
kv
Page
*
tbpFetchPage
(
STkvBufPool
*
pTkvBufPool
,
pgid_t
pgid
);
ST
db
Page
*
tbpFetchPage
(
STkvBufPool
*
pTkvBufPool
,
pgid_t
pgid
);
int
tbpUnpinPage
(
STkvBufPool
*
pTkvBufPool
,
pgid_t
pgid
);
int
tbpUnpinPage
(
STkvBufPool
*
pTkvBufPool
,
pgid_t
pgid
);
void
tbpFlushPages
(
STkvBufPool
*
pTkvBufPool
);
void
tbpFlushPages
(
STkvBufPool
*
pTkvBufPool
);
...
@@ -36,4 +36,4 @@ void tbpFlushPages(STkvBufPool *pTkvBufPool);
...
@@ -36,4 +36,4 @@ void tbpFlushPages(STkvBufPool *pTkvBufPool);
}
}
#endif
#endif
#endif
/*_TD_TKV_BUF_POOL_H_*/
#endif
/*_TD_TDB_BUF_POOL_H_*/
\ No newline at end of file
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
DB.h
→
source/libs/t
db/src/inc/tdb
DB.h
浏览文件 @
c8c09c8a
...
@@ -13,11 +13,11 @@
...
@@ -13,11 +13,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef _TD_T
KV
_DB_H_
#ifndef _TD_T
DB
_DB_H_
#define _TD_T
KV
_DB_H_
#define _TD_T
DB
_DB_H_
#include "t
kv
Btree.h"
#include "t
db
Btree.h"
#include "t
kv
Hash.h"
#include "t
db
Hash.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -42,4 +42,4 @@ struct TDB {
...
@@ -42,4 +42,4 @@ struct TDB {
}
}
#endif
#endif
#endif
/*_TD_TKV_DB_H_*/
#endif
/*_TD_TDB_DB_H_*/
\ No newline at end of file
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
Def.h
→
source/libs/t
db/src/inc/tdb
Def.h
浏览文件 @
c8c09c8a
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef _TD_T
KV
_DEF_H_
#ifndef _TD_T
DB
_DEF_H_
#define _TD_T
KV
_DEF_H_
#define _TD_T
DB
_DEF_H_
#include "os.h"
#include "os.h"
...
@@ -39,4 +39,4 @@ typedef int32_t pgsize_t;
...
@@ -39,4 +39,4 @@ typedef int32_t pgsize_t;
}
}
#endif
#endif
#endif
/*_TD_TKV_DEF_H_*/
#endif
/*_TD_TDB_DEF_H_*/
\ No newline at end of file
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
DiskMgr.h
→
source/libs/t
db/src/inc/tdb
DiskMgr.h
浏览文件 @
c8c09c8a
...
@@ -22,7 +22,7 @@ extern "C" {
...
@@ -22,7 +22,7 @@ extern "C" {
#include "os.h"
#include "os.h"
#include "t
kv
Def.h"
#include "t
db
Def.h"
typedef
struct
STkvDiskMgr
STkvDiskMgr
;
typedef
struct
STkvDiskMgr
STkvDiskMgr
;
...
...
source/libs/t
kv/src/inc/tkv
Env.h
→
source/libs/t
db/src/inc/tdb
Env.h
浏览文件 @
c8c09c8a
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef _TD_T
KV
_ENV_H_
#ifndef _TD_T
DB
_ENV_H_
#define _TD_T
KV
_ENV_H_
#define _TD_T
DB
_ENV_H_
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -28,4 +28,4 @@ struct TDB_ENV {
...
@@ -28,4 +28,4 @@ struct TDB_ENV {
}
}
#endif
#endif
#endif
/*_TD_TKV_ENV_H_*/
#endif
/*_TD_TDB_ENV_H_*/
\ No newline at end of file
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
Hash.h
→
source/libs/t
db/src/inc/tdb
Hash.h
浏览文件 @
c8c09c8a
...
@@ -16,15 +16,15 @@
...
@@ -16,15 +16,15 @@
#ifndef _TD_TKV_HAHS_H_
#ifndef _TD_TKV_HAHS_H_
#define _TD_TKV_HAHS_H_
#define _TD_TKV_HAHS_H_
#include "t
kv
Def.h"
#include "t
db
Def.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
typedef
struct
STkvHash
{
typedef
struct
{
// TODO
// TODO
}
STkvHash
;
}
TDB_HASH
;
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/libs/t
kv/src/inc/tkv
Page.h
→
source/libs/t
db/src/inc/tdb
Page.h
浏览文件 @
c8c09c8a
...
@@ -17,30 +17,24 @@
...
@@ -17,30 +17,24 @@
#define _TD_TKV_PAGE_H_
#define _TD_TKV_PAGE_H_
#include "os.h"
#include "os.h"
#include "t
kv
Def.h"
#include "t
db
Def.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
typedef
struct
STkvPage
{
typedef
struct
{
pgid_t
pgid
;
pgid_t
pgid
;
int32_t
pinCount
;
int32_t
pinCount
;
bool
idDirty
;
bool
idDirty
;
char
*
pData
;
char
*
pData
;
}
ST
kv
Page
;
}
ST
db
Page
;
typedef
struct
{
typedef
struct
{
uint16_t
dbver
;
uint16_t
dbver
;
uint16_t
pgsize
;
uint16_t
pgsize
;
uint32_t
cksm
;
uint32_t
cksm
;
}
STkvPgHdr
;
}
STdbPgHdr
;
// typedef struct {
// SPgHdr chdr;
// uint16_t used; // number of used slots
// uint16_t loffset; // the offset of the starting location of the last slot used
// } SSlottedPgHdr;
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/libs/t
kv/src/tkv
BufPool.c
→
source/libs/t
db/src/tdb
BufPool.c
浏览文件 @
c8c09c8a
...
@@ -26,7 +26,7 @@ struct SFrameIdWrapper {
...
@@ -26,7 +26,7 @@ struct SFrameIdWrapper {
};
};
struct
STkvBufPool
{
struct
STkvBufPool
{
ST
kv
Page
*
pages
;
ST
db
Page
*
pages
;
STkvDiskMgr
*
pDiskMgr
;
STkvDiskMgr
*
pDiskMgr
;
SHashObj
*
pgTb
;
// page_id_t --> frame_id_t
SHashObj
*
pgTb
;
// page_id_t --> frame_id_t
TD_SLIST
(
SFrameIdWrapper
)
freeList
;
TD_SLIST
(
SFrameIdWrapper
)
freeList
;
...
...
source/libs/t
kv/src/t
DiskMgr.c
→
source/libs/t
db/src/tdb
DiskMgr.c
浏览文件 @
c8c09c8a
...
@@ -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 "t
kv
DiskMgr.h"
#include "t
db
DiskMgr.h"
struct
STkvDiskMgr
{
struct
STkvDiskMgr
{
char
*
fname
;
char
*
fname
;
...
...
source/libs/t
kv
/test/tDiskMgrTest.cpp
→
source/libs/t
db
/test/tDiskMgrTest.cpp
浏览文件 @
c8c09c8a
文件已移动
source/libs/t
kv
/test/tkvTests.cpp
→
source/libs/t
db
/test/tkvTests.cpp
浏览文件 @
c8c09c8a
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录