Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bdb0a307
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看板
未验证
提交
bdb0a307
编写于
1月 13, 2022
作者:
H
Hongze Cheng
提交者:
GitHub
1月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9787 from taosdata/feature/vnode
Feature/vnode
上级
25617eca
a20724f4
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
40 addition
and
71 deletion
+40
-71
source/dnode/mgmt/impl/src/dndEnv.c
source/dnode/mgmt/impl/src/dndEnv.c
+1
-1
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+0
-18
source/dnode/vnode/src/vnd/vnodeWrite.c
source/dnode/vnode/src/vnd/vnodeWrite.c
+1
-0
source/libs/tdb/CMakeLists.txt
source/libs/tdb/CMakeLists.txt
+5
-1
source/libs/tdb/inc/tdb.h
source/libs/tdb/inc/tdb.h
+13
-2
source/libs/tdb/src/inc/tdbDB.h
source/libs/tdb/src/inc/tdbDB.h
+3
-8
source/libs/tdb/src/inc/tdbEnv.h
source/libs/tdb/src/inc/tdbEnv.h
+0
-31
source/libs/tdb/test/CMakeLists.txt
source/libs/tdb/test/CMakeLists.txt
+3
-0
source/libs/tdb/test/tDiskMgrTest.cpp
source/libs/tdb/test/tDiskMgrTest.cpp
+0
-10
source/libs/tdb/test/tdbTest.cpp
source/libs/tdb/test/tdbTest.cpp
+14
-0
source/libs/tdb/test/tkvTests.cpp
source/libs/tdb/test/tkvTests.cpp
+0
-0
未找到文件。
source/dnode/mgmt/impl/src/dndEnv.c
浏览文件 @
bdb0a307
...
...
@@ -293,7 +293,7 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) {
if
(
vnodeInit
(
&
vnodeOpt
)
!=
0
)
{
dError
(
"failed to init vnode since %s"
,
terrstr
());
dndCleanup
();
return
NULL
;
return
-
1
;
}
memcpy
(
&
dndEnv
.
cfg
,
pCfg
,
sizeof
(
SDnodeEnvCfg
));
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
bdb0a307
...
...
@@ -37,36 +37,18 @@ typedef int32_t (*PutReqToVQueryQFp)(SDnode *pDnode, struct SRpcMsg *pReq);
typedef
struct
SVnodeCfg
{
int32_t
vgId
;
SDnode
*
pDnode
;
/** vnode buffer pool options */
struct
{
/** write buffer size */
uint64_t
wsize
;
uint64_t
ssize
;
uint64_t
lsize
;
/** use heap allocator or arena allocator */
bool
isHeapAllocator
;
};
/** time to live of tables in this vnode */
uint32_t
ttl
;
/** data to keep in this vnode */
uint32_t
keep
;
/** if TS data is eventually consistency */
bool
isWeak
;
/** TSDB config */
STsdbCfg
tsdbCfg
;
/** META config */
SMetaCfg
metaCfg
;
/** TQ config */
STqCfg
tqCfg
;
/** WAL config */
SWalCfg
walCfg
;
}
SVnodeCfg
;
...
...
source/dnode/vnode/src/vnd/vnodeWrite.c
浏览文件 @
bdb0a307
...
...
@@ -83,6 +83,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
if
(
metaCreateTable
(
pVnode
->
pMeta
,
pCreateTbReq
)
<
0
)
{
// TODO: handle error
}
vTrace
(
"vgId:%d process create table %s"
,
pVnode
->
vgId
,
pCreateTbReq
->
name
);
if
(
pCreateTbReq
->
type
==
TD_SUPER_TABLE
)
{
free
(
pCreateTbReq
->
stbCfg
.
pSchema
);
free
(
pCreateTbReq
->
stbCfg
.
pTagSchema
);
...
...
source/libs/tdb/CMakeLists.txt
浏览文件 @
bdb0a307
...
...
@@ -14,4 +14,8 @@ target_link_libraries(
tdb
PUBLIC os
PUBLIC util
)
\ No newline at end of file
)
if
(
${
BUILD_TEST
}
)
# add_subdirectory(test)
endif
(
${
BUILD_TEST
}
)
source/libs/tdb/inc/tdb.h
浏览文件 @
bdb0a307
...
...
@@ -22,9 +22,15 @@
extern
"C"
{
#endif
typedef
enum
{
TDB_BTREE
=
0
,
TDB_HASH
,
TDB_HEAP
,
}
tdb_db_t
;
// Forward declaration
typedef
struct
TDB
TDB
;
typedef
struct
TDB_
ENV
TDB_ENV
;
typedef
struct
TDB
TDB
;
typedef
struct
TDB_
CURSOR
TDB_CURSOR
;
// SKey
typedef
struct
{
...
...
@@ -32,6 +38,11 @@ typedef struct {
uint32_t
size
;
}
TDB_KEY
,
TDB_VALUE
;
// TDB Operations
int
tdbCreateDB
(
TDB
**
dbpp
);
int
tdbOpenDB
(
TDB
*
dbp
,
tdb_db_t
type
,
uint32_t
flags
);
int
tdbCloseDB
(
TDB
*
dbp
,
uint32_t
flags
);
#ifdef __cplusplus
}
#endif
...
...
source/libs/tdb/src/inc/tdbDB.h
浏览文件 @
bdb0a307
...
...
@@ -23,19 +23,14 @@
extern
"C"
{
#endif
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
;
}
db
impl
;
TDB_BTREE
btree
;
TDB_HASH
hash
;
}
db
am
;
// Different access methods
};
#ifdef __cplusplus
...
...
source/libs/tdb/src/inc/tdbEnv.h
已删除
100644 → 0
浏览文件 @
25617eca
/*
* 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_ENV_H_
#define _TD_TDB_ENV_H_
#ifdef __cplusplus
extern
"C"
{
#endif
struct
TDB_ENV
{
char
*
homeDir
;
};
#ifdef __cplusplus
}
#endif
#endif
/*_TD_TDB_ENV_H_*/
\ No newline at end of file
source/libs/tdb/test/CMakeLists.txt
0 → 100644
浏览文件 @
bdb0a307
# tdbTest
add_executable
(
tdbTest
"tdbTest.cpp"
)
target_link_libraries
(
tdbTest tdb gtest gtest_main
)
\ No newline at end of file
source/libs/tdb/test/tDiskMgrTest.cpp
已删除
100644 → 0
浏览文件 @
25617eca
#include "gtest/gtest.h"
#include "iostream"
#include "tDiskMgr.h"
TEST
(
tDiskMgrTest
,
simple_test
)
{
// TODO
std
::
cout
<<
"This is in tDiskMgrTest::simple_test"
<<
std
::
endl
;
}
\ No newline at end of file
source/libs/tdb/test/tdbTest.cpp
0 → 100644
浏览文件 @
bdb0a307
#include "gtest/gtest.h"
#include "tdb.h"
TEST
(
tdb_api_test
,
tdb_create_open_close_db_test
)
{
int
ret
;
TDB
*
dbp
;
tdbCreateDB
(
&
dbp
);
tdbOpenDB
(
dbp
,
TDB_BTREE
,
0
);
tdbCloseDB
(
dbp
,
0
);
}
\ No newline at end of file
source/libs/tdb/test/tkvTests.cpp
已删除
100644 → 0
浏览文件 @
25617eca
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录