Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b1a781cc
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看板
提交
b1a781cc
编写于
6月 04, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more progress
上级
0bc5300d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
88 addition
and
22 deletion
+88
-22
include/common/tdataformat.h
include/common/tdataformat.h
+7
-0
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+26
-0
source/dnode/vnode/src/tsdb/tsdbCommit2.c
source/dnode/vnode/src/tsdb/tsdbCommit2.c
+55
-0
source/dnode/vnode/src/tsdb/tsdbMemTable2.c
source/dnode/vnode/src/tsdb/tsdbMemTable2.c
+0
-22
未找到文件。
include/common/tdataformat.h
浏览文件 @
b1a781cc
...
@@ -34,6 +34,7 @@ typedef struct SValue SValue;
...
@@ -34,6 +34,7 @@ typedef struct SValue SValue;
typedef
struct
SColVal
SColVal
;
typedef
struct
SColVal
SColVal
;
typedef
struct
STSRow2
STSRow2
;
typedef
struct
STSRow2
STSRow2
;
typedef
struct
STSRowBuilder
STSRowBuilder
;
typedef
struct
STSRowBuilder
STSRowBuilder
;
typedef
struct
SColData
SColData
;
typedef
struct
STagVal
STagVal
;
typedef
struct
STagVal
STagVal
;
typedef
struct
STag
STag
;
typedef
struct
STag
STag
;
...
@@ -169,6 +170,12 @@ struct STag {
...
@@ -169,6 +170,12 @@ struct STag {
};
};
#pragma pack(pop)
#pragma pack(pop)
struct
SColData
{
int16_t
cid
;
uint32_t
nData
;
uint8_t
*
pData
;
};
#if 1 //================================================================================================================================================
#if 1 //================================================================================================================================================
// Imported since 3.0 and use bitmap to demonstrate None/Null/Norm, while use Null/Norm below 3.0 without of bitmap.
// Imported since 3.0 and use bitmap to demonstrate None/Null/Norm, while use Null/Norm below 3.0 without of bitmap.
#define TD_SUPPORT_BITMAP
#define TD_SUPPORT_BITMAP
...
...
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
b1a781cc
...
@@ -34,6 +34,7 @@ extern "C" {
...
@@ -34,6 +34,7 @@ extern "C" {
typedef
struct
TSDBROW
TSDBROW
;
typedef
struct
TSDBROW
TSDBROW
;
typedef
struct
TSDBKEY
TSDBKEY
;
typedef
struct
TSDBKEY
TSDBKEY
;
typedef
struct
TABLEID
TABLEID
;
typedef
struct
SDelOp
SDelOp
;
typedef
struct
SDelOp
SDelOp
;
static
int
tsdbKeyCmprFn
(
const
void
*
p1
,
const
void
*
p2
);
static
int
tsdbKeyCmprFn
(
const
void
*
p1
,
const
void
*
p2
);
...
@@ -883,6 +884,11 @@ struct TSDBKEY {
...
@@ -883,6 +884,11 @@ struct TSDBKEY {
TSKEY
ts
;
TSKEY
ts
;
};
};
struct
TABLEID
{
tb_uid_t
suid
;
tb_uid_t
uid
;
};
struct
SDelOp
{
struct
SDelOp
{
int64_t
version
;
int64_t
version
;
TSKEY
sKey
;
// included
TSKEY
sKey
;
// included
...
@@ -919,6 +925,26 @@ static FORCE_INLINE int tsdbKeyCmprFn(const void *p1, const void *p2) {
...
@@ -919,6 +925,26 @@ static FORCE_INLINE int tsdbKeyCmprFn(const void *p1, const void *p2) {
return
0
;
return
0
;
}
}
typedef
struct
SMemSkipListNode
SMemSkipListNode
;
typedef
struct
SMemSkipList
{
uint32_t
seed
;
int32_t
size
;
int8_t
maxLevel
;
int8_t
level
;
SMemSkipListNode
*
pHead
;
SMemSkipListNode
*
pTail
;
}
SMemSkipList
;
struct
SMemData
{
tb_uid_t
suid
;
tb_uid_t
uid
;
TSDBKEY
minKey
;
TSDBKEY
maxKey
;
SDelOp
*
delOpHead
;
SDelOp
*
delOpTail
;
SMemSkipList
sl
;
};
struct
SMemDataIter
{
struct
SMemDataIter
{
SMemData
*
pMemData
;
SMemData
*
pMemData
;
TSDBROW
row
;
TSDBROW
row
;
...
...
source/dnode/vnode/src/tsdb/tsdbCommit2.c
浏览文件 @
b1a781cc
...
@@ -88,6 +88,30 @@ static int32_t tsdbEndCommit(SCommitH *pCHandle) {
...
@@ -88,6 +88,30 @@ static int32_t tsdbEndCommit(SCommitH *pCHandle) {
return
code
;
return
code
;
}
}
static
int32_t
tsdbCommitTableData
(
SCommitH
*
pCHandle
,
SMemData
*
pMemData
,
SBlockIdx
*
pBlockIdx
)
{
int32_t
code
=
0
;
// TODO
return
code
;
}
static
int32_t
tsdbTableIdCmprFn
(
const
void
*
p1
,
const
void
*
p2
)
{
TABLEID
*
pId1
=
(
TABLEID
*
)
p1
;
TABLEID
*
pId2
=
(
TABLEID
*
)
p2
;
if
(
pId1
->
suid
<
pId2
->
suid
)
{
return
-
1
;
}
else
if
(
pId1
->
suid
>
pId2
->
suid
)
{
return
1
;
}
if
(
pId1
->
uid
<
pId2
->
uid
)
{
return
-
1
;
}
else
if
(
pId1
->
uid
>
pId2
->
uid
)
{
return
1
;
}
return
0
;
}
static
int32_t
tsdbCommitToFile
(
SCommitH
*
pCHandle
,
int32_t
fid
)
{
static
int32_t
tsdbCommitToFile
(
SCommitH
*
pCHandle
,
int32_t
fid
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
SMemDataIter
iter
=
{
0
};
SMemDataIter
iter
=
{
0
};
...
@@ -114,6 +138,8 @@ static int32_t tsdbCommitToFile(SCommitH *pCHandle, int32_t fid) {
...
@@ -114,6 +138,8 @@ static int32_t tsdbCommitToFile(SCommitH *pCHandle, int32_t fid) {
if
(
!
hasData
)
return
code
;
if
(
!
hasData
)
return
code
;
// create or open the file to commit(todo)
// loop to commit each table data
// loop to commit each table data
nBlockIdx
=
0
;
nBlockIdx
=
0
;
for
(;;)
{
for
(;;)
{
...
@@ -127,7 +153,36 @@ static int32_t tsdbCommitToFile(SCommitH *pCHandle, int32_t fid) {
...
@@ -127,7 +153,36 @@ static int32_t tsdbCommitToFile(SCommitH *pCHandle, int32_t fid) {
if
(
iBlockIdx
<
nBlockIdx
)
{
if
(
iBlockIdx
<
nBlockIdx
)
{
// pBlockIdx
// pBlockIdx
}
}
if
(
pMemData
&&
pBlockIdx
)
{
int32_t
c
=
tsdbTableIdCmprFn
(
&
(
TABLEID
){.
suid
=
pMemData
->
suid
,
.
uid
=
pMemData
->
uid
},
&
(
TABLEID
){.
suid
=
pBlockIdx
->
suid
,
.
uid
=
pBlockIdx
->
uid
});
if
(
c
==
0
)
{
iMemData
++
;
iBlockIdx
++
;
}
else
if
(
c
<
0
)
{
pBlockIdx
=
NULL
;
iMemData
++
;
}
else
{
pMemData
=
NULL
;
iBlockIdx
++
;
}
}
else
{
if
(
pMemData
)
{
iMemData
++
;
}
else
{
iBlockIdx
++
;
}
}
}
code
=
tsdbCommitTableData
(
pCHandle
,
pMemData
,
pBlockIdx
);
if
(
code
)
{
goto
_err
;
}
}
return
code
;
_err:
return
code
;
return
code
;
}
}
\ No newline at end of file
source/dnode/vnode/src/tsdb/tsdbMemTable2.c
浏览文件 @
b1a781cc
...
@@ -15,33 +15,11 @@
...
@@ -15,33 +15,11 @@
#include "tsdb.h"
#include "tsdb.h"
typedef
struct
SMemSkipList
SMemSkipList
;
typedef
struct
SMemSkipListNode
SMemSkipListNode
;
struct
SMemSkipListNode
{
struct
SMemSkipListNode
{
int8_t
level
;
int8_t
level
;
SMemSkipListNode
*
forwards
[
0
];
SMemSkipListNode
*
forwards
[
0
];
};
};
struct
SMemSkipList
{
uint32_t
seed
;
int32_t
size
;
int8_t
maxLevel
;
int8_t
level
;
SMemSkipListNode
*
pHead
;
SMemSkipListNode
*
pTail
;
};
struct
SMemData
{
tb_uid_t
suid
;
tb_uid_t
uid
;
TSDBKEY
minKey
;
TSDBKEY
maxKey
;
SDelOp
*
delOpHead
;
SDelOp
*
delOpTail
;
SMemSkipList
sl
;
};
typedef
struct
{
typedef
struct
{
tb_uid_t
uid
;
tb_uid_t
uid
;
STSchema
*
pTSchema
;
STSchema
*
pTSchema
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录