Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fea6562a
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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,发现更多精彩内容 >>
提交
fea6562a
编写于
12月 25, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more
上级
5f0cf0ac
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
16 addition
and
47 deletion
+16
-47
include/dnode/vnode/meta/meta.h
include/dnode/vnode/meta/meta.h
+2
-33
source/dnode/vnode/impl/CMakeLists.txt
source/dnode/vnode/impl/CMakeLists.txt
+1
-1
source/dnode/vnode/impl/src/vnodeWrite.c
source/dnode/vnode/impl/src/vnodeWrite.c
+7
-7
source/dnode/vnode/meta/inc/metaTbCfg.h
source/dnode/vnode/meta/inc/metaTbCfg.h
+4
-4
source/dnode/vnode/meta/src/metaTable.c
source/dnode/vnode/meta/src/metaTable.c
+1
-1
source/dnode/vnode/meta/src/metaTbCfg.c
source/dnode/vnode/meta/src/metaTbCfg.c
+1
-1
未找到文件。
include/dnode/vnode/meta/meta.h
浏览文件 @
fea6562a
...
...
@@ -19,6 +19,7 @@
#include "mallocator.h"
#include "os.h"
#include "trow.h"
#include "tmsg.h"
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -36,39 +37,7 @@ typedef struct SMetaCfg {
uint64_t
lruSize
;
}
SMetaCfg
;
typedef
struct
STbCfg
{
/// name of the table
char
*
name
;
/// time to live of the table
uint32_t
ttl
;
/// keep time of this table
uint32_t
keep
;
/// type of table
uint8_t
type
;
union
{
/// super table configurations
struct
{
/// super table UID
tb_uid_t
suid
;
/// row schema
STSchema
*
pSchema
;
/// tag schema
STSchema
*
pTagSchema
;
}
stbCfg
;
/// normal table configuration
struct
{
/// row schema
STSchema
*
pSchema
;
}
ntbCfg
;
/// child table configuration
struct
{
/// super table UID
tb_uid_t
suid
;
SKVRow
pTag
;
}
ctbCfg
;
};
}
STbCfg
;
typedef
SVCreateTbReq
STbCfg
;
// SMeta operations
SMeta
*
metaOpen
(
const
char
*
path
,
const
SMetaCfg
*
pMetaCfg
,
SMemAllocatorFactory
*
pMAF
);
...
...
source/dnode/vnode/impl/CMakeLists.txt
浏览文件 @
fea6562a
...
...
@@ -20,5 +20,5 @@ target_link_libraries(
# test
if
(
${
BUILD_TEST
}
)
add_subdirectory
(
test
)
#
add_subdirectory(test)
endif
(
${
BUILD_TEST
}
)
source/dnode/vnode/impl/src/vnodeWrite.c
浏览文件 @
fea6562a
...
...
@@ -51,8 +51,9 @@ int vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs) {
}
int
vnodeApplyWMsg
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
,
SRpcMsg
**
pRsp
)
{
SVnodeReq
vReq
;
void
*
ptr
=
vnodeMalloc
(
pVnode
,
pMsg
->
contLen
);
SVnodeReq
vReq
;
SVCreateTbReq
vCreateTbReq
;
void
*
ptr
=
vnodeMalloc
(
pVnode
,
pMsg
->
contLen
);
if
(
ptr
==
NULL
)
{
// TODO: handle error
}
...
...
@@ -62,17 +63,15 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
// todo: change the interface here
uint64_t
ver
;
taosDecodeFixedU64
(
pMsg
->
pCont
,
&
ver
);
taosDecodeFixedU64
(
POINTER_SHIFT
(
pMsg
->
pCont
,
sizeof
(
SMsgHead
))
,
&
ver
);
if
(
tqPushMsg
(
pVnode
->
pTq
,
ptr
,
ver
)
<
0
)
{
// TODO: handle error
}
vnodeParseReq
(
pMsg
->
pCont
,
&
vReq
,
pMsg
->
msgType
);
switch
(
pMsg
->
msgType
)
{
case
TDMT_VND_CREATE_STB
:
case
TDMT_MND_CREATE_TABLE
:
if
(
metaCreateTable
(
pVnode
->
pMeta
,
&
(
v
Req
.
ct
Req
))
<
0
)
{
tDeserializeSVCreateTbReq
(
POINTER_SHIFT
(
pMsg
->
pCont
,
sizeof
(
SMsgHead
)),
&
vCreateTbReq
);
if
(
metaCreateTable
(
pVnode
->
pMeta
,
&
(
v
CreateTb
Req
))
<
0
)
{
// TODO: handle error
}
...
...
@@ -90,6 +89,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
}
break
;
default:
ASSERT
(
0
);
break
;
}
...
...
source/dnode/vnode/meta/inc/metaTbCfg.h
浏览文件 @
fea6562a
...
...
@@ -22,11 +22,11 @@
extern
"C"
{
#endif
#define META_SUPER_TABLE
0
#define META_CHILD_TABLE
1
#define META_NORMAL_TABLE
2
#define META_SUPER_TABLE
TD_SUPER_TABLE
#define META_CHILD_TABLE
TD_CHILD_TABLE
#define META_NORMAL_TABLE
TD_NORMAL_TABLE
int
metaValidateTb
Options
(
SMeta
*
pMeta
,
const
STbCfg
*
);
int
metaValidateTb
Cfg
(
SMeta
*
pMeta
,
const
STbCfg
*
);
size_t
metaEncodeTbObjFromTbOptions
(
const
STbCfg
*
,
void
*
pBuf
,
size_t
bsize
);
#ifdef __cplusplus
...
...
source/dnode/vnode/meta/src/metaTable.c
浏览文件 @
fea6562a
...
...
@@ -17,7 +17,7 @@
int
metaCreateTable
(
SMeta
*
pMeta
,
STbCfg
*
pTbCfg
)
{
// Validate the tbOptions
if
(
metaValidateTb
Options
(
pMeta
,
pTbCfg
)
<
0
)
{
if
(
metaValidateTb
Cfg
(
pMeta
,
pTbCfg
)
<
0
)
{
// TODO: handle error
return
-
1
;
}
...
...
source/dnode/vnode/meta/src/metaTbCfg.c
浏览文件 @
fea6562a
...
...
@@ -16,7 +16,7 @@
#include "metaDef.h"
#include "tcoding.h"
int
metaValidateTb
Options
(
SMeta
*
pMeta
,
const
STbCfg
*
pTbOptions
)
{
int
metaValidateTb
Cfg
(
SMeta
*
pMeta
,
const
STbCfg
*
pTbOptions
)
{
// TODO
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录