Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a53575a1
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a53575a1
编写于
9月 27, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
a4d16f1c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
6 deletion
+31
-6
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+12
-1
source/dnode/vnode/src/tsdb/tsdbDiskData.c
source/dnode/vnode/src/tsdb/tsdbDiskData.c
+19
-5
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
a53575a1
...
@@ -328,7 +328,8 @@ int32_t tDiskDataBuilderInit(SDiskDataBuilder *pBuilder, STSchema *pTSchema, TAB
...
@@ -328,7 +328,8 @@ int32_t tDiskDataBuilderInit(SDiskDataBuilder *pBuilder, STSchema *pTSchema, TAB
uint8_t
calcSma
);
uint8_t
calcSma
);
int32_t
tDiskDataBuilderClear
(
SDiskDataBuilder
*
pBuilder
);
int32_t
tDiskDataBuilderClear
(
SDiskDataBuilder
*
pBuilder
);
int32_t
tDiskDataAddRow
(
SDiskDataBuilder
*
pBuilder
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
,
TABLEID
*
pId
);
int32_t
tDiskDataAddRow
(
SDiskDataBuilder
*
pBuilder
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
,
TABLEID
*
pId
);
int32_t
tGnrtDiskData
(
SDiskDataBuilder
*
pBuilder
,
const
SDiskData
**
ppDiskData
);
int32_t
tGnrtDiskData
(
SDiskDataBuilder
*
pBuilder
,
const
SDiskData
**
ppDiskData
,
const
SBlkInfo
*
pBlkInfo
);
int32_t
tGnrtDiskData
(
SDiskDataBuilder
*
pBuilder
,
const
SDiskData
**
ppDiskData
,
const
SBlkInfo
**
ppBlkInfo
);
// structs =======================
// structs =======================
struct
STsdbFS
{
struct
STsdbFS
{
...
@@ -450,6 +451,15 @@ struct SSmaInfo {
...
@@ -450,6 +451,15 @@ struct SSmaInfo {
int32_t
size
;
int32_t
size
;
};
};
typedef
struct
{
int64_t
minUid
;
int64_t
maxUid
;
TSDBKEY
minKey
;
TSDBKEY
maxKey
;
int64_t
minVer
;
int64_t
maxVer
;
}
SBlkInfo
;
struct
SDataBlk
{
struct
SDataBlk
{
TSDBKEY
minKey
;
TSDBKEY
minKey
;
TSDBKEY
maxKey
;
TSDBKEY
maxKey
;
...
@@ -702,6 +712,7 @@ struct SDiskDataBuilder {
...
@@ -702,6 +712,7 @@ struct SDiskDataBuilder {
SArray
*
aBuilder
;
// SArray<SDiskColBuilder>
SArray
*
aBuilder
;
// SArray<SDiskColBuilder>
uint8_t
*
aBuf
[
2
];
uint8_t
*
aBuf
[
2
];
SDiskData
dd
;
SDiskData
dd
;
SBlkInfo
bi
;
};
};
int32_t
tMergeTreeOpen
(
SMergeTree
*
pMTree
,
int8_t
backward
,
SDataFReader
*
pFReader
,
uint64_t
suid
,
uint64_t
uid
,
int32_t
tMergeTreeOpen
(
SMergeTree
*
pMTree
,
int8_t
backward
,
SDataFReader
*
pFReader
,
uint64_t
suid
,
uint64_t
uid
,
...
...
source/dnode/vnode/src/tsdb/tsdbDiskData.c
浏览文件 @
a53575a1
...
@@ -496,6 +496,12 @@ int32_t tDiskDataBuilderInit(SDiskDataBuilder *pBuilder, STSchema *pTSchema, TAB
...
@@ -496,6 +496,12 @@ int32_t tDiskDataBuilderInit(SDiskDataBuilder *pBuilder, STSchema *pTSchema, TAB
pBuilder
->
nRow
=
0
;
pBuilder
->
nRow
=
0
;
pBuilder
->
cmprAlg
=
cmprAlg
;
pBuilder
->
cmprAlg
=
cmprAlg
;
pBuilder
->
calcSma
=
calcSma
;
pBuilder
->
calcSma
=
calcSma
;
pBuilder
->
bi
=
(
SBlkInfo
){.
minUid
=
INT64_MAX
,
.
maxUid
=
INT64_MIN
,
.
minKey
=
TSDBKEY_MAX
,
.
maxKey
=
TSDBKEY_MIN
,
.
minVer
=
VERSION_MAX
,
.
maxVer
=
VERSION_MIN
};
if
(
pBuilder
->
pUidC
==
NULL
&&
(
code
=
tCompressorCreate
(
&
pBuilder
->
pUidC
)))
return
code
;
if
(
pBuilder
->
pUidC
==
NULL
&&
(
code
=
tCompressorCreate
(
&
pBuilder
->
pUidC
)))
return
code
;
code
=
tCompressStart
(
pBuilder
->
pUidC
,
TSDB_DATA_TYPE_BIGINT
,
cmprAlg
);
code
=
tCompressStart
(
pBuilder
->
pUidC
,
TSDB_DATA_TYPE_BIGINT
,
cmprAlg
);
...
@@ -554,6 +560,8 @@ int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTS
...
@@ -554,6 +560,8 @@ int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTS
ASSERT
(
pBuilder
->
suid
||
pBuilder
->
uid
);
ASSERT
(
pBuilder
->
suid
||
pBuilder
->
uid
);
ASSERT
(
pId
->
suid
==
pBuilder
->
suid
);
ASSERT
(
pId
->
suid
==
pBuilder
->
suid
);
TSDBKEY
key
=
TSDBROW_KEY
(
pRow
);
// uid
// uid
if
(
pBuilder
->
uid
&&
pBuilder
->
uid
!=
pId
->
uid
)
{
if
(
pBuilder
->
uid
&&
pBuilder
->
uid
!=
pId
->
uid
)
{
ASSERT
(
pBuilder
->
suid
);
ASSERT
(
pBuilder
->
suid
);
...
@@ -567,16 +575,20 @@ int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTS
...
@@ -567,16 +575,20 @@ int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTS
code
=
tCompress
(
pBuilder
->
pUidC
,
&
pId
->
uid
,
sizeof
(
int64_t
));
code
=
tCompress
(
pBuilder
->
pUidC
,
&
pId
->
uid
,
sizeof
(
int64_t
));
if
(
code
)
return
code
;
if
(
code
)
return
code
;
}
}
if
(
pBuilder
->
bi
.
minUid
>
pId
->
uid
)
pBuilder
->
bi
.
minUid
=
pId
->
uid
;
if
(
pBuilder
->
bi
.
maxUid
<
pId
->
uid
)
pBuilder
->
bi
.
maxUid
=
pId
->
uid
;
// version
// version
int64_t
version
=
TSDBROW_VERSION
(
pRow
);
code
=
tCompress
(
pBuilder
->
pVerC
,
&
key
.
version
,
sizeof
(
int64_t
));
code
=
tCompress
(
pBuilder
->
pVerC
,
&
version
,
sizeof
(
int64_t
));
if
(
code
)
return
code
;
if
(
code
)
return
code
;
if
(
pBuilder
->
bi
.
minVer
>
key
.
version
)
pBuilder
->
bi
.
minVer
=
key
.
version
;
if
(
pBuilder
->
bi
.
maxVer
<
key
.
version
)
pBuilder
->
bi
.
maxVer
=
key
.
version
;
// TSKEY
// TSKEY
TSKEY
ts
=
TSDBROW_TS
(
pRow
);
code
=
tCompress
(
pBuilder
->
pKeyC
,
&
key
.
ts
,
sizeof
(
int64_t
));
code
=
tCompress
(
pBuilder
->
pKeyC
,
&
ts
,
sizeof
(
int64_t
));
if
(
code
)
return
code
;
if
(
code
)
return
code
;
if
(
tsdbKeyCmprFn
(
&
pBuilder
->
bi
.
minKey
,
&
key
)
>
0
)
pBuilder
->
bi
.
minKey
=
key
;
if
(
tsdbKeyCmprFn
(
&
pBuilder
->
bi
.
maxKey
,
&
key
)
<
0
)
pBuilder
->
bi
.
maxKey
=
key
;
SRowIter
iter
=
{
0
};
SRowIter
iter
=
{
0
};
tRowIterInit
(
&
iter
,
pRow
,
pTSchema
);
tRowIterInit
(
&
iter
,
pRow
,
pTSchema
);
...
@@ -603,12 +615,13 @@ int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTS
...
@@ -603,12 +615,13 @@ int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTS
return
code
;
return
code
;
}
}
int32_t
tGnrtDiskData
(
SDiskDataBuilder
*
pBuilder
,
const
SDiskData
**
ppDiskData
)
{
int32_t
tGnrtDiskData
(
SDiskDataBuilder
*
pBuilder
,
const
SDiskData
**
ppDiskData
,
const
SBlkInfo
**
ppBlkInfo
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
ASSERT
(
pBuilder
->
nRow
);
ASSERT
(
pBuilder
->
nRow
);
*
ppDiskData
=
NULL
;
*
ppDiskData
=
NULL
;
*
ppBlkInfo
=
NULL
;
SDiskData
*
pDiskData
=
&
pBuilder
->
dd
;
SDiskData
*
pDiskData
=
&
pBuilder
->
dd
;
// reset SDiskData
// reset SDiskData
...
@@ -674,5 +687,6 @@ int32_t tGnrtDiskData(SDiskDataBuilder *pBuilder, const SDiskData **ppDiskData)
...
@@ -674,5 +687,6 @@ int32_t tGnrtDiskData(SDiskDataBuilder *pBuilder, const SDiskData **ppDiskData)
}
}
*
ppDiskData
=
pDiskData
;
*
ppDiskData
=
pDiskData
;
*
ppBlkInfo
=
&
pBuilder
->
bi
;
return
code
;
return
code
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录