Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e42f0280
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
e42f0280
编写于
11月 01, 2021
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine tq meta interface
上级
6d55ee00
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
14 deletion
+14
-14
source/server/vnode/tq/inc/tqMetaStore.h
source/server/vnode/tq/inc/tqMetaStore.h
+6
-10
source/server/vnode/tq/src/tqMetaStore.c
source/server/vnode/tq/src/tqMetaStore.c
+8
-4
未找到文件。
source/server/vnode/tq/inc/tqMetaStore.h
浏览文件 @
e42f0280
...
...
@@ -61,19 +61,15 @@ int32_t tqStoreClose(TqMetaStore*);
//int32_t TqStoreCommitAll(TqMetaStore*);
int32_t
tqStorePersist
(
TqMetaStore
*
);
TqMetaHandle
*
tqHandleGetInUse
(
TqMetaStore
*
,
int64_t
key
);
int32_t
tqHandlePutInUse
(
TqMetaStore
*
,
int64_t
key
,
void
*
value
);
TqMetaHandle
*
tqHandleGetInTxn
(
TqMetaStore
*
,
int64_t
key
);
int32_t
tqHandlePutInTxn
(
TqMetaStore
*
,
int64_t
key
,
void
*
value
);
//will replace old handle
//int32_t tqHandlePut(TqMetaStore*, TqMetaHandle* handle);
//delete in-use-handle, and put it in use
TqMetaHandle
*
tqHandleGet
(
TqMetaStore
*
,
int64_t
key
);
int32_t
tqHandlePut
(
TqMetaStore
*
,
int64_t
key
,
void
*
value
);
//do commit
int32_t
tqHandleCommit
(
TqMetaStore
*
,
int64_t
key
);
//delete
in-txn-handle
//delete
uncommitted
int32_t
tqHandleAbort
(
TqMetaStore
*
,
int64_t
key
);
//delete
in-use-handle
//delete
committed
int32_t
tqHandleDel
(
TqMetaStore
*
,
int64_t
key
);
//delete
in-use-handle and in-txn-handle
//delete
both committed and uncommitted
int32_t
tqHandleClear
(
TqMetaStore
*
,
int64_t
key
);
#ifdef __cplusplus
...
...
source/server/vnode/tq/src/tqMetaStore.c
浏览文件 @
e42f0280
...
...
@@ -22,6 +22,10 @@
#define TQ_META_NAME "tq.meta"
#define TQ_IDX_NAME "tq.idx"
static
int32_t
tqHandlePutCommitted
(
TqMetaStore
*
,
int64_t
key
,
void
*
value
);
static
TqMetaHandle
*
tqHandleGetUncommitted
(
TqMetaStore
*
,
int64_t
key
);
typedef
struct
TqMetaPageBuf
{
int16_t
offset
;
char
buffer
[
TQ_PAGE_SIZE
];
...
...
@@ -138,7 +142,7 @@ int32_t tqStorePersist(TqMetaStore* pMeta) {
return
0
;
}
int32_t
tqHandlePutInUse
(
TqMetaStore
*
pMeta
,
int64_t
key
,
void
*
value
)
{
static
int32_t
tqHandlePutCommitted
(
TqMetaStore
*
pMeta
,
int64_t
key
,
void
*
value
)
{
int64_t
bucketKey
=
key
&
TQ_BUCKET_SIZE
;
TqMetaList
*
pNode
=
pMeta
->
bucket
[
bucketKey
];
while
(
pNode
)
{
...
...
@@ -154,7 +158,7 @@ int32_t tqHandlePutInUse(TqMetaStore* pMeta, int64_t key, void* value) {
return
0
;
}
TqMetaHandle
*
tqHandleGet
InUse
(
TqMetaStore
*
pMeta
,
int64_t
key
)
{
TqMetaHandle
*
tqHandleGet
(
TqMetaStore
*
pMeta
,
int64_t
key
)
{
int64_t
bucketKey
=
key
&
TQ_BUCKET_SIZE
;
TqMetaList
*
pNode
=
pMeta
->
bucket
[
bucketKey
];
while
(
pNode
)
{
...
...
@@ -171,7 +175,7 @@ TqMetaHandle* tqHandleGetInUse(TqMetaStore* pMeta, int64_t key) {
return
NULL
;
}
int32_t
tqHandlePut
InTxn
(
TqMetaStore
*
pMeta
,
int64_t
key
,
void
*
value
)
{
int32_t
tqHandlePut
(
TqMetaStore
*
pMeta
,
int64_t
key
,
void
*
value
)
{
int64_t
bucketKey
=
key
&
TQ_BUCKET_SIZE
;
TqMetaList
*
pNode
=
pMeta
->
bucket
[
bucketKey
];
while
(
pNode
)
{
...
...
@@ -187,7 +191,7 @@ int32_t tqHandlePutInTxn(TqMetaStore* pMeta, int64_t key, void* value) {
return
0
;
}
TqMetaHandle
*
tqHandleGetInTxn
(
TqMetaStore
*
pMeta
,
int64_t
key
)
{
static
TqMetaHandle
*
tqHandleGetUncommitted
(
TqMetaStore
*
pMeta
,
int64_t
key
)
{
int64_t
bucketKey
=
key
&
TQ_BUCKET_SIZE
;
TqMetaList
*
pNode
=
pMeta
->
bucket
[
bucketKey
];
while
(
pNode
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录