Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
25617eca
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
25617eca
编写于
1月 13, 2022
作者:
H
Hongze Cheng
提交者:
GitHub
1月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9781 from taosdata/feature/vnode
Feature/vnode
上级
b4dee0f5
093b982f
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
82 addition
and
468 deletion
+82
-468
source/dnode/vnode/src/inc/vnodeDef.h
source/dnode/vnode/src/inc/vnodeDef.h
+10
-5
source/dnode/vnode/src/inc/vnodeMAF.h
source/dnode/vnode/src/inc/vnodeMAF.h
+0
-32
source/dnode/vnode/src/inc/vnodeQuery.h
source/dnode/vnode/src/inc/vnodeQuery.h
+1
-2
source/dnode/vnode/src/inc/vnodeRead.h
source/dnode/vnode/src/inc/vnodeRead.h
+0
-30
source/dnode/vnode/src/meta/CMakeLists.txt
source/dnode/vnode/src/meta/CMakeLists.txt
+0
-46
source/dnode/vnode/src/tq/CMakeLists.txt
source/dnode/vnode/src/tq/CMakeLists.txt
+0
-20
source/dnode/vnode/src/tsdb/CMakeLists.txt
source/dnode/vnode/src/tsdb/CMakeLists.txt
+0
-34
source/dnode/vnode/src/vnd/CMakeLists.txt
source/dnode/vnode/src/vnd/CMakeLists.txt
+0
-24
source/dnode/vnode/src/vnd/vnodeFS.c
source/dnode/vnode/src/vnd/vnodeFS.c
+0
-16
source/dnode/vnode/src/vnd/vnodeMgr.c
source/dnode/vnode/src/vnd/vnodeMgr.c
+1
-1
source/dnode/vnode/src/vnd/vnodeRead.c
source/dnode/vnode/src/vnd/vnodeRead.c
+0
-16
source/dnode/vnode/src/vnd/vnodeRequest.c
source/dnode/vnode/src/vnd/vnodeRequest.c
+0
-119
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+0
-14
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
+6
-6
source/libs/tdb/src/inc/tdbBufPool.h
source/libs/tdb/src/inc/tdbBufPool.h
+12
-20
source/libs/tdb/src/inc/tdbDB.h
source/libs/tdb/src/inc/tdbDB.h
+19
-7
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
+7
-5
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
+5
-5
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/tkv/src/inc/tkvBufPool.h
source/libs/tkv/src/inc/tkvBufPool.h
+0
-39
未找到文件。
source/dnode/vnode/src/inc/vnodeDef.h
浏览文件 @
25617eca
...
...
@@ -30,12 +30,9 @@
#include "vnodeBufferPool.h"
#include "vnodeCfg.h"
#include "vnodeCommit.h"
#include "vnodeFS.h"
#include "vnodeMemAllocator.h"
#include "vnodeQuery.h"
#include "vnodeRequest.h"
#include "vnodeStateMgr.h"
#include "vnodeSync.h"
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -73,8 +70,6 @@ struct SVnode {
STsdb
*
pTsdb
;
STQ
*
pTq
;
SWal
*
pWal
;
SVnodeSync
*
pSync
;
SVnodeFS
*
pFs
;
tsem_t
canCommit
;
SQHandle
*
pQuery
;
SDnode
*
pDnode
;
...
...
@@ -84,6 +79,16 @@ int vnodeScheduleTask(SVnodeTask* task);
int32_t
vnodePutReqToVQueryQ
(
SVnode
*
pVnode
,
struct
SRpcMsg
*
pReq
);
// For Log
extern
int32_t
vDebugFlag
;
#define vFatal(...) do { if (vDebugFlag & DEBUG_FATAL) { taosPrintLog("TDB FATAL ", 255, __VA_ARGS__); }} while(0)
#define vError(...) do { if (vDebugFlag & DEBUG_ERROR) { taosPrintLog("TDB ERROR ", 255, __VA_ARGS__); }} while(0)
#define vWarn(...) do { if (vDebugFlag & DEBUG_WARN) { taosPrintLog("TDB WARN ", 255, __VA_ARGS__); }} while(0)
#define vInfo(...) do { if (vDebugFlag & DEBUG_INFO) { taosPrintLog("TDB ", 255, __VA_ARGS__); }} while(0)
#define vDebug(...) do { if (vDebugFlag & DEBUG_DEBUG) { taosPrintLog("TDB ", tsdbDebugFlag, __VA_ARGS__); }} while(0)
#define vTrace(...) do { if (vDebugFlag & DEBUG_TRACE) { taosPrintLog("TDB ", tsdbDebugFlag, __VA_ARGS__); }} while(0)
#ifdef __cplusplus
}
#endif
...
...
source/dnode/vnode/src/inc/vnodeMAF.h
已删除
100644 → 0
浏览文件 @
b4dee0f5
/*
* 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_MAF_H_
#define _TD_VNODE_MAF_H_
#include "vnode.h"
#ifdef __cplusplus
extern
"C"
{
#endif
int
vnodeOpenMAF
(
SVnode
*
pVnode
);
void
vnodeCloseMAF
(
SVnode
*
pVnode
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_VNODE_MAF_H_*/
\ No newline at end of file
source/dnode/vnode/src/inc/vnodeQuery.h
浏览文件 @
25617eca
...
...
@@ -19,12 +19,11 @@
#ifdef __cplusplus
extern
"C"
{
#endif
#include "vnodeInt.h"
#include "qworker.h"
#include "vnode.h"
typedef
struct
SQWorkerMgmt
SQHandle
;
int
vnodeQueryOpen
(
SVnode
*
pVnode
);
#ifdef __cplusplus
...
...
source/dnode/vnode/src/inc/vnodeRead.h
已删除
100644 → 0
浏览文件 @
b4dee0f5
/*
* 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_READ_H_
#define _TD_VNODE_READ_H_
#ifdef __cplusplus
extern
"C"
{
#endif
#include "vnodeInt.h"
void
vnodeProcessReadMsg
(
SVnode
*
pVnode
,
SVnodeMsg
*
pMsg
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_VNODE_READ_H_*/
source/dnode/vnode/src/meta/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
b4dee0f5
set
(
META_DB_IMPL_LIST
"BDB"
"SQLITE"
)
set
(
META_DB_IMPL
"BDB"
CACHE STRING
"Use BDB as the default META implementation"
)
set_property
(
CACHE META_DB_IMPL PROPERTY STRINGS
${
META_DB_IMPL_LIST
}
)
if
(
META_DB_IMPL IN_LIST META_DB_IMPL_LIST
)
message
(
STATUS
"META DB Impl:
${
META_DB_IMPL
}
=============="
)
else
()
message
(
FATAL_ERROR
"Invalid META DB IMPL:
${
META_DB_IMPL
}
=============="
)
endif
()
aux_source_directory
(
src META_SRC
)
if
(
${
META_DB_IMPL
}
STREQUAL
"BDB"
)
list
(
REMOVE_ITEM META_SRC
"src/metaSQLiteImpl.c"
)
elseif
(
${
META_DB_IMPL
}
STREQUAL
"SQLITE"
)
list
(
REMOVE_ITEM META_SRC
"src/metaBDBImpl.c"
)
endif
()
add_library
(
meta STATIC
${
META_SRC
}
)
target_include_directories
(
meta
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/dnode/vnode/meta"
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/libs/index"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
meta
PUBLIC common
PUBLIC index
)
if
(
${
META_DB_IMPL
}
STREQUAL
"BDB"
)
target_link_libraries
(
meta
PUBLIC bdb
)
elseif
(
${
META_DB_IMPL
}
STREQUAL
"SQLITE"
)
target_link_libraries
(
meta
PUBLIC sqlite
)
endif
()
if
(
${
BUILD_TEST
}
)
add_subdirectory
(
test
)
endif
(
${
BUILD_TEST
}
)
source/dnode/vnode/src/tq/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
b4dee0f5
aux_source_directory
(
src TQ_SRC
)
add_library
(
tq
${
TQ_SRC
}
)
target_include_directories
(
tq
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/dnode/vnode/tq"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
tq
PUBLIC wal
PUBLIC os
PUBLIC util
PUBLIC common
PUBLIC transport
)
if
(
${
BUILD_TEST
}
)
add_subdirectory
(
test
)
endif
(
${
BUILD_TEST
}
)
source/dnode/vnode/src/tsdb/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
b4dee0f5
aux_source_directory
(
src TSDB_SRC
)
if
(
0
)
add_library
(
tsdb
${
TSDB_SRC
}
)
else
(
0
)
add_library
(
tsdb STATIC
""
)
target_sources
(
tsdb
PRIVATE
"src/tsdbCommit.c"
"src/tsdbMain.c"
"src/tsdbMemTable.c"
"src/tsdbOptions.c"
"src/tsdbWrite.c"
"src/tsdbReadImpl.c"
"src/tsdbFile.c"
"src/tsdbFS.c"
"src/tsdbRead.c"
)
endif
(
0
)
target_include_directories
(
tsdb
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/dnode/vnode/tsdb"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
tsdb
PUBLIC os
PUBLIC util
PUBLIC common
PUBLIC tkv
PUBLIC tfs
PUBLIC meta
)
\ No newline at end of file
source/dnode/vnode/src/vnd/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
b4dee0f5
aux_source_directory
(
src VNODE_SRC
)
add_library
(
vnode STATIC
${
VNODE_SRC
}
)
target_include_directories
(
vnode
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/dnode/vnode"
private
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
vnode
PUBLIC os
PUBLIC transport
PUBLIC meta
PUBLIC tq
PUBLIC tsdb
PUBLIC wal
PUBLIC sync
PUBLIC cjson
PUBLIC qworker
)
# test
if
(
${
BUILD_TEST
}
)
# add_subdirectory(test)
endif
(
${
BUILD_TEST
}
)
source/dnode/vnode/src/vnd/vnodeFS.c
已删除
100644 → 0
浏览文件 @
b4dee0f5
/*
* 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/>.
*/
#include "vnodeDef.h"
\ No newline at end of file
source/dnode/vnode/src/vnd/vnodeMgr.c
浏览文件 @
25617eca
...
...
@@ -41,7 +41,7 @@ int vnodeInit(const SVnodeOpt *pOption) {
for
(
uint16_t
i
=
0
;
i
<
pOption
->
nthreads
;
i
++
)
{
pthread_create
(
&
(
vnodeMgr
.
threads
[
i
]),
NULL
,
loop
,
NULL
);
pthread_setname_np
(
vnodeMgr
.
threads
[
i
],
"VND Commit Thread"
);
//
pthread_setname_np(vnodeMgr.threads[i], "VND Commit Thread");
}
}
else
{
// TODO: if no commit thread is set, then another mechanism should be
...
...
source/dnode/vnode/src/vnd/vnodeRead.c
已删除
100644 → 0
浏览文件 @
b4dee0f5
/*
* 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/>.
*/
#include "vnodeDef.h"
\ No newline at end of file
source/dnode/vnode/src/vnd/vnodeRequest.c
已删除
100644 → 0
浏览文件 @
b4dee0f5
/*
* 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/>.
*/
#include "vnodeDef.h"
#if 0
static int vnodeBuildCreateTableReq(void **buf, const SVCreateTableReq *pReq);
static void *vnodeParseCreateTableReq(void *buf, SVCreateTableReq *pReq);
int vnodeBuildReq(void **buf, const SVnodeReq *pReq, tmsg_t type) {
int tsize = 0;
tsize += taosEncodeFixedU64(buf, pReq->ver);
switch (type) {
case TDMT_VND_CREATE_STB:
tsize += vnodeBuildCreateTableReq(buf, &(pReq->ctReq));
break;
case TDMT_VND_SUBMIT:
/* code */
break;
default:
break;
}
/* TODO */
return tsize;
}
void *vnodeParseReq(void *buf, SVnodeReq *pReq, tmsg_t type) {
buf = taosDecodeFixedU64(buf, &(pReq->ver));
switch (type) {
case TDMT_VND_CREATE_STB:
buf = vnodeParseCreateTableReq(buf, &(pReq->ctReq));
break;
default:
break;
}
// TODO
return buf;
}
static int vnodeBuildCreateTableReq(void **buf, const SVCreateTableReq *pReq) {
int tsize = 0;
tsize += taosEncodeString(buf, pReq->name);
tsize += taosEncodeFixedU32(buf, pReq->ttl);
tsize += taosEncodeFixedU32(buf, pReq->keep);
tsize += taosEncodeFixedU8(buf, pReq->type);
switch (pReq->type) {
case META_SUPER_TABLE:
tsize += taosEncodeFixedU64(buf, pReq->stbCfg.suid);
tsize += tdEncodeSchema(buf, pReq->stbCfg.pSchema);
tsize += tdEncodeSchema(buf, pReq->stbCfg.pTagSchema);
break;
case META_CHILD_TABLE:
tsize += taosEncodeFixedU64(buf, pReq->ctbCfg.suid);
tsize += tdEncodeKVRow(buf, pReq->ctbCfg.pTag);
break;
case META_NORMAL_TABLE:
tsize += tdEncodeSchema(buf, pReq->ntbCfg.pSchema);
break;
default:
break;
}
return tsize;
}
static void *vnodeParseCreateTableReq(void *buf, SVCreateTableReq *pReq) {
buf = taosDecodeString(buf, &(pReq->name));
buf = taosDecodeFixedU32(buf, &(pReq->ttl));
buf = taosDecodeFixedU32(buf, &(pReq->keep));
buf = taosDecodeFixedU8(buf, &(pReq->type));
switch (pReq->type) {
case META_SUPER_TABLE:
buf = taosDecodeFixedU64(buf, &(pReq->stbCfg.suid));
buf = tdDecodeSchema(buf, &(pReq->stbCfg.pSchema));
buf = tdDecodeSchema(buf, &(pReq->stbCfg.pTagSchema));
break;
case META_CHILD_TABLE:
buf = taosDecodeFixedU64(buf, &(pReq->ctbCfg.suid));
buf = tdDecodeKVRow(buf, &(pReq->ctbCfg.pTag));
break;
case META_NORMAL_TABLE:
buf = tdDecodeSchema(buf, &(pReq->ntbCfg.pSchema));
break;
default:
break;
}
return buf;
}
int vnodeBuildDropTableReq(void **buf, const SVDropTbReq *pReq) {
// TODO
return 0;
}
void *vnodeParseDropTableReq(void *buf, SVDropTbReq *pReq) {
// TODO
}
#endif
\ No newline at end of file
source/dnode/vnode/src/vnd/vnodeSync.c
已删除
100644 → 0
浏览文件 @
b4dee0f5
/*
* 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/CMakeLists.txt
浏览文件 @
25617eca
add_subdirectory
(
transport
)
add_subdirectory
(
sync
)
add_subdirectory
(
t
kv
)
add_subdirectory
(
t
db
)
add_subdirectory
(
index
)
add_subdirectory
(
wal
)
add_subdirectory
(
parser
)
...
...
source/libs/t
kv
/CMakeLists.txt
→
source/libs/t
db
/CMakeLists.txt
浏览文件 @
25617eca
aux_source_directory
(
src T
KV
_SRC
)
add_library
(
t
kv STATIC
${
TKV
_SRC
}
)
aux_source_directory
(
src T
DB
_SRC
)
add_library
(
t
db STATIC
${
TDB
_SRC
}
)
# target_include_directories(
# tkv
# PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/tkv"
# PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
# )
target_include_directories
(
t
kv
t
db
PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/inc"
)
target_link_libraries
(
t
kv
t
db
PUBLIC os
PUBLIC util
)
\ No newline at end of file
source/libs/t
kv/inc/tkv
.h
→
source/libs/t
db/inc/tdb
.h
浏览文件 @
25617eca
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_T
KV
_H_
#define _TD_T
KV
_H_
#ifndef _TD_T
DB
_H_
#define _TD_T
DB
_H_
#include "os.h"
...
...
@@ -28,7 +28,7 @@ typedef struct TDB_ENV TDB_ENV;
// SKey
typedef
struct
{
void
*
bdata
;
void
*
bdata
;
uint32_t
size
;
}
TDB_KEY
,
TDB_VALUE
;
...
...
@@ -36,4 +36,4 @@ typedef struct {
}
#endif
#endif
/*_TD_TKV_H_*/
\ No newline at end of file
#endif
/*_TD_TDB_H_*/
\ No newline at end of file
source/
dnode/vnode/src/inc/vnodeSync
.h
→
source/
libs/tdb/src/inc/tdbBtree
.h
浏览文件 @
25617eca
...
...
@@ -13,21 +13,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_
VNODE_SYNC
_H_
#define _TD_
VNODE_SYNC
_H_
#ifndef _TD_
TDB_BTREE
_H_
#define _TD_
TDB_BTREE
_H_
// #include "sync
.h"
#include "tkvDef
.h"
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
/* data */
}
SVnodeSync
;
pgid_t
root
;
// root page number
}
TDB_BTREE
;
#ifdef __cplusplus
}
#endif
#endif
/*_TD_VNODE_SYNC_H_*/
\ No newline at end of file
#endif
/*_TD_TDB_BTREE_H_*/
\ No newline at end of file
source/
dnode/vnode/src/inc/vnodeFS
.h
→
source/
libs/tdb/src/inc/tdbBufPool
.h
浏览文件 @
25617eca
...
...
@@ -13,35 +13,27 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_
VNODE_FS
_H_
#define _TD_
VNODE_FS
_H_
#ifndef _TD_
TDB_BUF_POOL
_H_
#define _TD_
TDB_BUF_POOL
_H_
#include "
vnod
e.h"
#include "
tdbPag
e.h"
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
}
SDir
;
typedef
struct
STdbBufPool
STdbBufPool
;
typedef
struct
{
}
SFile
;
typedef
struct
SFS
{
void
*
pImpl
;
int
(
*
startEdit
)(
struct
SFS
*
);
int
(
*
endEdit
)(
struct
SFS
*
);
}
SFS
;
typedef
struct
{
}
SVnodeFS
;
int
vnodeOpenFS
(
SVnode
*
pVnode
);
void
vnodeCloseFS
(
SVnode
*
pVnode
);
int
tbpOpen
(
STdbBufPool
**
ppTkvBufPool
);
int
tbpClose
(
STdbBufPool
*
pTkvBufPool
);
STdbPage
*
tbpNewPage
(
STdbBufPool
*
pTkvBufPool
);
int
tbpDelPage
(
STdbBufPool
*
pTkvBufPool
);
STdbPage
*
tbpFetchPage
(
STdbBufPool
*
pTkvBufPool
,
pgid_t
pgid
);
int
tbpUnpinPage
(
STdbBufPool
*
pTkvBufPool
,
pgid_t
pgid
);
void
tbpFlushPages
(
STdbBufPool
*
pTkvBufPool
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_VNODE_FS_H_*/
\ No newline at end of file
#endif
/*_TD_TDB_BUF_POOL_H_*/
\ No newline at end of file
source/
dnode/vnode/src/inc/vnodeRequest
.h
→
source/
libs/tdb/src/inc/tdbDB
.h
浏览文件 @
25617eca
...
...
@@ -13,21 +13,33 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_
VNODE_REQUEST
_H_
#define _TD_
VNODE_REQUEST
_H_
#ifndef _TD_
TDB_DB
_H_
#define _TD_
TDB_DB
_H_
#include "vnode.h"
#include "tdbBtree.h"
#include "tdbHash.h"
#ifdef __cplusplus
extern
"C"
{
#endif
// SVDropTbReq
// int vnodeBuildDropTableReq(void **buf, const SVDropTbReq *pReq);
// void *vnodeParseDropTableReq(void *buf, SVDropTbReq *pReq);
typedef
enum
{
TDB_BTREE
=
0
,
TDB_HASH
,
TDB_HEAP
,
}
tdb_db_t
;
struct
TDB
{
pgsize_t
pageSize
;
tdb_db_t
type
;
union
{
STkvBtree
btree
;
STkvhash
hash
;
}
dbimpl
;
};
#ifdef __cplusplus
}
#endif
#endif
/*_TD_VNODE_REQUEST_H_*/
\ No newline at end of file
#endif
/*_TD_TDB_DB_H_*/
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
Def.h
→
source/libs/t
db/src/inc/tdb
Def.h
浏览文件 @
25617eca
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_T
KV
_DEF_H_
#define _TD_T
KV
_DEF_H_
#ifndef _TD_T
DB
_DEF_H_
#define _TD_T
DB
_DEF_H_
#include "os.h"
...
...
@@ -39,4 +39,4 @@ typedef int32_t pgsize_t;
}
#endif
#endif
/*_TD_TKV_DEF_H_*/
\ No newline at end of file
#endif
/*_TD_TDB_DEF_H_*/
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
DiskMgr.h
→
source/libs/t
db/src/inc/tdb
DiskMgr.h
浏览文件 @
25617eca
...
...
@@ -22,7 +22,7 @@ extern "C" {
#include "os.h"
#include "t
kv
Def.h"
#include "t
db
Def.h"
typedef
struct
STkvDiskMgr
STkvDiskMgr
;
...
...
source/libs/t
kv/src/inc/tkv
Env.h
→
source/libs/t
db/src/inc/tdb
Env.h
浏览文件 @
25617eca
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_T
KV
_ENV_H_
#define _TD_T
KV
_ENV_H_
#ifndef _TD_T
DB
_ENV_H_
#define _TD_T
DB
_ENV_H_
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -28,4 +28,4 @@ struct TDB_ENV {
}
#endif
#endif
/*_TD_TKV_ENV_H_*/
\ No newline at end of file
#endif
/*_TD_TDB_ENV_H_*/
\ No newline at end of file
source/libs/t
kv/src/inc/tkvDB
.h
→
source/libs/t
db/src/inc/tdbHash
.h
浏览文件 @
25617eca
...
...
@@ -13,19 +13,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_TKV_DB_H_
#define _TD_TKV_DB_H_
#ifndef _TD_TKV_HAHS_H_
#define _TD_TKV_HAHS_H_
#include "tdbDef.h"
#ifdef __cplusplus
extern
"C"
{
#endif
struct
TDB
{
typedef
struct
{
// TODO
};
}
TDB_HASH
;
#ifdef __cplusplus
}
#endif
#endif
/*_TD_TKV_DB_H_*/
\ No newline at end of file
#endif
/*_TD_TKV_HAHS_H_*/
\ No newline at end of file
source/libs/t
kv/src/inc/tkv
Page.h
→
source/libs/t
db/src/inc/tdb
Page.h
浏览文件 @
25617eca
...
...
@@ -17,30 +17,24 @@
#define _TD_TKV_PAGE_H_
#include "os.h"
#include "t
kv
Def.h"
#include "t
db
Def.h"
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
STkvPage
{
typedef
struct
{
pgid_t
pgid
;
int32_t
pinCount
;
bool
idDirty
;
char
*
pData
;
}
ST
kv
Page
;
}
ST
db
Page
;
typedef
struct
{
uint16_t
dbver
;
uint16_t
pgsize
;
uint32_t
cksm
;
}
STkvPgHdr
;
// 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;
}
STdbPgHdr
;
#ifdef __cplusplus
}
...
...
source/libs/t
kv/src/tkv
BufPool.c
→
source/libs/t
db/src/tdb
BufPool.c
浏览文件 @
25617eca
...
...
@@ -16,17 +16,17 @@
#include "thash.h"
#include "tlist.h"
#include "t
kv
BufPool.h"
#include "t
kv
DiskMgr.h"
#include "t
kv
Page.h"
#include "t
db
BufPool.h"
#include "t
db
DiskMgr.h"
#include "t
db
Page.h"
struct
SFrameIdWrapper
{
TD_SLIST_NODE
(
SFrameIdWrapper
);
frame_id_t
id
;
};
struct
ST
kv
BufPool
{
ST
kv
Page
*
pages
;
struct
ST
db
BufPool
{
ST
db
Page
*
pages
;
STkvDiskMgr
*
pDiskMgr
;
SHashObj
*
pgTb
;
// page_id_t --> frame_id_t
TD_SLIST
(
SFrameIdWrapper
)
freeList
;
...
...
source/libs/t
kv/src/t
DiskMgr.c
→
source/libs/t
db/src/tdb
DiskMgr.c
浏览文件 @
25617eca
...
...
@@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "t
kv
DiskMgr.h"
#include "t
db
DiskMgr.h"
struct
STkvDiskMgr
{
char
*
fname
;
...
...
source/libs/t
kv
/test/tDiskMgrTest.cpp
→
source/libs/t
db
/test/tDiskMgrTest.cpp
浏览文件 @
25617eca
文件已移动
source/libs/t
kv
/test/tkvTests.cpp
→
source/libs/t
db
/test/tkvTests.cpp
浏览文件 @
25617eca
文件已移动
source/libs/tkv/src/inc/tkvBufPool.h
已删除
100644 → 0
浏览文件 @
b4dee0f5
/*
* 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_TKV_BUF_POOL_H_
#define _TD_TKV_BUF_POOL_H_
#include "tkvPage.h"
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
STkvBufPool
STkvBufPool
;
int
tbpOpen
(
STkvBufPool
**
ppTkvBufPool
);
int
tbpClose
(
STkvBufPool
*
pTkvBufPool
);
STkvPage
*
tbpNewPage
(
STkvBufPool
*
pTkvBufPool
);
int
tbpDelPage
(
STkvBufPool
*
pTkvBufPool
);
STkvPage
*
tbpFetchPage
(
STkvBufPool
*
pTkvBufPool
,
pgid_t
pgid
);
int
tbpUnpinPage
(
STkvBufPool
*
pTkvBufPool
,
pgid_t
pgid
);
void
tbpFlushPages
(
STkvBufPool
*
pTkvBufPool
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_TKV_BUF_POOL_H_*/
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录