Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fe368d0f
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看板
提交
fe368d0f
编写于
4月 16, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact vnode
上级
2ad1f30f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
9 addition
and
23 deletion
+9
-23
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+0
-1
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+0
-8
source/dnode/vnode/src/inc/meta.h
source/dnode/vnode/src/inc/meta.h
+1
-2
source/dnode/vnode/src/inc/tq.h
source/dnode/vnode/src/inc/tq.h
+1
-3
source/dnode/vnode/src/meta/metaMain.c
source/dnode/vnode/src/meta/metaMain.c
+4
-4
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+1
-3
source/dnode/vnode/src/vnd/vnodeOpen.c
source/dnode/vnode/src/vnd/vnodeOpen.c
+2
-2
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
fe368d0f
...
...
@@ -96,7 +96,6 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
pCfg
->
tsdbCfg
.
keep1
=
pCreate
->
daysToKeep0
;
pCfg
->
tsdbCfg
.
lruCacheSize
=
pCreate
->
cacheBlockSize
;
pCfg
->
tsdbCfg
.
retentions
=
pCreate
->
pRetensions
;
pCfg
->
metaCfg
.
lruSize
=
pCreate
->
cacheBlockSize
;
pCfg
->
walCfg
.
level
=
TAOS_WAL_WRITE
;
pCfg
->
walCfg
.
fsyncPeriod
=
0
;
pCfg
->
walCfg
.
retentionPeriod
=
0
;
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
fe368d0f
...
...
@@ -37,9 +37,7 @@ extern "C" {
// vnode
typedef
struct
SVnode
SVnode
;
typedef
struct
SMetaCfg
SMetaCfg
;
// todo: remove
typedef
struct
STsdbCfg
STsdbCfg
;
// todo: remove
typedef
struct
STqCfg
STqCfg
;
// todo: remove
typedef
struct
SVnodeCfg
SVnodeCfg
;
int
vnodeInit
(
int
nthreads
);
...
...
@@ -134,10 +132,6 @@ struct STsdbCfg {
SArray
*
retentions
;
};
struct
STqCfg
{
int32_t
reserved
;
};
struct
SVnodeCfg
{
int32_t
vgId
;
uint64_t
dbId
;
...
...
@@ -151,8 +145,6 @@ struct SVnodeCfg {
int8_t
streamMode
;
bool
isWeak
;
STsdbCfg
tsdbCfg
;
SMetaCfg
metaCfg
;
STqCfg
tqCfg
;
SWalCfg
walCfg
;
SMsgCb
msgCb
;
uint32_t
hashBegin
;
...
...
source/dnode/vnode/src/inc/meta.h
浏览文件 @
fe368d0f
...
...
@@ -40,7 +40,7 @@ typedef struct SMSmaCursor SMSmaCursor;
#define META_CHILD_TABLE TD_CHILD_TABLE
#define META_NORMAL_TABLE TD_NORMAL_TABLE
SMeta
*
metaOpen
(
const
char
*
path
,
const
SMetaCfg
*
pMetaCfg
,
SMemAllocatorFactory
*
pMAF
);
SMeta
*
metaOpen
(
const
char
*
path
,
SMemAllocatorFactory
*
pMAF
);
void
metaClose
(
SMeta
*
pMeta
);
void
metaRemove
(
const
char
*
path
);
int
metaCreateTable
(
SMeta
*
pMeta
,
STbCfg
*
pTbCfg
);
...
...
@@ -97,7 +97,6 @@ tb_uid_t metaGenerateUid(SMeta* pMeta);
struct
SMeta
{
char
*
path
;
SVnode
*
pVnode
;
SMetaCfg
options
;
SMetaDB
*
pDB
;
SMetaIdx
*
pIdx
;
SMetaCache
*
pCache
;
...
...
source/dnode/vnode/src/inc/tq.h
浏览文件 @
fe368d0f
...
...
@@ -160,7 +160,6 @@ struct STQ {
// the handle of meta kvstore
bool
writeTrigger
;
char
*
path
;
STqCfg
*
tqConfig
;
STqMemRef
tqMemRef
;
STqMetaStore
*
tqMeta
;
// STqPushMgr* tqPushMgr;
...
...
@@ -251,8 +250,7 @@ int tqInit();
void
tqCleanUp
();
// open in each vnode
STQ
*
tqOpen
(
const
char
*
path
,
SVnode
*
pVnode
,
SWal
*
pWal
,
SMeta
*
pMeta
,
STqCfg
*
tqConfig
,
SMemAllocatorFactory
*
allocFac
);
STQ
*
tqOpen
(
const
char
*
path
,
SVnode
*
pVnode
,
SWal
*
pWal
,
SMeta
*
pMeta
,
SMemAllocatorFactory
*
allocFac
);
void
tqClose
(
STQ
*
);
// required by vnode
int
tqPushMsg
(
STQ
*
,
void
*
msg
,
int32_t
msgLen
,
tmsg_t
msgType
,
int64_t
version
);
...
...
source/dnode/vnode/src/meta/metaMain.c
浏览文件 @
fe368d0f
...
...
@@ -17,16 +17,16 @@
#include "vnodeInt.h"
static
SMeta
*
metaNew
(
const
char
*
path
,
const
SMetaCfg
*
pMetaCfg
,
SMemAllocatorFactory
*
pMAF
);
static
SMeta
*
metaNew
(
const
char
*
path
,
SMemAllocatorFactory
*
pMAF
);
static
void
metaFree
(
SMeta
*
pMeta
);
static
int
metaOpenImpl
(
SMeta
*
pMeta
);
static
void
metaCloseImpl
(
SMeta
*
pMeta
);
SMeta
*
metaOpen
(
const
char
*
path
,
const
SMetaCfg
*
pMetaCfg
,
SMemAllocatorFactory
*
pMAF
)
{
SMeta
*
metaOpen
(
const
char
*
path
,
SMemAllocatorFactory
*
pMAF
)
{
SMeta
*
pMeta
=
NULL
;
// Allocate handle
pMeta
=
metaNew
(
path
,
pM
etaCfg
,
pM
AF
);
pMeta
=
metaNew
(
path
,
pMAF
);
if
(
pMeta
==
NULL
)
{
// TODO: handle error
return
NULL
;
...
...
@@ -54,7 +54,7 @@ void metaClose(SMeta *pMeta) {
void
metaRemove
(
const
char
*
path
)
{
taosRemoveDir
(
path
);
}
/* ------------------------ STATIC METHODS ------------------------ */
static
SMeta
*
metaNew
(
const
char
*
path
,
const
SMetaCfg
*
pMetaCfg
,
SMemAllocatorFactory
*
pMAF
)
{
static
SMeta
*
metaNew
(
const
char
*
path
,
SMemAllocatorFactory
*
pMAF
)
{
SMeta
*
pMeta
;
size_t
psize
=
strlen
(
path
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
fe368d0f
...
...
@@ -19,15 +19,13 @@ int32_t tqInit() { return tqPushMgrInit(); }
void
tqCleanUp
()
{
tqPushMgrCleanUp
();
}
STQ
*
tqOpen
(
const
char
*
path
,
SVnode
*
pVnode
,
SWal
*
pWal
,
SMeta
*
pVnodeMeta
,
STqCfg
*
tqConfig
,
SMemAllocatorFactory
*
allocFac
)
{
STQ
*
tqOpen
(
const
char
*
path
,
SVnode
*
pVnode
,
SWal
*
pWal
,
SMeta
*
pVnodeMeta
,
SMemAllocatorFactory
*
allocFac
)
{
STQ
*
pTq
=
taosMemoryMalloc
(
sizeof
(
STQ
));
if
(
pTq
==
NULL
)
{
terrno
=
TSDB_CODE_TQ_OUT_OF_MEMORY
;
return
NULL
;
}
pTq
->
path
=
strdup
(
path
);
pTq
->
tqConfig
=
tqConfig
;
pTq
->
pVnode
=
pVnode
;
pTq
->
pWal
=
pWal
;
pTq
->
pVnodeMeta
=
pVnodeMeta
;
...
...
source/dnode/vnode/src/vnd/vnodeOpen.c
浏览文件 @
fe368d0f
...
...
@@ -132,7 +132,7 @@ static int vnodeOpenImpl(SVnode *pVnode) {
// Open meta
sprintf
(
dir
,
"%s/meta"
,
pVnode
->
path
);
pVnode
->
pMeta
=
metaOpen
(
dir
,
&
(
pVnode
->
config
.
metaCfg
),
vBufPoolGetMAF
(
pVnode
));
pVnode
->
pMeta
=
metaOpen
(
dir
,
vBufPoolGetMAF
(
pVnode
));
if
(
pVnode
->
pMeta
==
NULL
)
{
// TODO: handle error
return
-
1
;
...
...
@@ -157,7 +157,7 @@ static int vnodeOpenImpl(SVnode *pVnode) {
// Open TQ
sprintf
(
dir
,
"%s/tq"
,
pVnode
->
path
);
pVnode
->
pTq
=
tqOpen
(
dir
,
pVnode
,
pVnode
->
pWal
,
pVnode
->
pMeta
,
&
(
pVnode
->
config
.
tqCfg
),
vBufPoolGetMAF
(
pVnode
));
pVnode
->
pTq
=
tqOpen
(
dir
,
pVnode
,
pVnode
->
pWal
,
pVnode
->
pMeta
,
vBufPoolGetMAF
(
pVnode
));
if
(
pVnode
->
pTq
==
NULL
)
{
// TODO: handle error
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录