Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
电商架构修炼
TDengine
提交
7f4551db
TDengine
项目概览
电商架构修炼
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
7f4551db
编写于
9月 27, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact
上级
e7b97be7
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
85 addition
and
4 deletion
+85
-4
include/libs/tkv/tkv.h
include/libs/tkv/tkv.h
+35
-0
include/server/vnode/meta/meta.h
include/server/vnode/meta/meta.h
+5
-0
source/server/vnode/meta/CMakeLists.txt
source/server/vnode/meta/CMakeLists.txt
+4
-0
source/server/vnode/meta/inc/metaInt.h
source/server/vnode/meta/inc/metaInt.h
+4
-0
source/server/vnode/meta/src/meta.c
source/server/vnode/meta/src/meta.c
+36
-0
source/server/vnode/src/vnodeWrite.c
source/server/vnode/src/vnodeWrite.c
+1
-4
未找到文件。
include/libs/tkv/tkv.h
浏览文件 @
7f4551db
...
...
@@ -20,6 +20,41 @@
extern
"C"
{
#endif
typedef
struct
tkv_db_s
tkv_db_t
;
typedef
struct
{
/* data */
}
tkv_key_t
;
typedef
struct
{
bool
pinned
;
int64_t
ref
;
// TODO: use util library
// TODO: add a RW latch here
void
*
pObj
;
}
tkv_obj_t
;
typedef
int
(
*
tkv_key_comp_fn_t
)(
const
tkv_key_t
*
,
const
tkv_key_t
*
);
typedef
void
(
*
tkv_get_key_fn_t
)(
const
tkv_obj_t
*
,
tkv_key_t
*
);
typedef
int
(
*
tkv_obj_encode_fn_t
)(
void
**
buf
,
void
*
pObj
);
typedef
void
*
(
*
tkv_obj_decode_fn_t
)(
void
*
buf
,
void
**
pObj
);
typedef
struct
{
uint64_t
memLimit
:
63
;
tkv_get_key_fn_t
getKey
;
tkv_obj_encode_fn_t
encode
;
tkv_obj_decode_fn_t
decode
;
}
tkv_db_option_t
;
tkv_db_t
*
tkvOpenDB
(
char
*
dir
,
tkv_db_option_t
*
);
int
tkvCloseDB
(
tkv_db_t
*
);
int
tkvPut
(
tkv_db_t
*
,
tkv_obj_t
*
);
int
tkvPutBatch
(
tkv_db_t
*
,
tkv_obj_t
**
,
int
);
tkv_obj_t
*
tkvGet
(
tkv_key_t
*
);
int
tkvGetBatch
(
tkv_db_t
*
,
tkv_key_t
**
,
int
,
tkv_obj_t
**
);
int
tkvCommit
(
tkv_db_t
*
,
void
*
/*TODO*/
);
#ifdef __cplusplus
}
#endif
...
...
include/server/vnode/meta/meta.h
浏览文件 @
7f4551db
...
...
@@ -16,12 +16,17 @@
#ifndef _TD_META_H_
#define _TD_META_H_
#include "taosMsg.h"
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
SMeta
SMeta
;
int
metaCreateTable
(
SMeta
*
pMeta
,
SCreateTableReq
*
pReq
);
int
metaDropTable
(
SMeta
*
pMeta
,
SDropTableReq
*
pReq
);
int
metaAlterTable
(
SMeta
*
pMeta
,
SAlterTableReq
*
pReq
);
int
metaCommit
(
SMeta
*
pMeta
);
#ifdef __cplusplus
...
...
source/server/vnode/meta/CMakeLists.txt
浏览文件 @
7f4551db
...
...
@@ -5,3 +5,7 @@ target_include_directories(
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/server/vnode/meta"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
meta
PUBLIC common
)
\ No newline at end of file
source/server/vnode/meta/inc/metaInt.h
浏览文件 @
7f4551db
...
...
@@ -20,6 +20,10 @@
extern
"C"
{
#endif
struct
{
tkv_db_t
db
;
}
SMeta
;
#ifdef __cplusplus
}
#endif
...
...
source/server/vnode/meta/src/meta.c
浏览文件 @
7f4551db
/*
* 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 "meta.h"
int
metaCreateTable
(
SMeta
*
pMeta
,
SCreateTableReq
*
pReq
)
{
// TODO
return
0
;
}
int
metaDropTable
(
SMeta
*
pMeta
,
SDropTableReq
*
pReq
)
{
// TODO
return
0
;
}
int
metaAlterTable
(
SMeta
*
pMeta
,
SAlterTableReq
*
pReq
)
{
// TODO
return
0
;
}
int
metaCommit
(
SMeta
*
pMeta
)
{
// TODO
return
0
;
}
\ No newline at end of file
source/server/vnode/src/vnodeWrite.c
浏览文件 @
7f4551db
...
...
@@ -18,7 +18,6 @@
int
vnodeProcessSubmitReq
(
SVnode
*
pVnode
,
SSubmitReq
*
pReq
,
SSubmitRsp
*
pRsp
)
{
// TODO: Check inputs
#if 1
void
*
pMem
=
NULL
;
if
((
pMem
=
amalloc
(
pVnode
->
allocator
,
REQ_SIZE
(
pReq
)))
==
NULL
)
{
// No more memory to allocate, schedule an async commit
...
...
@@ -47,8 +46,6 @@ int vnodeProcessSubmitReq(SVnode *pVnode, SSubmitReq *pReq, SSubmitRsp *pRsp) {
// TODO: handler error
}
#endif
return
0
;
}
...
...
@@ -62,7 +59,7 @@ int vnodeProcessDropTableReq(SVnode *pVnode, SDropTableReq *pReq, SDropTableRsp
return
0
;
}
int
vnodeProcessAlterTableReq
(
SVnode
*
pVnode
,
S
DropTableReq
*
pReq
,
SDrop
TableRsp
*
pRsp
)
{
int
vnodeProcessAlterTableReq
(
SVnode
*
pVnode
,
S
AlterTableReq
*
pReq
,
SAlter
TableRsp
*
pRsp
)
{
// TODO
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录